mono-upnp-0.1.2/0000775000175000017500000000000011761740036014725 5ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/Makefile.include0000664000175000017500000001522711715004016020004 0ustar00lorentzlorentz00000000000000VALID_CULTURES = ar bg ca zh-CHS cs da de el en es fi fr he hu is it ja ko nl no pl pt ro ru hr sk sq sv th tr id uk be sl et lv lt fa vi hy eu mk af ka fo hi sw gu ta te kn mr gl kok ar-SA bg-BG ca-ES zh-TW cs-CZ da-DK de-DE el-GR en-US fi-FI fr-FR he-IL hu-HU is-IS it-IT ja-JP ko-KR nl-NL nb-NO pl-PL pt-BR ro-RO ru-RU hr-HR sk-SK sq-AL sv-SE th-TH tr-TR id-ID uk-UA be-BY sl-SI et-EE lv-LV lt-LT fa-IR vi-VN hy-AM eu-ES mk-MK af-ZA ka-GE fo-FO hi-IN sw-KE gu-IN ta-IN te-IN kn-IN mr-IN gl-ES kok-IN ar-IQ zh-CN de-CH en-GB es-MX fr-BE it-CH nl-BE nn-NO pt-PT sv-FI ar-EG zh-HK de-AT en-AU es-ES fr-CA ar-LY zh-SG de-LU en-CA es-GT fr-CH ar-DZ zh-MO en-NZ es-CR fr-LU ar-MA en-IE es-PA ar-TN en-ZA es-DO ar-OM es-VE ar-YE es-CO ar-SY es-PE ar-JO en-TT es-AR ar-LB en-ZW es-EC ar-KW en-PH es-CL ar-AE es-UY ar-BH es-PY ar-QA es-BO es-SV es-HN es-NI es-PR zh-CHT s2q=$(subst \ ,?,$1) q2s=$(subst ?,\ ,$1) # use this when result will be quoted unesc2=$(subst ?, ,$1) build_sources = $(FILES) $(GENERATED_FILES) build_sources_esc= $(call s2q,$(build_sources)) # use unesc2, as build_sources_embed is quoted build_sources_embed= $(call unesc2,$(build_sources_esc:%='$(srcdir)/%')) comma__=, get_resource_name = $(firstword $(subst $(comma__), ,$1)) get_culture = $(lastword $(subst ., ,$(basename $1))) is_cultured_resource = $(and $(word 3,$(subst ., ,$1)), $(filter $(VALID_CULTURES),$(lastword $(subst ., ,$(basename $1))))) RESOURCES_ESC=$(call s2q,$(RESOURCES)) build_resx_list = $(foreach res, $(RESOURCES_ESC), $(if $(filter %.resx, $(call get_resource_name,$(res))),$(res),)) build_non_culture_resx_list = $(foreach res, $(build_resx_list),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_non_culture_others_list = $(foreach res, $(filter-out $(build_resx_list),$(RESOURCES_ESC)),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_others_list = $(build_non_culture_others_list) build_xamlg_list = $(filter %.xaml.g.cs, $(FILES)) # resgen all .resx resources build_resx_files = $(foreach res, $(build_resx_list), $(call get_resource_name,$(res))) build_resx_resources_esc = $(build_resx_files:.resx=.resources) build_resx_resources = $(call q2s,$(build_resx_resources_esc)) # embed resources for the main assembly build_resx_resources_hack = $(subst .resx,.resources, $(build_non_culture_resx_list)) # use unesc2, as build_resx_resources_embed is quoted build_resx_resources_embed = $(call unesc2,$(build_resx_resources_hack:%='-resource:%')) build_others_files = $(call q2s,$(foreach res, $(build_others_list),$(call get_resource_name,$(res)))) build_others_resources = $(build_others_files) # use unesc2, as build_others_resources_embed is quoted build_others_resources_embed = $(call unesc2,$(build_others_list:%='-resource:$(srcdir)/%')) build_resources = $(build_resx_resources) $(build_others_resources) build_resources_embed = $(build_resx_resources_embed) $(build_others_resources_embed) # -usesourcepath is available only for resgen2 emit_resgen_target_1=$(call q2s,$1) : $(call q2s,$(subst .resources,.resx,$1)); cd '$$(shell dirname '$$<')' && MONO_IOMAP=drive $$(RESGEN) '$$(shell basename '$$<')' '$$(shell basename '$$@')' emit_resgen_target_2=$(call q2s,$1) : $(call q2s,$(subst .resources,.resx,$1)); MONO_IOMAP=drive $$(RESGEN) -usesourcepath '$$<' '$$@' emit_resgen_target=$(if $(filter resgen2,$(RESGEN)),$(emit_resgen_target_2),$(emit_resgen_target_1)) emit_resgen_targets=$(foreach res,$(build_resx_resources_esc),$(eval $(call emit_resgen_target,$(res)))) build_references_ref = $(call q2s,$(foreach ref, $(call s2q,$(REFERENCES)), $(if $(filter -pkg:%, $(ref)), $(ref), $(if $(filter -r:%, $(ref)), $(ref), -r:$(ref))))) build_references_ref += $(call q2s,$(foreach ref, $(call s2q,$(DLL_REFERENCES)), -r:$(ref))) build_references_ref += $(call q2s,$(foreach ref, $(call s2q,$(PROJECT_REFERENCES)), -r:$(ref))) s2q2s=$(call unesc2,$(call s2q,$1)) cp_actual=test -z $1 || cp $1 $2 cp=$(call cp_actual,'$(call s2q2s,$1)','$(call s2q2s,$2)') rm_actual=test -z '$1' || rm -f '$2' rm=$(call rm_actual,$(call s2q2s,$1),$(call s2q2s,$2)/$(shell basename '$(call s2q2s,$1)')) EXTRA_DIST += $(build_sources) $(build_resx_files) $(build_others_files) $(ASSEMBLY_WRAPPER_IN) $(EXTRAS) $(DATA_FILES) $(build_culture_res_files) CLEANFILES += $(ASSEMBLY) $(ASSEMBLY).mdb $(BINARIES) $(build_resx_resources) $(build_satellite_assembly_list) DISTCLEANFILES = $(GENERATED_FILES) $(pc_files) $(BUILD_DIR)/* assemblyfilesdir = $(pkglibdir) assemblyfiles_DATA = $(ASSEMBLY) bin_SCRIPTS = $(BINARIES) programfilesdir = @libdir@/@PACKAGE@ programfiles_DATA = $(PROGRAMFILES) linuxpkgconfigdir = @libdir@/pkgconfig linuxpkgconfig_DATA = $(LINUX_PKGCONFIG) # macros # $(call emit-deploy-target,deploy-variable-name) define emit-deploy-target $($1): $($1_SOURCE) mkdir -p '$$(shell dirname '$$@')' cp '$$<' '$$@' endef # $(call emit-deploy-wrapper,wrapper-variable-name,wrapper-sourcefile,x) # assumes that for a wrapper foo.pc its source template is foo.pc.in # if $3 is non-empty then wrapper is marked exec define emit-deploy-wrapper $($1): $2 mkdir -p '$$(shell dirname '$$@')' cp '$$<' '$$@' $(if $3,chmod +x '$$@') endef # generating satellite assemblies culture_resources = $(foreach res, $(RESOURCES_ESC), $(if $(call is_cultured_resource,$(call get_resource_name, $(res))),$(res))) cultures = $(sort $(foreach res, $(culture_resources), $(call get_culture,$(call get_resource_name,$(res))))) culture_resource_dependencies = $(call q2s,$(BUILD_DIR)/$1/$(SATELLITE_ASSEMBLY_NAME): $(subst .resx,.resources,$2)) culture_resource_commandlines = $(call unesc2,cmd_line_satellite_$1 += '/embed:$(subst .resx,.resources,$2)') build_satellite_assembly_list = $(call q2s,$(cultures:%=$(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME))) build_culture_res_files = $(call q2s,$(foreach res, $(culture_resources),$(call get_resource_name,$(res)))) install_satellite_assembly_list = $(subst $(BUILD_DIR),$(DESTDIR)$(libdir)/$(PACKAGE),$(build_satellite_assembly_list)) $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_dependencies,$(call get_culture,$(call get_resource_name,$(res))),$(call get_resource_name,$(res)))))) $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_commandlines,$(call get_culture,$(call get_resource_name,$(res))),$(res))))) $(build_satellite_assembly_list): $(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME): mkdir -p '$(@D)' $(AL) -out:'$@' -culture:$* -t:lib $(cmd_line_satellite_$*) $(install_satellite_assembly_list): mkdir -p '$(@D)' cp $(subst $(DESTDIR)$(libdir)/$(PACKAGE), $(BUILD_DIR), $@) $@ install-satellite-assemblies: $(install_satellite_assembly_list) uninstall-satellite-assemblies: rm -rf $(install_satellite_assembly_list)mono-upnp-0.1.2/Makefile.am0000664000175000017500000000064211726647303016767 0ustar00lorentzlorentz00000000000000 EXTRA_DIST = \ expansions.m4 \ README.md #Warning: This is an automatically generated file, do not edit! if ENABLE_DEBUG SUBDIRS = src/Mono.Ssdp/Mono.Ssdp src/Mono.Upnp src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1 tests endif if ENABLE_RELEASE SUBDIRS = src/Mono.Ssdp/Mono.Ssdp src/Mono.Upnp src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1 tests endif .PHONY: test test: all (cd bin; $(NUNIT_CMD) *.Tests.dll) mono-upnp-0.1.2/Makefile.in0000664000175000017500000005440111761736756017014 0ustar00lorentzlorentz00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = . DIST_COMMON = $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/configure AUTHORS COPYING \ install-sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/expansions.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags DIST_SUBDIRS = src/Mono.Ssdp/Mono.Ssdp src/Mono.Upnp \ src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1 tests DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ GLADE_SHARP_20_CFLAGS = @GLADE_SHARP_20_CFLAGS@ GLADE_SHARP_20_LIBS = @GLADE_SHARP_20_LIBS@ GLIB_SHARP_20_CFLAGS = @GLIB_SHARP_20_CFLAGS@ GLIB_SHARP_20_LIBS = @GLIB_SHARP_20_LIBS@ GMCS = @GMCS@ GTK_SHARP_20_CFLAGS = @GTK_SHARP_20_CFLAGS@ GTK_SHARP_20_LIBS = @GTK_SHARP_20_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MONO_ADDINS_CFLAGS = @MONO_ADDINS_CFLAGS@ MONO_ADDINS_LIBS = @MONO_ADDINS_LIBS@ NUNIT_CFLAGS = @NUNIT_CFLAGS@ NUNIT_CMD = @NUNIT_CMD@ NUNIT_LIBS = @NUNIT_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TAGLIB_SHARP_CFLAGS = @TAGLIB_SHARP_CFLAGS@ TAGLIB_SHARP_LIBS = @TAGLIB_SHARP_LIBS@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_bindir = @expanded_bindir@ expanded_datadir = @expanded_datadir@ expanded_libdir = @expanded_libdir@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = \ expansions.m4 \ README.md #Warning: This is an automatically generated file, do not edit! @ENABLE_DEBUG_TRUE@SUBDIRS = src/Mono.Ssdp/Mono.Ssdp src/Mono.Upnp src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1 tests @ENABLE_RELEASE_TRUE@SUBDIRS = src/Mono.Ssdp/Mono.Ssdp src/Mono.Upnp src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1 tests all: all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ dist-lzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \ distcheck distclean distclean-generic distclean-tags \ distcleancheck distdir distuninstallcheck dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am tags tags-recursive uninstall uninstall-am .PHONY: test test: all (cd bin; $(NUNIT_CMD) *.Tests.dll) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: mono-upnp-0.1.2/COPYING0000664000175000017500000000213411726647303015764 0ustar00lorentzlorentz00000000000000Copyright (C) 2008-2010 Novell Copyright (C) 2011-2012 mono-upnp contributors (see AUTHORS) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. mono-upnp-0.1.2/AUTHORS0000664000175000017500000000034311726647303016001 0ustar00lorentzlorentz00000000000000Original developers: Aaron Bockover Scott Thomas Peterson Maintainer: Alexander Kojevnikov Contributors: Alan McGovern Bertrand Lorentz Kevin Thompson Tobias Arrskog Yavor Georgiev mono-upnp-0.1.2/configure.ac0000664000175000017500000000624511761735602017225 0ustar00lorentzlorentz00000000000000dnl Warning: This is an automatically generated file, do not edit! dnl Process this file with autoconf to produce a configure script. AC_PREREQ([2.54]) AC_INIT([Mono.Upnp], [0.1.2]) AM_INIT_AUTOMAKE([foreign tar-ustar]) AM_MAINTAINER_MODE dnl pkg-config AC_PATH_PROG(PKG_CONFIG, pkg-config, no) if test "x$PKG_CONFIG" = "xno"; then AC_MSG_ERROR([You need to install pkg-config]) fi SHAMROCK_EXPAND_LIBDIR SHAMROCK_EXPAND_BINDIR SHAMROCK_EXPAND_DATADIR AC_PROG_INSTALL AC_PATH_PROG(GMCS, gmcs, no) if test "x$GMCS" = "xno"; then AC_MSG_ERROR([gmcs Not found]) fi AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [Use 'DEBUG' Configuration [default=YES]]), enable_debug=yes, enable_debug=no) AM_CONDITIONAL(ENABLE_DEBUG, test x$enable_debug = xyes) if test "x$enable_debug" = "xyes" ; then CONFIG_REQUESTED="yes" fi AC_ARG_ENABLE(release, AC_HELP_STRING([--enable-release], [Use 'RELEASE' Configuration [default=NO]]), enable_release=yes, enable_release=no) AM_CONDITIONAL(ENABLE_RELEASE, test x$enable_release = xyes) if test "x$enable_release" = "xyes" ; then CONFIG_REQUESTED="yes" fi if test -z "$CONFIG_REQUESTED" ; then AM_CONDITIONAL(ENABLE_DEBUG, true) enable_debug=yes fi dnl package checks, common for all configs PKG_CHECK_MODULES([GTK_SHARP_20], [gtk-sharp-2.0]) PKG_CHECK_MODULES([GLIB_SHARP_20], [glib-sharp-2.0]) PKG_CHECK_MODULES([GLADE_SHARP_20], [glade-sharp-2.0]) PKG_CHECK_MODULES([MONO_ADDINS], [mono-addins]) PKG_CHECK_MODULES([TAGLIB_SHARP], [taglib-sharp]) PKG_CHECK_MODULES([NUNIT], [nunit]) AC_PATH_PROG(NUNIT_CMD, nunit-console2, nunit-console) AC_SUBST(NUNIT_CMD) AC_CONFIG_FILES([ src/Mono.Ssdp/Mono.Ssdp/mono.ssdp.pc src/Mono.Ssdp/Mono.Ssdp/Makefile src/Mono.Upnp/Mono.Upnp/mono.upnp.pc src/Mono.Upnp/Mono.Upnp/Makefile src/Mono.Upnp/Mono.Upnp.GtkClient/mono-upnp-gtk src/Mono.Upnp/Mono.Upnp.GtkClient/Makefile src/Mono.Upnp/Makefile src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/mono.upnp.dcp.mediaserver1.pc src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Makefile src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MSMediaReceiverRegistrar1/mono.upnp.dcp.msmediareceiverregistrar1.pc src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MSMediaReceiverRegistrar1/Makefile src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem/mono.upnp.dcp.mediaserver1.filesystem.pc src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem/Makefile src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer/mono-upnp-simple-media-server src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer/Makefile src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.GtkClient/mono.upnp.dcp.mediaserver1.gtkclient.pc src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.GtkClient/Makefile src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Makefile tests/Mono.Ssdp.Tests/Makefile tests/Mono.Upnp.Tests/Makefile tests/Mono.Upnp.Dcp.MediaServer1.Tests/Makefile tests/Mono.Upnp.Dcp.MediaServer1.FileSystem.Tests/Makefile tests/Makefile Makefile ]) AC_OUTPUT mono-upnp-0.1.2/install-sh0000755000175000017500000003325611736361705016744 0ustar00lorentzlorentz00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2011-01-19.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 # Protect names problematic for `test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for `test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for `test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: mono-upnp-0.1.2/src/0000775000175000017500000000000011761740036015514 5ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Ssdp/0000775000175000017500000000000011761740036017334 5ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Ssdp/Mono.Ssdp/0000775000175000017500000000000011761740036021154 5ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Ssdp/Mono.Ssdp/Mono.Ssdp/0000775000175000017500000000000011761740036022774 5ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Ssdp/Mono.Ssdp/Mono.Ssdp/Client.cs0000664000175000017500000001712211707010776024545 0ustar00lorentzlorentz00000000000000// // Client.cs // // Author: // Aaron Bockover // // Copyright (C) 2008 Novell, Inc. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Collections.Generic; using System.Net; using System.Net.NetworkInformation; using Mono.Ssdp.Internal; namespace Mono.Ssdp { public class Client : IDisposable { public static bool StrictProtocol { get; set; } private bool disposed; private readonly object mutex = new object(); private NotifyListener notify_listener; private Dictionary browsers; private readonly NetworkInterfaceInfo network_interface_info; internal NetworkInterfaceInfo NetworkInterfaceInfo { get { return network_interface_info; } } private readonly TimeoutDispatcher dispatcher = new TimeoutDispatcher (); internal TimeoutDispatcher Dispatcher { get { return dispatcher; } } private ServiceCache service_cache; internal ServiceCache ServiceCache { get { lock (service_cache) { return service_cache; } } } public bool Started { get; private set; } public event EventHandler ServiceAdded; public event EventHandler ServiceUpdated; public event EventHandler ServiceRemoved; public Client () : this (null) { } public Client (NetworkInterface networkInterface) { network_interface_info = NetworkInterfaceInfo.GetNetworkInterfaceInfo (networkInterface); service_cache = new ServiceCache (this); notify_listener = new NotifyListener (this); browsers = new Dictionary (); } public void Start () { Start (true); } public void Start (bool startBrowsers) { lock (mutex) { CheckDisposed (); if (Started) { throw new InvalidOperationException ("The Client is already started."); } Started = true; notify_listener.Start (); if (startBrowsers) { foreach (var browser in browsers.Values) { if (!browser.Started) { browser.Start (); } } } } } public void Stop () { Stop (true); } public void Stop (bool stopBrowsers) { lock (mutex) { CheckDisposed (); Started = false; notify_listener.Stop (); if (stopBrowsers) { foreach (var browser in browsers.Values) { browser.Stop (); } } } } public Browser BrowseAll () { return BrowseAll (true); } public Browser BrowseAll (bool autoStart) { return Browse (Protocol.SsdpAll, autoStart); } public Browser Browse (string serviceType) { return Browse (serviceType, true); } public Browser Browse (string serviceType, bool autoStart) { lock (mutex) { CheckDisposed (); Browser browser; if (browsers.TryGetValue (serviceType, out browser)) { if (!browser.Started && autoStart) { browser.Start (); } return browser; } browser = new Browser (this, serviceType); browsers.Add (serviceType, browser); if (autoStart) { browser.Start (); } return browser; } } internal void RemoveBrowser (Browser browser) { lock (mutex) { foreach (var entry in browsers) { if (entry.Value == browser) { browsers.Remove (entry.Key); return; } } } } internal bool ServiceTypeRegistered (string serviceType) { lock (mutex) { return serviceType != null && browsers != null && (browsers.ContainsKey (serviceType) || browsers.ContainsKey (Protocol.SsdpAll)); } } internal void CacheServiceAdded (Service service) { OnServiceAdded (service); } internal void CacheServiceUpdated (Service service) { OnServiceUpdated (service); } internal void CacheServiceRemoved (string usn) { OnServiceRemoved (usn); } protected virtual void OnServiceAdded (Service service) { var handler = ServiceAdded; if (handler != null) { handler (this, new ServiceArgs (ServiceOperation.Added, service)); } } protected virtual void OnServiceUpdated (Service service) { var handler = ServiceUpdated; if (handler != null) { handler (this, new ServiceArgs (ServiceOperation.Updated, service)); } } protected virtual void OnServiceRemoved (string usn) { var handler = ServiceRemoved; if (handler != null) { handler (this, new ServiceArgs (usn)); } } private void CheckDisposed () { if (disposed) { throw new ObjectDisposedException ("Client has been Disposed"); } } public void Dispose () { lock (mutex) { if (disposed) { return; } notify_listener.Stop (); foreach (var browser in browsers.Values) { browser.Dispose (false); } browsers.Clear (); service_cache.Dispose (); service_cache = null; notify_listener = null; browsers = null; disposed = true; } } } } mono-upnp-0.1.2/src/Mono.Ssdp/Mono.Ssdp/Mono.Ssdp/ServiceHandler.cs0000664000175000017500000000243611707010776026227 0ustar00lorentzlorentz00000000000000// // ServiceHandler.cs // // Author: // Aaron Bockover // // Copyright (C) 2008 Novell, Inc. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; namespace Mono.Ssdp { public delegate void ServiceHandler (object o, ServiceArgs args); } mono-upnp-0.1.2/src/Mono.Ssdp/Mono.Ssdp/Mono.Ssdp/Announcer.cs0000664000175000017500000001344311707010776025261 0ustar00lorentzlorentz00000000000000// // Announcer.cs // // Author: // Scott Peterson // // Copyright (C) 2008 S&S Black Ltd. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Collections.Generic; using System.Net; using System.Threading; using Mono.Ssdp.Internal; namespace Mono.Ssdp { public class Announcer { static readonly Random random = new Random (); readonly object mutex = new object (); public string Location { get; set; } public string Type { get; set; } public string Name { get; set; } ushort max_age = Protocol.DefaultMaxAge; [CLSCompliantAttribute (false)] public ushort MaxAge { get { return max_age; } set { max_age = System.Math.Max (Protocol.DefaultMaxAge, value); } } volatile uint announcement_timeout_id; TimeSpan GetInterval () { return TimeSpan.FromMilliseconds (random.Next (MaxAge * 1000 / 2)); } static TimeSpan GetInterval (ushort mx) { // FIXME lame return TimeSpan.FromMilliseconds (random.Next (System.Math.Min (Protocol.MaxMX * 1000, mx * 1000))); } readonly Server server; public Server Server { get { return server; } } public bool Started { get; private set; } public bool IsDisposed { get { return server.IsDisposed; } } internal Announcer (Server server, string name, string type, string location) { this.server = server; Name = name; Type = type; Location = location; } public void Start () { lock (mutex) { CheckDisposed (); if (Started) { throw new InvalidOperationException ("The announcer is already running. Cancel it first."); } if (!server.Started) { server.Start (false); } AnnounceAlive (); announcement_timeout_id = server.Dispatcher.Add (GetInterval (), OnAnnounceTimeout); Started = true; } } public void Stop () { lock (mutex) { CheckDisposed (); if (announcement_timeout_id == 0) { return; } var handle = StopAsync (); handle.WaitOne (); } } internal WaitHandle StopAsync () { lock (mutex) { if (announcement_timeout_id == 0) { return new ManualResetEvent (true); } server.Dispatcher.Remove (announcement_timeout_id); announcement_timeout_id = 0; return server.AnnounceSocket.BeginSendTo (Protocol.CreateByeByeNotify (Type, Name), OnByeBye).AsyncWaitHandle; } } void OnByeBye (IAsyncResult asyncResult) { var socket = (SsdpSocket)asyncResult.AsyncState; try { socket.EndSendTo (asyncResult); } catch { } Started = false; } internal void Stop (WaitHandle wait) { } bool OnAnnounceTimeout (object state, ref TimeSpan interval) { lock (mutex) { AnnounceAlive (); interval = GetInterval (); return true; } } void AnnounceAlive () { Server.AnnounceSocket.BeginSendTo (Protocol.CreateAliveNotify (Location, Type, Name, MaxAge), OnFinished); } internal void Respond (IPEndPoint endPoint, ushort mx) { var interval = GetInterval (mx); Server.Dispatcher.Add (interval, OnRespondTimeout, endPoint); } bool OnRespondTimeout (object state, ref TimeSpan interval) { lock (mutex) { if (announcement_timeout_id != 0) { server.RespondSocket.BeginSendTo (Protocol.CreateAliveResponse (Location, Type, Name, MaxAge), OnFinished, (IPEndPoint)state); } return false; } } void OnFinished (IAsyncResult asyncResult) { var socket = (SsdpSocket)asyncResult.AsyncState; socket.EndSendTo (asyncResult); } void CheckDisposed () { if (IsDisposed) { throw new ObjectDisposedException ("Announcer has been Disposed"); } } } } mono-upnp-0.1.2/src/Mono.Ssdp/Mono.Ssdp/Mono.Ssdp/BrowseService.cs0000664000175000017500000001316211704316672026112 0ustar00lorentzlorentz00000000000000// // BrowseService.cs // // Author: // Aaron Bockover // // Copyright (C) 2008 Novell, Inc. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Collections.Generic; using System.Text.RegularExpressions; using Mono.Ssdp.Internal; namespace Mono.Ssdp { public class BrowseService : Service { private static Regex cc_max_age_regex; private BrowseService () { } internal BrowseService (HttpDatagram dgram, bool isGena) { Update (dgram, isGena); } internal void Update (HttpDatagram dgram, bool isGena) { if (isGena) { ServiceType = dgram.Headers.Get ("NT"); if (Client.StrictProtocol && String.IsNullOrEmpty (dgram.Headers.Get ("Host"))) { throw new ApplicationException ("Service did not send Host header"); } } else { ServiceType = dgram.Headers.Get ("ST"); if (Client.StrictProtocol && dgram.Headers.Get ("Ext") == null) { throw new ApplicationException ("Service did not send an Ext header " + "acknowledging 'Man: \"ssdp:discover\"' in request"); } } if (String.IsNullOrEmpty (ServiceType)) { throw new ApplicationException (String.Format ("Service did not send {0} header", isGena ? "NT" : "ST")); } Usn = dgram.Headers.Get ("USN"); if (String.IsNullOrEmpty (Usn)) { throw new ApplicationException ("Service did not send USN header"); } if (Client.StrictProtocol) { if (String.IsNullOrEmpty (dgram.Headers.Get ("Server"))) { throw new ApplicationException ("Service did not send Server header"); } if (String.IsNullOrEmpty (dgram.Headers.Get ("Server"))) { throw new ApplicationException ("Service did not send Server header"); } } ParseExpiration (dgram); ParseLocations (dgram); } private void ParseLocations (HttpDatagram dgram) { ClearLocations (); string location = dgram.Headers.Get ("Location"); if (!String.IsNullOrEmpty (location)) { AddLocation (location); } string [] als = dgram.Headers.GetValues ("AL"); if (als != null) { foreach (string al in als) { AddLocation (al); } } if (LocationCount == 0) { throw new ApplicationException ("No Location/AL found in header"); } } private void ParseExpiration (HttpDatagram dgram) { // Prefer the "Cache-Control: max-age=SECONDS" directive string cc_max_age = dgram.Headers.Get ("Cache-Control"); if (!String.IsNullOrEmpty (cc_max_age)) { if (cc_max_age_regex == null) { cc_max_age_regex = new Regex (@"max-age\s*=\s*([0-9]+)", RegexOptions.IgnoreCase); } Match match = cc_max_age_regex.Match (cc_max_age); if (match.Success && match.Groups.Count == 2) { ushort expire = 0; if (UInt16.TryParse (match.Groups[1].Value, out expire)) { Expiration = DateTime.Now + TimeSpan.FromSeconds (expire); return; } } } // Fall back to possible Expires header string expires = dgram.Headers.Get ("Expires"); if (String.IsNullOrEmpty (expires)) { DateTime expire_date; if (DateTime.TryParse (expires, out expire_date)) { DateTime now = DateTime.Now; if (expire_date <= now || expire_date >= now.AddYears (1)) { Expiration = expire_date; return; } } } if (Client.StrictProtocol) { throw new ApplicationException ("Service does not specifiy a cache expiration"); } // Fall back to the default expiration value Expiration = DateTime.Now + TimeSpan.FromSeconds (Protocol.DefaultMaxAge); } } } mono-upnp-0.1.2/src/Mono.Ssdp/Mono.Ssdp/Mono.Ssdp/ServiceOperation.cs0000664000175000017500000000244711707010776026614 0ustar00lorentzlorentz00000000000000// // ServiceOperation.cs // // Author: // Aaron Bockover // // Copyright (C) 2008 Novell, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. namespace Mono.Ssdp { public enum ServiceOperation { Added, Updated, Removed } }mono-upnp-0.1.2/src/Mono.Ssdp/Mono.Ssdp/Mono.Ssdp/Server.cs0000664000175000017500000001760011707010776024576 0ustar00lorentzlorentz00000000000000// // Server.cs // // Author: // Scott Peterson // // Copyright (C) 2008 S&S Black Ltd. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Collections.Generic; using System.Net; using System.Net.NetworkInformation; using System.Threading; using Mono.Ssdp.Internal; namespace Mono.Ssdp { public class Server : IDisposable { readonly object mutex = new object (); readonly string default_location; bool disposed; readonly RequestListener request_listener; readonly Dictionary announcers; readonly NetworkInterfaceInfo network_interface_info; internal NetworkInterfaceInfo NetworkInterfaceInfo { get { return network_interface_info; } } public bool Started { get; private set; } public bool IsDisposed { get { return disposed; } } readonly TimeoutDispatcher dispatcher = new TimeoutDispatcher (); internal TimeoutDispatcher Dispatcher { get { return dispatcher; } } internal SsdpSocket AnnounceSocket { get; private set; } internal SsdpSocket RespondSocket { get; private set; } public Server () : this (null, null) { } public Server (string defaultLocation) : this (defaultLocation, null) { } public Server (NetworkInterface networkInterface) : this (null, networkInterface) { } public Server (string defaultLocation, NetworkInterface networkInterface) { default_location = defaultLocation; network_interface_info = NetworkInterfaceInfo.GetNetworkInterfaceInfo (networkInterface); request_listener = new RequestListener (this); announcers = new Dictionary (); } public Announcer Announce (string type, string name) { return Announce (type, name, default_location, true); } public Announcer Announce (string type, string name, string location) { return Announce (type, name, location, true); } public Announcer Announce (string type, string name, bool autoStart) { return Announce (type, name, default_location, autoStart); } public Announcer Announce (string type, string name, string location, bool autoStart) { lock (mutex) { CheckDisposed (); if (type == null) { throw new ArgumentNullException ("type"); } if (name == null) { throw new ArgumentNullException ("name"); } if (location == null) { throw new ArgumentNullException ("location"); } Announcer announcer; if (announcers.TryGetValue (name, out announcer)) { if (!announcer.Started && autoStart) { announcer.Start (); } return announcer; } announcer = new Announcer (this, name, type, location); announcers.Add (name, announcer); if (autoStart) { announcer.Start (); } return announcer; } } public void Start () { Start (true); } public void Start (bool startAnnouncers) { lock (mutex) { CheckDisposed (); if (Started) { throw new InvalidOperationException ("The Server is already started."); } Started = true; request_listener.Start (); AnnounceSocket = new MulticastSsdpSocket (network_interface_info); AnnounceSocket.Bind (new IPEndPoint (IPAddress.Any, 0)); RespondSocket = new SsdpSocket (network_interface_info.Address); RespondSocket.Bind (new IPEndPoint (IPAddress.Any, Protocol.Port)); if (startAnnouncers) { foreach (Announcer announcer in announcers.Values) { if (!announcer.Started) { announcer.Start (); } } } } } public void Stop () { lock (mutex) { CheckDisposed (); if (!Started) { return; } var handles = new WaitHandle[announcers.Count]; int i = 0; foreach (var announcer in announcers.Values) { handles[i++] = announcer.StopAsync (); } request_listener.Stop (); RespondSocket.Close (); RespondSocket = null; WaitHandle.WaitAll (handles); AnnounceSocket.Close (); AnnounceSocket = null; Started = false; } } internal void RequestRecieved (Request request) { foreach (var announcer in Match (request.ST)) { announcer.Respond (request.EndPoint, request.MX); } } IEnumerable Match (string st) { if (st == Protocol.SsdpAll) { return announcers.Values; } else { return MatchTypeOrName (st); } } IEnumerable MatchTypeOrName (string st) { if (st.StartsWith ("uuid:")) { foreach (var announcer in announcers.Values) { if (announcer.Name.StartsWith (st)) { yield return announcer; } } } else { foreach (var announcer in announcers.Values) { if (announcer.Type == st) { yield return announcer; } } } } void CheckDisposed () { if (disposed) { throw new ObjectDisposedException ("Browser has been Disposed"); } } public void Dispose () { lock (mutex) { if (disposed) { return; } Stop (); request_listener.Dispose (); dispatcher.Dispose (); disposed = true; } } } } mono-upnp-0.1.2/src/Mono.Ssdp/Mono.Ssdp/Mono.Ssdp/ServiceArgs.cs0000664000175000017500000000417411707010776025547 0ustar00lorentzlorentz00000000000000// // ServiceArgs.cs // // Author: // Aaron Bockover // // Copyright (C) 2008 Novell, Inc. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; namespace Mono.Ssdp { public sealed class ServiceArgs : EventArgs { private readonly ServiceOperation operation; private readonly string usn; private readonly Service service; public ServiceArgs (string usn) : this (ServiceOperation.Removed, usn, null) { } public ServiceArgs (ServiceOperation operation, Service service) : this (operation, service.Usn, service) { } public ServiceArgs (ServiceOperation operation, string usn, Service service) { this.operation = operation; this.usn = usn; this.service = service; } public ServiceOperation Operation { get { return operation; } } public string Usn { get { return usn; } } public Service Service { get { return service; } } } } mono-upnp-0.1.2/src/Mono.Ssdp/Mono.Ssdp/Mono.Ssdp/Service.cs0000664000175000017500000000632511726700536024733 0ustar00lorentzlorentz00000000000000// // Service.cs // // Author: // Aaron Bockover // // Copyright (C) 2008 Novell, Inc. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Collections.Generic; using System.Text.RegularExpressions; using Mono.Ssdp.Internal; namespace Mono.Ssdp { public abstract class Service { private List locations = new List (); private string usn; private string service_type; private DateTime expiration; private uint timeout_id; internal Service () { } public void AddLocation (string location) { lock (locations) { locations.Add (location); } } public void RemoveLocation (string location) { lock (locations) { locations.Remove (location); } } public void ClearLocations () { lock (locations) { locations.Clear (); } } public string GetLocation (int index) { lock (locations) { return locations[index]; } } public int LocationCount { get { lock (locations) { return locations.Count; } } } public IEnumerable Locations { get { lock (locations) { foreach (string location in locations) { yield return location; } } } } public override string ToString () { return Usn; } public string Usn { get { return usn; } set { usn = value; } } public string ServiceType { get { return service_type; } set { service_type = value; } } public DateTime Expiration { get { return expiration; } set { expiration = value; } } internal uint TimeoutId { get { return timeout_id; } set { timeout_id = value; } } } } mono-upnp-0.1.2/src/Mono.Ssdp/Mono.Ssdp/Mono.Ssdp/Browser.cs0000664000175000017500000001264311726655235024763 0ustar00lorentzlorentz00000000000000// // Browser.cs // // Author: // Aaron Bockover // // Copyright (C) 2008 Novell, Inc. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using Mono.Ssdp.Internal; namespace Mono.Ssdp { public class Browser : MulticastReader, IDisposable { private SsdpSocket socket; private bool disposed; private readonly object mutex = new object (); private uint timout_id; private Client client; public Client Client { get { return client; } } private ushort mx = Protocol.DefaultMx; [CLSCompliantAttribute (false)] public ushort MX { get { return mx; } set { mx = System.Math.Min (value, Protocol.MaxMX); } } private string service_type; public string ServiceType { get { lock (mutex) { return service_type; } } set { lock (mutex) { service_type = value; } } } public bool Started { get { return socket != null; } } private bool auto_stop = false; public bool AutoStop { get { return auto_stop; } set { auto_stop = value; } } internal Browser (Client client, string serviceType) { this.client = client; this.service_type = serviceType; } public void Dispose () { Dispose (true); } internal void Dispose (bool removeFromClient) { Stop (); if (removeFromClient) { client.RemoveBrowser (this); } client = null; disposed = true; } private void CheckDisposed () { if (disposed) { throw new ObjectDisposedException ("Browser has been Disposed"); } } public void Start () { lock (mutex) { CheckDisposed (); if (Started) { throw new InvalidOperationException ("A browse operation is already running. Cancel it first."); } else if (String.IsNullOrEmpty (service_type)) { throw new ArgumentNullException ("ServiceType"); } socket = new MulticastSsdpSocket (client.NetworkInterfaceInfo); socket.BeginSendTo (Protocol.CreateDiscoveryRequest (service_type, MX), OnBrowseRequestFinished); // wait for 4 times MX if (AutoStop) { timout_id = client.Dispatcher.Add (TimeSpan.FromSeconds (MX * 3), OnTimeout); } if (!client.Started) { client.Start (false); } } } private bool OnTimeout (object state, ref TimeSpan interval) { lock (mutex) { timout_id = 0; Stop (); return false; } } public void Stop () { lock (mutex) { CheckDisposed (); if (timout_id != 0) { client.Dispatcher.Remove (timout_id); timout_id = 0; } if (socket != null) { socket.Close (); socket = null; } } } internal override bool OnAsyncResultReceived (AsyncReceiveBuffer result) { try { HttpDatagram dgram = HttpDatagram.Parse (result.Buffer); if (dgram == null) { return true; } try { client.ServiceCache.Add (new BrowseService (dgram, false)); } catch (Exception e) { Log.Exception ("Invalid browse response", e); } } catch (Exception e) { Log.Exception ("Invalid HTTPU datagram", e); } return true; } private void OnBrowseRequestFinished (IAsyncResult asyncResult) { SsdpSocket socket = (SsdpSocket)asyncResult.AsyncState; socket.EndSendTo (asyncResult); AsyncReadResult (socket); } } } mono-upnp-0.1.2/src/Mono.Ssdp/Mono.Ssdp/Mono.Ssdp/MulticastReader.cs0000664000175000017500000000511611707010776026417 0ustar00lorentzlorentz00000000000000// // MulticastReader.cs // // Author: // Aaron Bockover // // Copyright (C) 2008 Novell, Inc. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Net; using System.Net.Sockets; using Mono.Ssdp.Internal; namespace Mono.Ssdp { public abstract class MulticastReader { internal MulticastReader () { } internal void AsyncReadResult (SsdpSocket socket) { AsyncReadResult(new AsyncReceiveBuffer (socket)); } void AsyncReadResult (AsyncReceiveBuffer buffer) { try { buffer.Socket.BeginReceiveFrom (buffer, OnAsyncResultReceived); } catch (ObjectDisposedException) { // Socket disposed while we were receiving from it... just ignore this } } void OnAsyncResultReceived (IAsyncResult asyncResult) { var buffer = (AsyncReceiveBuffer)asyncResult.AsyncState; try { buffer.BytesReceived = buffer.Socket.EndReceiveFrom (asyncResult, ref buffer.SenderEndPoint); } catch (ObjectDisposedException) { // Socket already disposed... just ignore this and exit return; } if (OnAsyncResultReceived (buffer)) { AsyncReadResult (buffer); } else { buffer.Socket.Close (); } } internal virtual bool OnAsyncResultReceived (AsyncReceiveBuffer result) { return false; } } } mono-upnp-0.1.2/src/Mono.Ssdp/Mono.Ssdp/Makefile.am0000664000175000017500000000033011715002253023173 0ustar00lorentzlorentz00000000000000 EXTRA_DIST = #Warning: This is an automatically generated file, do not edit! if ENABLE_DEBUG SUBDIRS = . endif if ENABLE_RELEASE SUBDIRS = . endif # Include project specific makefile include Mono.Ssdp.makemono-upnp-0.1.2/src/Mono.Ssdp/Mono.Ssdp/Makefile.in0000664000175000017500000007764411761736755023260 0ustar00lorentzlorentz00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Warning: This is an automatically generated file, do not edit! VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/Mono.Ssdp.make $(srcdir)/mono.ssdp.pc.in \ $(top_srcdir)/Makefile.include subdir = src/Mono.Ssdp/Mono.Ssdp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/expansions.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = mono.ssdp.pc CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(bindir)" \ "$(DESTDIR)$(assemblyfilesdir)" \ "$(DESTDIR)$(linuxpkgconfigdir)" \ "$(DESTDIR)$(programfilesdir)" SCRIPTS = $(bin_SCRIPTS) SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive DATA = $(assemblyfiles_DATA) $(linuxpkgconfig_DATA) \ $(programfiles_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = . DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ GLADE_SHARP_20_CFLAGS = @GLADE_SHARP_20_CFLAGS@ GLADE_SHARP_20_LIBS = @GLADE_SHARP_20_LIBS@ GLIB_SHARP_20_CFLAGS = @GLIB_SHARP_20_CFLAGS@ GLIB_SHARP_20_LIBS = @GLIB_SHARP_20_LIBS@ GMCS = @GMCS@ GTK_SHARP_20_CFLAGS = @GTK_SHARP_20_CFLAGS@ GTK_SHARP_20_LIBS = @GTK_SHARP_20_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MONO_ADDINS_CFLAGS = @MONO_ADDINS_CFLAGS@ MONO_ADDINS_LIBS = @MONO_ADDINS_LIBS@ NUNIT_CFLAGS = @NUNIT_CFLAGS@ NUNIT_CMD = @NUNIT_CMD@ NUNIT_LIBS = @NUNIT_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TAGLIB_SHARP_CFLAGS = @TAGLIB_SHARP_CFLAGS@ TAGLIB_SHARP_LIBS = @TAGLIB_SHARP_LIBS@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_bindir = @expanded_bindir@ expanded_datadir = @expanded_datadir@ expanded_libdir = @expanded_libdir@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = $(build_sources) $(build_resx_files) \ $(build_others_files) $(ASSEMBLY_WRAPPER_IN) $(EXTRAS) \ $(DATA_FILES) $(build_culture_res_files) #Warning: This is an automatically generated file, do not edit! @ENABLE_DEBUG_TRUE@SUBDIRS = . @ENABLE_RELEASE_TRUE@SUBDIRS = . @ENABLE_DEBUG_TRUE@ASSEMBLY_COMPILER_COMMAND = gmcs @ENABLE_RELEASE_TRUE@ASSEMBLY_COMPILER_COMMAND = gmcs @ENABLE_DEBUG_TRUE@ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug "-define:DEBUG" "-keyfile:$(srcdir)/mono-ssdp.snk" @ENABLE_RELEASE_TRUE@ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ "-keyfile:$(srcdir)/mono-ssdp.snk" @ENABLE_DEBUG_TRUE@ASSEMBLY = ../../../bin/Mono.Ssdp.dll @ENABLE_RELEASE_TRUE@ASSEMBLY = ../../../bin/Mono.Ssdp.dll @ENABLE_DEBUG_TRUE@ASSEMBLY_MDB = $(ASSEMBLY).mdb @ENABLE_RELEASE_TRUE@ASSEMBLY_MDB = @ENABLE_DEBUG_TRUE@COMPILE_TARGET = library @ENABLE_RELEASE_TRUE@COMPILE_TARGET = library @ENABLE_DEBUG_TRUE@PROJECT_REFERENCES = @ENABLE_RELEASE_TRUE@PROJECT_REFERENCES = @ENABLE_DEBUG_TRUE@BUILD_DIR = ../../../bin @ENABLE_RELEASE_TRUE@BUILD_DIR = ../../../bin @ENABLE_DEBUG_TRUE@MONO_SSDP_DLL_MDB_SOURCE = ../../../bin/Mono.Ssdp.dll.mdb @ENABLE_DEBUG_TRUE@MONO_SSDP_DLL_MDB = $(BUILD_DIR)/Mono.Ssdp.dll.mdb @ENABLE_RELEASE_TRUE@MONO_SSDP_DLL_MDB = AL = al2 SATELLITE_ASSEMBLY_NAME = $(notdir $(basename $(ASSEMBLY))).resources.dll PROGRAMFILES = \ $(MONO_SSDP_DLL_MDB) LINUX_PKGCONFIG = \ $(MONO_SSDP_PC) RESGEN = resgen2 FILES = \ AssemblyInfo.cs \ Mono.Ssdp/Announcer.cs \ Mono.Ssdp/Browser.cs \ Mono.Ssdp/BrowseService.cs \ Mono.Ssdp/Client.cs \ Mono.Ssdp/MulticastReader.cs \ Mono.Ssdp/Server.cs \ Mono.Ssdp/Service.cs \ Mono.Ssdp/ServiceArgs.cs \ Mono.Ssdp/ServiceHandler.cs \ Mono.Ssdp.Internal/AsyncReceiveBuffer.cs \ Mono.Ssdp.Internal/HttpDatagram.cs \ Mono.Ssdp.Internal/HttpDatagramType.cs \ Mono.Ssdp.Internal/Log.cs \ Mono.Ssdp.Internal/NotifyListener.cs \ Mono.Ssdp.Internal/Protocol.cs \ Mono.Ssdp.Internal/RequestListener.cs \ Mono.Ssdp.Internal/ServiceCache.cs \ Mono.Ssdp.Internal/SsdpSocket.cs \ Mono.Ssdp.Internal/TimeoutDispatcher.cs \ Mono.Ssdp.Internal/MulticastSsdpSocket.cs \ Mono.Ssdp.Internal/NetworkInterfaceInfo.cs \ Mono.Ssdp/ServiceOperation.cs DATA_FILES = RESOURCES = EXTRAS = \ mono-ssdp.snk \ mono.ssdp.pc.in REFERENCES = \ System DLL_REFERENCES = CLEANFILES = $(PROGRAMFILES) $(LINUX_PKGCONFIG) $(ASSEMBLY) \ $(ASSEMBLY).mdb $(BINARIES) $(build_resx_resources) \ $(build_satellite_assembly_list) VALID_CULTURES = ar bg ca zh-CHS cs da de el en es fi fr he hu is it ja ko nl no pl pt ro ru hr sk sq sv th tr id uk be sl et lv lt fa vi hy eu mk af ka fo hi sw gu ta te kn mr gl kok ar-SA bg-BG ca-ES zh-TW cs-CZ da-DK de-DE el-GR en-US fi-FI fr-FR he-IL hu-HU is-IS it-IT ja-JP ko-KR nl-NL nb-NO pl-PL pt-BR ro-RO ru-RU hr-HR sk-SK sq-AL sv-SE th-TH tr-TR id-ID uk-UA be-BY sl-SI et-EE lv-LV lt-LT fa-IR vi-VN hy-AM eu-ES mk-MK af-ZA ka-GE fo-FO hi-IN sw-KE gu-IN ta-IN te-IN kn-IN mr-IN gl-ES kok-IN ar-IQ zh-CN de-CH en-GB es-MX fr-BE it-CH nl-BE nn-NO pt-PT sv-FI ar-EG zh-HK de-AT en-AU es-ES fr-CA ar-LY zh-SG de-LU en-CA es-GT fr-CH ar-DZ zh-MO en-NZ es-CR fr-LU ar-MA en-IE es-PA ar-TN en-ZA es-DO ar-OM es-VE ar-YE es-CO ar-SY es-PE ar-JO en-TT es-AR ar-LB en-ZW es-EC ar-KW en-PH es-CL ar-AE es-UY ar-BH es-PY ar-QA es-BO es-SV es-HN es-NI es-PR zh-CHT s2q = $(subst \ ,?,$1) q2s = $(subst ?,\ ,$1) # use this when result will be quoted unesc2 = $(subst ?, ,$1) build_sources = $(FILES) $(GENERATED_FILES) build_sources_esc = $(call s2q,$(build_sources)) # use unesc2, as build_sources_embed is quoted build_sources_embed = $(call unesc2,$(build_sources_esc:%='$(srcdir)/%')) comma__ = , get_resource_name = $(firstword $(subst $(comma__), ,$1)) get_culture = $(lastword $(subst ., ,$(basename $1))) is_cultured_resource = $(and $(word 3,$(subst ., ,$1)), $(filter $(VALID_CULTURES),$(lastword $(subst ., ,$(basename $1))))) RESOURCES_ESC = $(call s2q,$(RESOURCES)) build_resx_list = $(foreach res, $(RESOURCES_ESC), $(if $(filter %.resx, $(call get_resource_name,$(res))),$(res),)) build_non_culture_resx_list = $(foreach res, $(build_resx_list),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_non_culture_others_list = $(foreach res, $(filter-out $(build_resx_list),$(RESOURCES_ESC)),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_others_list = $(build_non_culture_others_list) build_xamlg_list = $(filter %.xaml.g.cs, $(FILES)) # resgen all .resx resources build_resx_files = $(foreach res, $(build_resx_list), $(call get_resource_name,$(res))) build_resx_resources_esc = $(build_resx_files:.resx=.resources) build_resx_resources = $(call q2s,$(build_resx_resources_esc)) # embed resources for the main assembly build_resx_resources_hack = $(subst .resx,.resources, $(build_non_culture_resx_list)) # use unesc2, as build_resx_resources_embed is quoted build_resx_resources_embed = $(call unesc2,$(build_resx_resources_hack:%='-resource:%')) build_others_files = $(call q2s,$(foreach res, $(build_others_list),$(call get_resource_name,$(res)))) build_others_resources = $(build_others_files) # use unesc2, as build_others_resources_embed is quoted build_others_resources_embed = $(call unesc2,$(build_others_list:%='-resource:$(srcdir)/%')) build_resources = $(build_resx_resources) $(build_others_resources) build_resources_embed = $(build_resx_resources_embed) $(build_others_resources_embed) # -usesourcepath is available only for resgen2 emit_resgen_target_1 = $(call q2s,$1) : $(call q2s,$(subst .resources,.resx,$1)); cd '$$(shell dirname '$$<')' && MONO_IOMAP=drive $$(RESGEN) '$$(shell basename '$$<')' '$$(shell basename '$$@')' emit_resgen_target_2 = $(call q2s,$1) : $(call q2s,$(subst .resources,.resx,$1)); MONO_IOMAP=drive $$(RESGEN) -usesourcepath '$$<' '$$@' emit_resgen_target = $(if $(filter resgen2,$(RESGEN)),$(emit_resgen_target_2),$(emit_resgen_target_1)) emit_resgen_targets = $(foreach res,$(build_resx_resources_esc),$(eval $(call emit_resgen_target,$(res)))) build_references_ref = $(call q2s,$(foreach ref, $(call \ s2q,$(REFERENCES)), $(if $(filter -pkg:%, $(ref)), $(ref), \ $(if $(filter -r:%, $(ref)), $(ref), -r:$(ref))))) $(call \ q2s,$(foreach ref, $(call s2q,$(DLL_REFERENCES)), -r:$(ref))) \ $(call q2s,$(foreach ref, $(call s2q,$(PROJECT_REFERENCES)), \ -r:$(ref))) s2q2s = $(call unesc2,$(call s2q,$1)) cp_actual = test -z $1 || cp $1 $2 cp = $(call cp_actual,'$(call s2q2s,$1)','$(call s2q2s,$2)') rm_actual = test -z '$1' || rm -f '$2' rm = $(call rm_actual,$(call s2q2s,$1),$(call s2q2s,$2)/$(shell basename '$(call s2q2s,$1)')) DISTCLEANFILES = $(GENERATED_FILES) $(pc_files) $(BUILD_DIR)/* assemblyfilesdir = $(pkglibdir) assemblyfiles_DATA = $(ASSEMBLY) bin_SCRIPTS = $(BINARIES) programfilesdir = @libdir@/@PACKAGE@ programfiles_DATA = $(PROGRAMFILES) linuxpkgconfigdir = @libdir@/pkgconfig linuxpkgconfig_DATA = $(LINUX_PKGCONFIG) # generating satellite assemblies culture_resources = $(foreach res, $(RESOURCES_ESC), $(if $(call is_cultured_resource,$(call get_resource_name, $(res))),$(res))) cultures = $(sort $(foreach res, $(culture_resources), $(call get_culture,$(call get_resource_name,$(res))))) culture_resource_dependencies = $(call q2s,$(BUILD_DIR)/$1/$(SATELLITE_ASSEMBLY_NAME): $(subst .resx,.resources,$2)) culture_resource_commandlines = $(call unesc2,cmd_line_satellite_$1 += '/embed:$(subst .resx,.resources,$2)') build_satellite_assembly_list = $(call q2s,$(cultures:%=$(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME))) build_culture_res_files = $(call q2s,$(foreach res, $(culture_resources),$(call get_resource_name,$(res)))) install_satellite_assembly_list = $(subst $(BUILD_DIR),$(DESTDIR)$(libdir)/$(PACKAGE),$(build_satellite_assembly_list)) MONO_SSDP_PC = $(BUILD_DIR)/mono.ssdp.pc all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/Mono.Ssdp.make $(top_srcdir)/Makefile.include $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Mono.Ssdp/Mono.Ssdp/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Mono.Ssdp/Mono.Ssdp/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(srcdir)/Mono.Ssdp.make $(top_srcdir)/Makefile.include: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mono.ssdp.pc: $(top_builddir)/config.status $(srcdir)/mono.ssdp.pc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) install-assemblyfilesDATA: $(assemblyfiles_DATA) @$(NORMAL_INSTALL) test -z "$(assemblyfilesdir)" || $(MKDIR_P) "$(DESTDIR)$(assemblyfilesdir)" @list='$(assemblyfiles_DATA)'; test -n "$(assemblyfilesdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(assemblyfilesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(assemblyfilesdir)" || exit $$?; \ done uninstall-assemblyfilesDATA: @$(NORMAL_UNINSTALL) @list='$(assemblyfiles_DATA)'; test -n "$(assemblyfilesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(assemblyfilesdir)'; $(am__uninstall_files_from_dir) install-linuxpkgconfigDATA: $(linuxpkgconfig_DATA) @$(NORMAL_INSTALL) test -z "$(linuxpkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(linuxpkgconfigdir)" @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(linuxpkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(linuxpkgconfigdir)" || exit $$?; \ done uninstall-linuxpkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(linuxpkgconfigdir)'; $(am__uninstall_files_from_dir) install-programfilesDATA: $(programfiles_DATA) @$(NORMAL_INSTALL) test -z "$(programfilesdir)" || $(MKDIR_P) "$(DESTDIR)$(programfilesdir)" @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(programfilesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(programfilesdir)" || exit $$?; \ done uninstall-programfilesDATA: @$(NORMAL_UNINSTALL) @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(programfilesdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(SCRIPTS) $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(assemblyfilesdir)" "$(DESTDIR)$(linuxpkgconfigdir)" "$(DESTDIR)$(programfilesdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-assemblyfilesDATA install-linuxpkgconfigDATA \ install-programfilesDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-binSCRIPTS install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-assemblyfilesDATA uninstall-binSCRIPTS \ uninstall-linuxpkgconfigDATA uninstall-programfilesDATA .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic ctags \ ctags-recursive distclean distclean-generic distclean-tags \ distdir dvi dvi-am html html-am info info-am install \ install-am install-assemblyfilesDATA install-binSCRIPTS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-linuxpkgconfigDATA \ install-man install-pdf install-pdf-am \ install-programfilesDATA install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \ tags-recursive uninstall uninstall-am \ uninstall-assemblyfilesDATA uninstall-binSCRIPTS \ uninstall-linuxpkgconfigDATA uninstall-programfilesDATA all: $(ASSEMBLY) $(PROGRAMFILES) $(LINUX_PKGCONFIG) # macros # $(call emit-deploy-target,deploy-variable-name) define emit-deploy-target $($1): $($1_SOURCE) mkdir -p '$$(shell dirname '$$@')' cp '$$<' '$$@' endef # $(call emit-deploy-wrapper,wrapper-variable-name,wrapper-sourcefile,x) # assumes that for a wrapper foo.pc its source template is foo.pc.in # if $3 is non-empty then wrapper is marked exec define emit-deploy-wrapper $($1): $2 mkdir -p '$$(shell dirname '$$@')' cp '$$<' '$$@' $(if $3,chmod +x '$$@') endef $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_dependencies,$(call get_culture,$(call get_resource_name,$(res))),$(call get_resource_name,$(res)))))) $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_commandlines,$(call get_culture,$(call get_resource_name,$(res))),$(res))))) $(build_satellite_assembly_list): $(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME): mkdir -p '$(@D)' $(AL) -out:'$@' -culture:$* -t:lib $(cmd_line_satellite_$*) $(install_satellite_assembly_list): mkdir -p '$(@D)' cp $(subst $(DESTDIR)$(libdir)/$(PACKAGE), $(BUILD_DIR), $@) $@ install-satellite-assemblies: $(install_satellite_assembly_list) uninstall-satellite-assemblies: rm -rf $(install_satellite_assembly_list) $(eval $(call emit-deploy-wrapper,MONO_SSDP_PC,mono.ssdp.pc)) $(eval $(call emit_resgen_targets)) $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(ASSEMBLY_MDB): $(ASSEMBLY) $(ASSEMBLY): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(shell dirname $(ASSEMBLY)) $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) # Include project specific makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: mono-upnp-0.1.2/src/Mono.Ssdp/Mono.Ssdp/Mono.Ssdp.make0000664000175000017500000000511111715013277023630 0ustar00lorentzlorentz00000000000000 # Warning: This is an automatically generated file, do not edit! if ENABLE_DEBUG ASSEMBLY_COMPILER_COMMAND = gmcs ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug "-define:DEBUG" "-keyfile:$(srcdir)/mono-ssdp.snk" ASSEMBLY = ../../../bin/Mono.Ssdp.dll ASSEMBLY_MDB = $(ASSEMBLY).mdb COMPILE_TARGET = library PROJECT_REFERENCES = BUILD_DIR = ../../../bin MONO_SSDP_DLL_MDB_SOURCE=../../../bin/Mono.Ssdp.dll.mdb MONO_SSDP_DLL_MDB=$(BUILD_DIR)/Mono.Ssdp.dll.mdb endif if ENABLE_RELEASE ASSEMBLY_COMPILER_COMMAND = gmcs ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ "-keyfile:$(srcdir)/mono-ssdp.snk" ASSEMBLY = ../../../bin/Mono.Ssdp.dll ASSEMBLY_MDB = COMPILE_TARGET = library PROJECT_REFERENCES = BUILD_DIR = ../../../bin MONO_SSDP_DLL_MDB= endif AL=al2 SATELLITE_ASSEMBLY_NAME=$(notdir $(basename $(ASSEMBLY))).resources.dll PROGRAMFILES = \ $(MONO_SSDP_DLL_MDB) LINUX_PKGCONFIG = \ $(MONO_SSDP_PC) RESGEN=resgen2 all: $(ASSEMBLY) $(PROGRAMFILES) $(LINUX_PKGCONFIG) FILES = \ AssemblyInfo.cs \ Mono.Ssdp/Announcer.cs \ Mono.Ssdp/Browser.cs \ Mono.Ssdp/BrowseService.cs \ Mono.Ssdp/Client.cs \ Mono.Ssdp/MulticastReader.cs \ Mono.Ssdp/Server.cs \ Mono.Ssdp/Service.cs \ Mono.Ssdp/ServiceArgs.cs \ Mono.Ssdp/ServiceHandler.cs \ Mono.Ssdp.Internal/AsyncReceiveBuffer.cs \ Mono.Ssdp.Internal/HttpDatagram.cs \ Mono.Ssdp.Internal/HttpDatagramType.cs \ Mono.Ssdp.Internal/Log.cs \ Mono.Ssdp.Internal/NotifyListener.cs \ Mono.Ssdp.Internal/Protocol.cs \ Mono.Ssdp.Internal/RequestListener.cs \ Mono.Ssdp.Internal/ServiceCache.cs \ Mono.Ssdp.Internal/SsdpSocket.cs \ Mono.Ssdp.Internal/TimeoutDispatcher.cs \ Mono.Ssdp.Internal/MulticastSsdpSocket.cs \ Mono.Ssdp.Internal/NetworkInterfaceInfo.cs \ Mono.Ssdp/ServiceOperation.cs DATA_FILES = RESOURCES = EXTRAS = \ mono-ssdp.snk \ mono.ssdp.pc.in REFERENCES = \ System DLL_REFERENCES = CLEANFILES = $(PROGRAMFILES) $(LINUX_PKGCONFIG) include $(top_srcdir)/Makefile.include MONO_SSDP_PC = $(BUILD_DIR)/mono.ssdp.pc $(eval $(call emit-deploy-wrapper,MONO_SSDP_PC,mono.ssdp.pc)) $(eval $(call emit_resgen_targets)) $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(ASSEMBLY_MDB): $(ASSEMBLY) $(ASSEMBLY): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(shell dirname $(ASSEMBLY)) $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) mono-upnp-0.1.2/src/Mono.Ssdp/Mono.Ssdp/mono.ssdp.pc.in0000664000175000017500000000030511761736663024036 0ustar00lorentzlorentz00000000000000assemblies_dir=@expanded_libdir@/@PACKAGE@ Libraries=${assemblies_dir}/Mono.Ssdp.dll Name: Mono.Ssdp Description: Mono.Ssdp Version: @VERSION@ Requires: Libs: -r:${assemblies_dir}/Mono.Ssdp.dll mono-upnp-0.1.2/src/Mono.Ssdp/Mono.Ssdp/AssemblyInfo.cs0000664000175000017500000000203611707010776024100 0ustar00lorentzlorentz00000000000000using System; using System.Reflection; using System.Runtime.CompilerServices; // Information about this assembly is defined by the following attributes. // Change them to the values specific to your project. [assembly: AssemblyTitle ("Mono.Ssdp")] [assembly: AssemblyDescription ("A client and server Simple Service Discovery Protocol stack.")] [assembly: AssemblyConfiguration ("")] [assembly: AssemblyCompany ("")] [assembly: AssemblyProduct ("")] [assembly: AssemblyCopyright ("")] [assembly: AssemblyTrademark ("")] [assembly: AssemblyCulture ("")] [assembly: CLSCompliant (true)] // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". // The form "{Major}.{Minor}.*" will automatically update the build and revision, // and "{Major}.{Minor}.{Build}.*" will update just the revision. [assembly: AssemblyVersion ("1.0.*")] // The following attributes are used to specify the signing key for the assembly, // if desired. See the Mono documentation for more information about signing. [assembly: AssemblyDelaySign (false)] mono-upnp-0.1.2/src/Mono.Ssdp/Mono.Ssdp/Mono.Ssdp.Internal/0000775000175000017500000000000011761740036024547 5ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Ssdp/Mono.Ssdp/Mono.Ssdp.Internal/ServiceCache.cs0000664000175000017500000001010311704316672027417 0ustar00lorentzlorentz00000000000000// // ServiceCache.cs // // Author: // Aaron Bockover // // Copyright (C) 2008 Novell, Inc. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Collections.Generic; namespace Mono.Ssdp.Internal { internal class ServiceCache : IDisposable { private readonly object mutex = new object (); private Client client; private TimeoutDispatcher timeouts = new TimeoutDispatcher (); private Dictionary services; private Dictionary Services { get { if (services == null) { services = new Dictionary (); } return services; } } public ServiceCache (Client client) { this.client = client; } public void Dispose () { lock (mutex) { if (services != null) { services.Clear (); services = null; } } } public void Remove (Service service) { Remove (service.Usn); } public void Remove (string usn) { Remove (usn, true); } private void Remove (string usn, bool fromTimeout) { lock (mutex) { BrowseService service; if (services.TryGetValue (usn, out service)) { Services.Remove (usn); client.CacheServiceRemoved (usn); timeouts.Remove (service.TimeoutId); } } } public void Add (BrowseService service) { lock (mutex) { Services.Add (service.Usn, service); client.CacheServiceAdded (service); service.TimeoutId = timeouts.Add (service.Expiration, TimeoutHandler, service); } } public bool Update (string usn, HttpDatagram dgram) { lock (mutex) { BrowseService service; if (!Services.TryGetValue (usn, out service)) { return false; } timeouts.Remove (service.TimeoutId); service.Update (dgram, true); service.TimeoutId = timeouts.Add (service.Expiration, TimeoutHandler, service); client.CacheServiceUpdated (service); return true; } } private bool TimeoutHandler (object state, ref TimeSpan interval) { Remove (((Service)state).Usn, false); return false; } public BrowseService this [string usn] { get { lock (mutex) { BrowseService service; return Services.TryGetValue (usn, out service) ? service : null; } } } } } mono-upnp-0.1.2/src/Mono.Ssdp/Mono.Ssdp/Mono.Ssdp.Internal/MulticastSsdpSocket.cs0000664000175000017500000000351311707010776031051 0ustar00lorentzlorentz00000000000000// // MulticastSsdpSocket.cs // // Author: // Scott Peterson // // Copyright (c) 2010 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Net; using System.Net.Sockets; namespace Mono.Ssdp.Internal { class MulticastSsdpSocket : SsdpSocket { public MulticastSsdpSocket (NetworkInterfaceInfo networkInterfaceInfo) : base (networkInterfaceInfo.Address) { SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Broadcast, true); SetSocketOption (SocketOptionLevel.IP, SocketOptionName.MulticastTimeToLive, Protocol.SocketTtl); SetSocketOption (SocketOptionLevel.IP, SocketOptionName.AddMembership, new MulticastOption (Protocol.IPAddress, networkInterfaceInfo.Index)); } } } mono-upnp-0.1.2/src/Mono.Ssdp/Mono.Ssdp/Mono.Ssdp.Internal/Log.cs0000664000175000017500000000356411707010776025630 0ustar00lorentzlorentz00000000000000// // Log.cs // // Author: // Aaron Bockover // // Copyright (C) 2008 Novell, Inc. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; namespace Mono.Ssdp.Internal { static class Log { static bool? enabled; static bool Enabled { get { if (enabled == null) { enabled = Environment.GetEnvironmentVariable ("MONO_SSDP_DEBUG") != null; } return enabled.Value; } } public static void Exception (Exception e) { Exception (null, e); } public static void Exception (string message, Exception e) { if (Enabled) { Console.Error.WriteLine ("Mono.Ssdp Error: {0}, {1}", message, e); } } } } mono-upnp-0.1.2/src/Mono.Ssdp/Mono.Ssdp/Mono.Ssdp.Internal/HttpDatagram.cs0000664000175000017500000001312311707010776027457 0ustar00lorentzlorentz00000000000000// // HttpDatagram.cs // // Author: // Aaron Bockover // // Copyright (C) 2008 Novell, Inc. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Net; using System.Text; namespace Mono.Ssdp.Internal { class HttpDatagram { public HttpDatagram (HttpDatagramType type) { Type = type; } public HttpDatagramType Type { get; set; } public WebHeaderCollection Headers { get; private set; } #region Static Datagram Parser static readonly byte [] fingerprint_discover_response = Encoding.ASCII.GetBytes ("HTTP/1.1 200 OK\r\n"); static readonly byte [] fingerprint_msearch = Encoding.ASCII.GetBytes ("M-SEARCH * HTTP/1.1\r\n"); static readonly byte [] fingerprint_notify = Encoding.ASCII.GetBytes ("NOTIFY * HTTP/1.1\r\n"); public static HttpDatagram Parse (byte [] rawDgram) { if (rawDgram.Length <= 0) { return null; } var headers_offset = 0; var type = DetectDatagramType (rawDgram, out headers_offset); if (type == HttpDatagramType.Unknown) { return null; } var dgram = new HttpDatagram (type); if (ParseHeaders (dgram, rawDgram, headers_offset)) { return dgram; } return null; } static HttpDatagramType DetectDatagramType (byte [] rawDgram, out int offset) { switch (ToUpper (rawDgram[0])) { case (byte)'H': if (Check (rawDgram, fingerprint_discover_response, out offset)) { return HttpDatagramType.DiscoverResponse; } break; case (byte)'M': if (Check (rawDgram, fingerprint_msearch, out offset)) { return HttpDatagramType.MSearch; } break; case (byte)'N': if (Check (rawDgram, fingerprint_notify, out offset)) { return HttpDatagramType.Notify; } break; } offset = -1; return HttpDatagramType.Unknown; } static bool ParseHeaders (HttpDatagram dgram, byte [] raw, int offset) { for (int i = offset, line_start = offset, sep_start = -1, n = raw.Length - 1; i < n; i++) { if (sep_start < 0 && raw[i] == ':') { // Account for the first : to denote the kvp split sep_start = i; } else if (raw[i] == '\r' && raw[i + 1] == '\n') { // Process on the line boundary var line_length = i - line_start - 1; var sep_length = sep_start - line_start; if (line_length > 0 && sep_length > 0) { // Encode the kvp var key = Encoding.ASCII.GetString (raw, line_start, sep_length); var value = Encoding.ASCII.GetString (raw, line_start + sep_length + 1, line_length - sep_length); // Save the header if (!string.IsNullOrEmpty (key)) { if (dgram.Headers == null) { dgram.Headers = new WebHeaderCollection (); } dgram.Headers.Add (key.Trim (), value.Trim ()); } } // Set state for next line line_start = i + 2; sep_start = -1; } } return dgram.Headers != null; } static bool Check (byte [] check, byte [] fingerprint, out int offset) { offset = -1; if (check.Length < fingerprint.Length) { return false; } for (var i = 0; i < fingerprint.Length; i++) { if (ToUpper (check[i]) != fingerprint[i]) { return false; } } offset = fingerprint.Length; return true; } static byte ToUpper (byte b) { return (b >= 'a' && b <= 'z') ? (byte)(b - 0x20) : b; } #endregion } } mono-upnp-0.1.2/src/Mono.Ssdp/Mono.Ssdp/Mono.Ssdp.Internal/RequestListener.cs0000664000175000017500000000662711707010776030250 0ustar00lorentzlorentz00000000000000// // RequestListener.cs // // Author: // Scott Peterson // // Copyright (C) 2008 S&S Black Ltd. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Net; using System.Threading; namespace Mono.Ssdp.Internal { struct Request { public readonly IPEndPoint EndPoint; public readonly string ST; public readonly ushort MX; public Request (IPEndPoint endPoint, string st, ushort mx) { EndPoint = endPoint; ST = st; MX = mx; } } class RequestListener : MulticastReader, IDisposable { readonly object mutex = new object (); readonly Server server; SsdpSocket socket; public RequestListener (Server server) { this.server = server; } public void Start () { lock (mutex) { Stop (); socket = new MulticastSsdpSocket (server.NetworkInterfaceInfo); socket.Bind (); AsyncReadResult (socket); } } public void Stop () { lock (mutex) { if (socket != null) { socket.Close (); socket = null; } } } internal override bool OnAsyncResultReceived (AsyncReceiveBuffer result) { try { var dgram = HttpDatagram.Parse (result.Buffer); if (dgram == null || dgram.Type != HttpDatagramType.MSearch) { return true; } var st = dgram.Headers.Get ("ST"); var mx = dgram.Headers.Get ("MX"); var man = dgram.Headers.Get ("Man"); if (string.IsNullOrEmpty (st) || string.IsNullOrEmpty (mx) || man != Protocol.SsdpDiscoverMan) { return true; } server.RequestRecieved (new Request (result.SenderIPEndPoint, st, UInt16.Parse(mx))); } catch (Exception e) { Log.Exception ("Invalid HTTPMU/M-SEARCH datagram", e); } return true; } public void Dispose () { // TODO more here Stop (); } } } mono-upnp-0.1.2/src/Mono.Ssdp/Mono.Ssdp/Mono.Ssdp.Internal/NotifyListener.cs0000664000175000017500000000675011707010776030065 0ustar00lorentzlorentz00000000000000// // NotifyListener.cs // // Author: // Aaron Bockover // // Copyright (C) 2008 Novell, Inc. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Net; using System.Net.Sockets; namespace Mono.Ssdp.Internal { class NotifyListener : MulticastReader { readonly object mutex = new object (); readonly Client client; SsdpSocket socket; public NotifyListener (Client client) { this.client = client; } public void Start () { lock (mutex) { Stop (); socket = new MulticastSsdpSocket (client.NetworkInterfaceInfo); socket.Bind (); AsyncReadResult (socket); } } public void Stop () { lock (mutex) { if (socket != null) { socket.Close (); socket = null; } } } internal override bool OnAsyncResultReceived (AsyncReceiveBuffer result) { try { var dgram = HttpDatagram.Parse (result.Buffer); if (dgram == null || dgram.Type != HttpDatagramType.Notify) { return true; } var nts = dgram.Headers.Get ("NTS"); var usn = dgram.Headers.Get ("USN"); var nt = dgram.Headers.Get ("NT"); if (string.IsNullOrEmpty (nts) || string.IsNullOrEmpty (usn)) { return true; } if (!client.ServiceTypeRegistered (nt)) { return true; } if (nts == Protocol.SsdpAliveNts) { try { if (!client.ServiceCache.Update (usn, dgram)) { client.ServiceCache.Add (new BrowseService (dgram, true)); } } catch (Exception e) { Log.Exception ("Invalid ssdp:alive NOTIFY", e); } } else if (nts == Protocol.SsdpByeByeNts) { client.ServiceCache.Remove (usn); } } catch (Exception e) { Log.Exception ("Invalid HTTPMU/NOTIFY datagram", e); } return true; } } } mono-upnp-0.1.2/src/Mono.Ssdp/Mono.Ssdp/Mono.Ssdp.Internal/AsyncReceiveBuffer.cs0000664000175000017500000000452611707010776030620 0ustar00lorentzlorentz00000000000000// // AsyncReceiveBuffer.cs // // Author: // Aaron Bockover // // Copyright (C) 2008 Novell, Inc. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Net; using System.Net.Sockets; namespace Mono.Ssdp.Internal { class AsyncReceiveBuffer { const int length = 1024; readonly SsdpSocket socket; readonly byte[] buffer = new byte[length]; int bytes_received; // a field because it gets passed as ref; internal API anyway public EndPoint SenderEndPoint = new IPEndPoint (IPAddress.Any, Protocol.Port); public AsyncReceiveBuffer (SsdpSocket socket) { this.socket = socket; } public byte [] Buffer { get { return buffer; } } public int BytesReceived { get { return bytes_received; } set { var buffer = this.buffer; for (var i = value; i < length; i++) { buffer[i] = 0; } bytes_received = value; } } public SsdpSocket Socket { get { return socket; } } public IPEndPoint SenderIPEndPoint { get { return (IPEndPoint)SenderEndPoint; } } } } mono-upnp-0.1.2/src/Mono.Ssdp/Mono.Ssdp/Mono.Ssdp.Internal/HttpDatagramType.cs0000664000175000017500000000250511707010776030323 0ustar00lorentzlorentz00000000000000// // HttpDatagramType.cs // // Author: // Aaron Bockover // // Copyright (C) 2008 Novell, Inc. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // namespace Mono.Ssdp.Internal { enum HttpDatagramType { Unknown, DiscoverResponse, MSearch, Notify } } mono-upnp-0.1.2/src/Mono.Ssdp/Mono.Ssdp/Mono.Ssdp.Internal/NetworkInterfaceInfo.cs0000664000175000017500000000563011707010776031171 0ustar00lorentzlorentz00000000000000// // NetworkInterfaceInfo.cs // // Author: // Scott Peterson // // Copyright (c) 2010 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Net; using System.Net.NetworkInformation; using System.Net.Sockets; namespace Mono.Ssdp.Internal { struct NetworkInterfaceInfo { public readonly IPAddress Address; public readonly int Index; public NetworkInterfaceInfo (IPAddress address, int index) { Address = address; Index = index; } public static NetworkInterfaceInfo GetNetworkInterfaceInfo (NetworkInterface networkInterface) { if (networkInterface == null) { return new NetworkInterfaceInfo (IPAddress.Any, 0); } var properties = networkInterface.GetIPProperties (); var ipv4_properties = properties.GetIPv4Properties (); if (ipv4_properties == null) { throw new ArgumentException ("The specified network interface does not support IPv4.", "networkInterface"); } var host_name = Dns.GetHostName (); foreach (var address in properties.UnicastAddresses) { string addressHostname = null; try { addressHostname = Dns.GetHostEntry (address.Address).HostName; } catch (SocketException) { } if (address.Address.AddressFamily == AddressFamily.InterNetwork && addressHostname == host_name) { return new NetworkInterfaceInfo (address.Address, ipv4_properties.Index); } } throw new ArgumentException (string.Format ( "The specified network interface does not have a suitable address for the local hostname: {0}.", host_name), "networkInterface"); } } } mono-upnp-0.1.2/src/Mono.Ssdp/Mono.Ssdp/Mono.Ssdp.Internal/Protocol.cs0000664000175000017500000001064511704316672026707 0ustar00lorentzlorentz00000000000000// // Protocol.cs // // Author: // Aaron Bockover // // Copyright (C) 2008 Novell, Inc. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Net; using System.Text; namespace Mono.Ssdp.Internal { internal static class Protocol { private const string user_agent = "Mono.Ssdp/1.0"; public const string Address = "239.255.255.250"; public const ushort Port = 1900; public static readonly IPAddress IPAddress = IPAddress.Parse (Address); public const string SsdpSearchMethod = "M-SEARCH"; public const string GenaNotifyMethod = "NOTIFY"; public const string SsdpAliveNts = "ssdp:alive"; public const string SsdpByeByeNts = "ssdp:byebye"; public const string SsdpAll = "ssdp:all"; public const string SsdpDiscoverMan = @"""ssdp:discover"""; public const ushort DefaultMaxAge = 1800; public const ushort DefaultMx = 3; public const ushort MaxMX = 120; public const ushort SocketTtl = 4; private static string os = String.Format ("{0}/{1}", Environment.OSVersion.Platform, Environment.OSVersion.Version); private static string discovery_request = "M-SEARCH * HTTP/1.1\r\n" + "HOST: {0}:{1}\r\n" + "MAN: \"ssdp:discover\"\r\n" + "ST: {2}\r\n" + "MX: {3}\r\n" + "\r\n"; private static string alive_notify = "NOTIFY * HTTP/1.1\r\n" + "HOST: {0}:{1}\r\n" + "CACHE-CONTROL: max-age = {2}\r\n" + "LOCATION: {3}\r\n" + "NT: {4}\r\n" + "NTS: ssdp:alive\r\n" + "SERVER: {5} UPnP/1.1 {6}\r\n" + "USN: {7}\r\n" + "\r\n"; private static string alive_response = "HTTP/1.1 200 OK\r\n" + "CACHE-CONTROL: max-age = {0}\r\n" + "DATE: {1}\r\n" + "EXT:\r\n" + "LOCATION: {2}\r\n" + "SERVER: {3} UPnP/1.1 {4}\r\n" + "ST: {5}\r\n" + "USN: {6}\r\n" + "\r\n"; private static string byebye_notify = "NOTIFY * HTTP/1.1\r\n" + "HOST: {0}:{1}\r\n" + "NT: {2}\r\n" + "NTS: ssdp:byebye\r\n" + "USN: {3}\r\n" + "\r\n"; public static byte[] CreateDiscoveryRequest (string serviceType, ushort mx) { return Encoding.ASCII.GetBytes (String.Format (discovery_request, Address, Port, serviceType, mx)); } public static byte[] CreateAliveNotify (string location, string notificationType, string usn, ushort maxAge) { return Encoding.ASCII.GetBytes (String.Format ( alive_notify, Address, Port, maxAge, location, notificationType, os, user_agent, usn)); } public static byte[] CreateAliveResponse (string location, string searchType, string usn, ushort maxAge) { return Encoding.ASCII.GetBytes (String.Format ( alive_response, maxAge, DateTime.Now.ToString ("r"), location, os, user_agent, searchType, usn)); } public static byte[] CreateByeByeNotify (string notificationType, string usn) { return Encoding.ASCII.GetBytes (String.Format (byebye_notify, Address, Port, notificationType, usn)); } } } mono-upnp-0.1.2/src/Mono.Ssdp/Mono.Ssdp/Mono.Ssdp.Internal/SsdpSocket.cs0000664000175000017500000000504611707010776027166 0ustar00lorentzlorentz00000000000000// // SsdpSocket.cs // // Author: // Aaron Bockover // // Copyright (C) 2008 Novell, Inc. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Net; using System.Net.Sockets; namespace Mono.Ssdp.Internal { class SsdpSocket : Socket { static readonly IPEndPoint ssdp_send_point = new IPEndPoint (Protocol.IPAddress, Protocol.Port); readonly IPEndPoint ssdp_receive_point; public SsdpSocket (IPAddress address) : base (AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp) { ssdp_receive_point = new IPEndPoint (address, Protocol.Port); SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true); } public IAsyncResult BeginSendTo (byte [] data, AsyncCallback callback) { return BeginSendTo (data, callback, ssdp_send_point); } public IAsyncResult BeginSendTo (byte[] data, AsyncCallback callback, IPEndPoint endPoint) { return BeginSendTo (data, 0, data.Length, SocketFlags.None, endPoint, callback, this); } public IAsyncResult BeginReceiveFrom (AsyncReceiveBuffer buffer, AsyncCallback callback) { return base.BeginReceiveFrom (buffer.Buffer, 0, buffer.Buffer.Length, SocketFlags.None, ref buffer.SenderEndPoint, callback, buffer); } public void Bind () { Bind (ssdp_receive_point); } } } mono-upnp-0.1.2/src/Mono.Ssdp/Mono.Ssdp/Mono.Ssdp.Internal/TimeoutDispatcher.cs0000664000175000017500000001374311704316672030545 0ustar00lorentzlorentz00000000000000// // TimeoutDispatcher.cs // // Author: // Aaron Bockover // // Copyright (C) 2008 Novell, Inc. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Collections.Generic; using System.Threading; namespace Mono.Ssdp.Internal { internal delegate bool TimeoutHandler (object state, ref TimeSpan interval); internal class TimeoutDispatcher : IDisposable { private static uint timeout_ids = 1; private struct TimeoutItem : IComparable { public uint Id; public TimeSpan Timeout; public DateTime Trigger; public TimeoutHandler Handler; public object State; public int CompareTo (TimeoutItem item) { return Trigger.CompareTo (item.Trigger); } public override string ToString () { return String.Format ("{0} ({1})", Id, Trigger); } } private bool disposed; private AutoResetEvent wait = new AutoResetEvent (false); private List timeouts = new List (); public uint Add (uint timeoutMs, TimeoutHandler handler) { return Add (timeoutMs, handler, null); } public uint Add (TimeSpan timeout, TimeoutHandler handler) { return Add (timeout, handler, null); } public uint Add (uint timeoutMs, TimeoutHandler handler, object state) { return Add (TimeSpan.FromMilliseconds (timeoutMs), handler, state); } public uint Add (DateTime timeout, TimeoutHandler handler, object state) { return Add (timeout - DateTime.Now, handler, state); } public uint Add (TimeSpan timeout, TimeoutHandler handler, object state) { lock (this) { CheckDisposed (); TimeoutItem item = new TimeoutItem (); item.Id = timeout_ids++; item.Timeout = timeout; item.Trigger = DateTime.Now + timeout; item.Handler = handler; item.State = state; Add (ref item); if (timeouts.Count == 1) { Start (); } return item.Id; } } private void Add (ref TimeoutItem item) { lock (timeouts) { int index = timeouts.BinarySearch (item); index = index >= 0 ? index : ~index; timeouts.Insert (index, item); if (index == 0 && timeouts.Count > 1) { wait.Set (); } } } public void Remove (uint id) { lock (timeouts) { CheckDisposed (); // FIXME: Comparer for BinarySearch for (int i = 0; i < timeouts.Count; i++) { if (timeouts[i].Id == id) { timeouts.RemoveAt (i); if (i == 0) { wait.Set (); } return; } } } } private void Start () { wait.Reset (); ThreadPool.QueueUserWorkItem (TimerThread); } private void TimerThread (object state) { while (true) { TimeoutItem item; lock (timeouts) { if (timeouts.Count == 0) { break; } item = timeouts[0]; } TimeSpan interval = item.Trigger - DateTime.Now; if (interval < TimeSpan.Zero) { interval = TimeSpan.Zero; } if (!wait.WaitOne (interval, false)) { bool requeue = item.Handler (item.State, ref item.Timeout); lock (timeouts) { Remove(item.Id); if (requeue) { item.Trigger += item.Timeout; Add(ref item); } } } } } public void Clear () { lock (timeouts) { timeouts.Clear (); wait.Set (); } } private void CheckDisposed () { if (disposed) { throw new ObjectDisposedException (ToString ()); } } public void Dispose () { if (disposed) { return; } Clear (); wait.Close (); disposed = true; } } } mono-upnp-0.1.2/src/Mono.Ssdp/Mono.Ssdp/mono-ssdp.snk0000664000175000017500000000112411704316672023610 0ustar00lorentzlorentz00000000000000$RSA2ÍdòÙÁäS³uJ¹¦`D3W›Ùز3 ²¼KW4ÓØsJÁô‡r÷ü“ßÃd©C”ľ¤¤Ìh»‰Åï’(ĉcýÙðl˜—\ Ú†DŽÊ‘šÞ­`… kY~%=~Û:ïËýº?)¦ÝõQ&TGéneøe¬³WKR‡™ôK´2S°óP¡SSBt›;^DdÈ4a9|å±r@z ±\vNüÙÎ;B÷$7âðˆœ|G¦ÝËÈÞÅÓ‚L¢–M°9fÐËoú;«gK‚â ›[TÙˆÐqó‡À‚94ƒß´’±7[VõŸ»LÙSEUOŠRZGƧ<þ†½ÀÁg¶Ì,—¦Ð•:‡á8Éuûjf7Π矉sFØÃƒQ.ãJðžB¿¤$sFîÛW4£hrœP'Y |•˜°ÛâZÍÖFfÞôݱKgÒ¼ܼ©@(?f_3œ/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic ctags \ ctags-recursive distclean distclean-generic distclean-tags \ distdir dvi dvi-am html html-am info info-am install \ install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \ tags-recursive uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/0000775000175000017500000000000011761740036021176 5ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml.Compilation/0000775000175000017500000000000011714005363026036 5ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml.Compilation/Compiler.cs0000664000175000017500000000410111707010776030141 0ustar00lorentzlorentz00000000000000// // Compiler.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using System.Reflection; namespace Mono.Upnp.Xml.Compilation { public class Compiler { readonly Type type; internal Compiler (Type type) { if (type == null) throw new ArgumentNullException ("type"); this.type = type; } protected Type Type { get { return type; } } protected IEnumerable Properties { get { foreach (var property in type.GetProperties (BindingFlags.Instance | BindingFlags.Public)) { yield return property; } foreach (var property in type.GetProperties (BindingFlags.Instance | BindingFlags.NonPublic)) { yield return property; } } } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml.Compilation/Serializer.cs0000664000175000017500000000250211707010776030503 0ustar00lorentzlorentz00000000000000// // Serializer.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. namespace Mono.Upnp.Xml.Compilation { public delegate void Serializer (object obj, XmlSerializationContext context); } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml.Compilation/SerializationCompilerProvider.cs0000664000175000017500000000270711707010776034424 0ustar00lorentzlorentz00000000000000// // SerializationCompilerProvider.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; namespace Mono.Upnp.Xml.Compilation { public delegate SerializationCompiler SerializationCompilerProvider (XmlSerializer xmlSerializer, Type type); } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml.Compilation/.AutoSerializationCompiler~.cs0000664000175000017500000000543411707010776034016 0ustar00lorentzlorentz00000000000000// // SerializationCompiler.cs // // Author: // scott <${AuthorEmail}> // // Copyright (c) 2009 scott // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; namespace Mono.Upnp.Xml.Compilation { public abstract class SerializationCompiler : Compiler { protected SerializationCompiler (Type type) : base (type) { } public virtual Serializer CreateTypeSerializer () { if (typeof (IXmlSerializable).IsAssignableFrom (Type)) { return (obj, context) => ((IXmlSerializable)obj).SerializeSelfAndMembers (context); } else if (typeof (IXmlSerializable).IsAssignableFrom (Type)) { return (obj, context) => ((IXmlSerializable)obj).SerializeSelfAndMembers (context); } else { return info.TypeAutoSerializer; } } public abstract Serializer CreateTypeAutoSerializer (); public virtual Serializer CreateMemberSerializer () { if (typeof (IXmlSerializable).IsAssignableFrom (Type)) { return (obj, context) => ((IXmlSerializable)obj).SerializeMembersOnly (context); } else if (typeof (IXmlSerializable).IsAssignableFrom (Type)) { return (obj, context) => ((IXmlSerializable)obj).SerializeMembersOnly (context); } else if (Type.IsEnum) { var map = GetEnumMap (Type); return (obj, context) => context.Writer.WriteValue (map [obj]); } else { return info.MemberAutoSerializer; } } public abstract Serializer CreateMemberAutoSerializer (); } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml.Compilation/Deserializer.cs0000664000175000017500000000245211707010776031020 0ustar00lorentzlorentz00000000000000// // Deserializer.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. namespace Mono.Upnp.Xml.Compilation { public delegate object Deserializer (XmlDeserializationContext context); } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml.Compilation/DelegateDeserializationCompiler.cs0000664000175000017500000006147111714005363034652 0ustar00lorentzlorentz00000000000000// // DelegateDeserializationCompiler.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using System.Reflection; using Mono.Upnp.Internal; namespace Mono.Upnp.Xml.Compilation { public class DelegateDeserializationCompiler : DeserializationCompiler { delegate object ItemDeserializer (object obj, XmlDeserializationContext context); delegate void ElementDeserializer (object obj, XmlDeserializationContext context, int depth); Dictionary type_deserializers; bool has_processed_type_deserializers; PropertyInfo value_property; Dictionary attribute_deserializers; Dictionary element_deserializers; public DelegateDeserializationCompiler (XmlDeserializer xmlDeserializer, Type type) : base (xmlDeserializer, type) { } Dictionary TypeDeserializers { get { if (!has_processed_type_deserializers) { has_processed_type_deserializers = true; ProcessTypeDeserializers (); } return type_deserializers; } } PropertyInfo ValueProperty { get { CheckHasProcessedType (); return value_property; } } Dictionary AttributeDeserializers { get { CheckHasProcessedType (); return attribute_deserializers; } } Dictionary ElementDeserializers { get { CheckHasProcessedType (); return element_deserializers; } } void CheckHasProcessedType () { if (attribute_deserializers == null) { ProcessType (); } } protected override Deserializer CreateDeserializer () { if (Type == typeof (string)) { return context => context.Reader.ReadElementContentAsString (); } else if (Type == typeof (int)) { return context => context.Reader.ReadElementContentAsInt (); } else if (Type == typeof (uint)) { return context => uint.Parse (context.Reader.ReadElementContentAsString ()); } else if (Type == typeof (double)) { return context => context.Reader.ReadElementContentAsDouble (); } else if (Type == typeof (bool)) { return context => context.Reader.ReadElementContentAsBoolean (); } else if (Type == typeof (long)) { return context => context.Reader.ReadElementContentAsLong (); } else if (Type == typeof (ulong)) { return context => ulong.Parse (context.Reader.ReadElementContentAsString ()); } else if (Type == typeof (float)) { return context => context.Reader.ReadElementContentAsFloat (); } else if (Type == typeof (decimal)) { return context => context.Reader.ReadElementContentAsDecimal (); } else if (Type == typeof (DateTime)) { return context => context.Reader.ReadElementContentAsDateTime (); } else if (Type == typeof (TimeSpan)) { return context => TimeSpan.Parse (context.Reader.ReadElementContentAsString ()); } else if (Type == typeof (Uri)) { return context => { var url = context.Reader.ReadElementContentAsString (); if (url.Length != 0) { try { Uri uri = new Uri (url); return uri; } catch { } } return null; }; } else if (Type.IsEnum) { var map = GetEnumMap (Type); return context => map[context.Reader.ReadElementContentAsString ()]; } else if (Type.IsGenericType && Type.GetGenericTypeDefinition () == typeof (Nullable<>)) { var type = Type.GetGenericArguments ()[0]; var deserializer = GetDeserializerForType (type); var constructor = Type.GetConstructor (new[] { type }); return context => constructor.Invoke (new[] { deserializer (context) }); } else { // TODO check for default ctor if (typeof (IXmlDeserializable).IsAssignableFrom (Type)) { return context => { var obj = Activator.CreateInstance (Type, true); ((IXmlDeserializable)obj).Deserialize (context); return obj; }; } else { var deserializer = AutoDeserializer; return context => { var obj = Activator.CreateInstance (Type, true); deserializer (obj, context); return obj; }; } } } protected override ObjectDeserializer CreateAutoDeserializer () { var attribute_deserializer = CreateAttributeDeserializer (); var element_deserializer = CreateElementDeserializer (); return (obj, context) => { try { var depth = context.Reader.Depth; while (context.Reader.MoveToNextAttribute ()) { try { attribute_deserializer (obj, context); } catch { throw; } } context.Reader.MoveToElement (); element_deserializer (obj, context, depth); } catch { throw; } }; } ObjectDeserializer CreateAttributeDeserializer () { if (typeof (IXmlDeserializable).IsAssignableFrom (Type)) { return (obj, context) => ((IXmlDeserializable)obj).DeserializeAttribute (context); } else { return AttributeAutoDeserializer; } } protected override ObjectDeserializer CreateAttributeAutoDeserializer () { var attribute_deserializers = AttributeDeserializers; if (attribute_deserializers.Count == 0) { return (obj, context) => {}; } else { return (obj, context) => { var name = CreateName (context.Reader.LocalName, context.Reader.NamespaceURI); if (attribute_deserializers.ContainsKey (name)) { attribute_deserializers[name] (obj, context); } }; } } ElementDeserializer CreateElementDeserializer () { if (ValueProperty != null && ValueProperty.CanWrite) { var property = ValueProperty; var deserializer = GetDeserializerForType (property.PropertyType); return (obj, context, depth) => property.SetValue (obj, deserializer (context), null); } var element_deserializer = CreateSubElementDeserializer (); return (obj, context, depth) => { while (Helper.ReadToNextElement (context.Reader) && context.Reader.Depth > depth) { var element_reader = context.Reader.ReadSubtree (); element_reader.Read (); try { element_deserializer (obj, CreateDeserializationContext (element_reader)); } catch { throw; } finally { element_reader.Close (); } } }; } ObjectDeserializer CreateSubElementDeserializer () { if (typeof (IXmlDeserializable).IsAssignableFrom (Type)) { return (obj, context) => ((IXmlDeserializable)obj).DeserializeElement (context); } else { return ElementAutoDeserializer; } } protected override ObjectDeserializer CreateElementAutoDeserializer () { var object_deserializers = ElementDeserializers; if (object_deserializers.Count == 0) { return (obj, context) => {}; } else { return (obj, context) => { var name = CreateName (context.Reader.LocalName, context.Reader.NamespaceURI); if (object_deserializers.ContainsKey (name)) { object_deserializers[name] (obj, context); } else if (object_deserializers.ContainsKey (context.Reader.Name)) { object_deserializers[context.Reader.Name] (obj, context); } else { // TODO this is a workaround for mono bug 334752 and another problem context.Reader.Skip (); } }; } } void ProcessTypeDeserializers () { foreach (var @interface in Type.GetInterfaces ()) { if (@interface.IsGenericType && @interface.GetGenericTypeDefinition () == typeof (IXmlDeserializer<>)) { var type = @interface.GetGenericArguments()[0]; if (type_deserializers == null) { type_deserializers = new Dictionary (); } else if (type_deserializers.ContainsKey (type)) { // TODO throw } type_deserializers[type] = Type.GetInterfaceMap (@interface).TargetMethods[0]; } } } void ProcessType () { attribute_deserializers = new Dictionary (); element_deserializers = new Dictionary (); foreach (var property in Properties) { XmlElementAttribute element_attribute = null; XmlFlagAttribute flag_attribute = null; XmlArrayAttribute array_attribute = null; XmlArrayItemAttribute array_item_attribute = null; XmlAttributeAttribute attribute_attribute = null; foreach (var custom_attribute in property.GetCustomAttributes (false)) { if (custom_attribute is DoNotDeserializeAttribute) { element_attribute = null; flag_attribute = null; array_attribute = null; attribute_attribute = null; value_property = null; break; } var element = custom_attribute as XmlElementAttribute; if (element != null) { element_attribute = element; continue; } var flag = custom_attribute as XmlFlagAttribute; if (flag != null) { flag_attribute = flag; continue; } var array = custom_attribute as XmlArrayAttribute; if (array != null) { array_attribute = array; continue; } var array_item = custom_attribute as XmlArrayItemAttribute; if (array_item != null) { array_item_attribute = array_item; continue; } var attribute = custom_attribute as XmlAttributeAttribute; if (attribute != null) { attribute_attribute = attribute; continue; } if (custom_attribute is XmlValueAttribute) { // TODO check if this isn't null and throw value_property = property; continue; } } if (element_attribute != null) { var deserializer = CreateCustomDeserializer (property) ?? CreateElementDeserializer (property); AddDeserializer (element_deserializers, CreateName (property.Name, element_attribute.Name, element_attribute.Namespace), deserializer); continue; } if (flag_attribute != null) { AddDeserializer (element_deserializers, CreateName (property.Name, flag_attribute.Name, flag_attribute.Namespace), CreateFlagDeserializer (property)); continue; } if (array_attribute != null) { AddDeserializer (element_deserializers, CreateName (property.Name, array_attribute.Name, array_attribute.Namespace), CreateArrayElementDeserializer (property)); continue; } else if (array_item_attribute != null) { var name = array_item_attribute.Name; var @namespace = array_item_attribute.Namespace; if (string.IsNullOrEmpty (name)) { var item_type = GetICollection (property.PropertyType).GetGenericArguments ()[0]; var type_attribute = item_type.GetCustomAttributes (typeof (XmlTypeAttribute), false); if (type_attribute.Length == 0) { name = item_type.Name; } else { var xml_type = (XmlTypeAttribute)type_attribute[0]; name = string.IsNullOrEmpty (xml_type.Name) ? item_type.Name : xml_type.Name; @namespace = xml_type.Namespace; } } AddDeserializer (element_deserializers, CreateName (name, @namespace), CreateArrayItemElementDeserializer (property)); } if (attribute_attribute != null) { var deserializer = CreateCustomDeserializer (property) ?? CreateAttributeDeserializer (property); AddDeserializer (attribute_deserializers, CreateName (property.Name, attribute_attribute.Name, attribute_attribute.Namespace), deserializer); continue; } } } ObjectDeserializer CreateCustomDeserializer (PropertyInfo property) { if (!property.CanWrite) { // TODO throw } if (TypeDeserializers != null && TypeDeserializers.ContainsKey (property.PropertyType)) { var method = TypeDeserializers[property.PropertyType]; return (obj, context) => property.SetValue (obj, method.Invoke (obj, new[] { context }), null); } return null; } ObjectDeserializer CreateAttributeDeserializer (PropertyInfo property) { if (!property.CanWrite) { // TODO throw } var deserializer = CreateAttributeDeserializer (property.PropertyType); return (obj, context) => property.SetValue (obj, deserializer (context), null); } static Deserializer CreateAttributeDeserializer (Type type) { if (type == typeof (string)) { return context => context.Reader.ReadContentAsString (); } else if (type == typeof (int)) { return context => context.Reader.ReadContentAsInt (); } else if (type == typeof (uint)) { return context => uint.Parse (context.Reader.ReadContentAsString ()); } else if (type == typeof (double)) { return context => context.Reader.ReadContentAsDouble (); } else if (type == typeof (bool)) { return context => context.Reader.ReadContentAsBoolean (); } else if (type == typeof (long)) { return context => context.Reader.ReadContentAsLong (); } else if (type == typeof (ulong)) { return context => ulong.Parse (context.Reader.ReadContentAsString ()); } else if (type == typeof (float)) { return context => context.Reader.ReadContentAsFloat (); } else if (type == typeof (decimal)) { return context => context.Reader.ReadContentAsDecimal (); } else if (type == typeof (DateTime)) { return context => context.Reader.ReadContentAsDateTime (); } else if (type == typeof (TimeSpan)) { return context => TimeSpan.Parse (context.Reader.ReadContentAsString ()); } else if (type == typeof (Uri)) { return context => { var url = context.Reader.ReadContentAsString (); if (url.Length != 0) { try { Uri uri = new Uri (url); return uri; } catch { } } return null; }; } else if (type.IsEnum) { var map = GetEnumMap (type); return context => map[context.Reader.ReadContentAsString ()]; } else if (type.IsGenericType && type.GetGenericTypeDefinition () == typeof (Nullable<>)) { var nullable_type = type.GetGenericArguments ()[0]; var deserializer = CreateAttributeDeserializer (nullable_type); var constructor = type.GetConstructor (new[] { nullable_type }); return context => constructor.Invoke (new[] { deserializer (context) }); } else { return context => context.Reader.ReadContentAs (type, null); } } // TODO we could use a trie for this and save some memory static Dictionary GetEnumMap (Type type) { var fields = type.GetFields (BindingFlags.Public | BindingFlags.Static); var dictionary = new Dictionary (fields.Length); foreach (var field in fields) { var enum_attribute = field.GetCustomAttributes (typeof (XmlEnumAttribute), false); string name; if (enum_attribute.Length!= 0) { name = ((XmlEnumAttribute)enum_attribute[0]).Value; } else { name = field.Name; } dictionary.Add (name, field.GetValue (null)); } return dictionary; } ObjectDeserializer CreateElementDeserializer (PropertyInfo property) { if (!property.CanWrite) { // TODO throw } var next = GetDeserializerForType (property.PropertyType); return (obj, context) => property.SetValue (obj, next (context), null); } ObjectDeserializer CreateFlagDeserializer (PropertyInfo property) { if (!property.CanWrite) { // TODO throw } return (obj, context) => property.SetValue (obj, true, null); } ItemDeserializer CreateItemDeserializer (Type type) { if (TypeDeserializers != null && TypeDeserializers.ContainsKey (type)) { var method = TypeDeserializers[type]; return (obj, context) => method.Invoke (obj, new[] { context }); } else { var deserializer = GetDeserializerForType (type); return (obj, context) => deserializer (context); } } ObjectDeserializer CreateArrayElementDeserializer (PropertyInfo property) { if (!property.CanRead) { // TODO throw } var icollection = GetICollection (property.PropertyType); var add = icollection.GetMethod ("Add"); var item_deserializer = CreateItemDeserializer (icollection.GetGenericArguments ()[0]); return (obj, context) => { var collection = property.GetValue (obj, null); var depth = context.Reader.Depth; while (Helper.ReadToNextElement (context.Reader) && context.Reader.Depth > depth) { var item_reader = context.Reader.ReadSubtree (); item_reader.Read (); try { add.Invoke (collection, new[] { item_deserializer (obj, CreateDeserializationContext (item_reader)) }); } catch { throw; } finally { item_reader.Close (); } } }; } ObjectDeserializer CreateArrayItemElementDeserializer (PropertyInfo property) { if (!property.CanRead) { // TODO throw } var icollection = GetICollection (property.PropertyType); var add = icollection.GetMethod ("Add"); var item_deserializer = CreateItemDeserializer (icollection.GetGenericArguments ()[0]); return (obj, context) => { var collection = property.GetValue (obj, null); add.Invoke (collection, new[] { item_deserializer (obj, context) }); }; } static string CreateName (string name, string @namespace) { return CreateName (null, name, @namespace); } static string CreateName (string backupName, string name, string @namespace) { if (string.IsNullOrEmpty (@namespace)) { return name ?? backupName; } else { return string.Format ("{0}/{1}", name ?? backupName, @namespace); } } static void AddDeserializer (Dictionary deserializers, string name, ObjectDeserializer deserializer) { if (deserializers.ContainsKey (name)) { // TODO throw } deserializers[name] = deserializer; } static Type GetICollection (Type type) { if (type.IsGenericType && type.GetGenericTypeDefinition () == typeof (ICollection<>)) { return type; } else { var icollection = type.GetInterface ("ICollection`1"); if (icollection != null) { return icollection; } else { // TODO throw return null; } } } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml.Compilation/DelegateSerializationCompiler.cs0000664000175000017500000004755111707010776034352 0ustar00lorentzlorentz00000000000000// // DelegateSerializationCompiler.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections; using System.Collections.Generic; using System.Reflection; namespace Mono.Upnp.Xml.Compilation { public class DelegateSerializationCompiler : SerializationCompiler { public DelegateSerializationCompiler (XmlSerializer xmlSerializer, Type type) : base (xmlSerializer, type) { } protected override Serializer CreateTypeStartAutoSerializer () { var name = Type.Name; string @namespace = null; string prefix = null; XmlTypeAttribute type_attribute = null; var namespaces = new List (); foreach (var custom_attribute in Type.GetCustomAttributes (false)) { var xml_type = custom_attribute as XmlTypeAttribute; if (xml_type != null) { type_attribute = xml_type; continue; } else { var xml_namespace = custom_attribute as XmlNamespaceAttribute; if (xml_namespace != null) { namespaces.Add (xml_namespace); } } } if (type_attribute != null) { if (!string.IsNullOrEmpty (type_attribute.Name)) { name = type_attribute.Name; } @namespace = type_attribute.Namespace; prefix = type_attribute.Prefix; } return CreateTypeStartAutoSerializer ( name, @namespace, prefix, namespaces.Count == 0 ? null : namespaces.ToArray ()); } protected virtual Serializer CreateTypeStartAutoSerializer (string name, string @namespace, string prefix, IEnumerable namespaces) { if (namespaces != null) { return (obj, context) => { context.Writer.WriteStartElement (prefix, name, @namespace); foreach (var ns in namespaces) { context.Writer.WriteAttributeString ("xmlns", ns.Prefix, null, ns.Namespace); } }; } else { return (obj, context) => { context.Writer.WriteStartElement (prefix, name, @namespace); }; } } protected override Serializer CreateTypeEndAutoSerializer () { return (obj, context) => context.Writer.WriteEndElement (); } protected override Serializer CreateMemberAutoSerializer () { var attribute_serializers = new List> (); var element_serializers = new List> (); foreach (var property in Properties) { ProcessProperty (property, attribute_serializers, element_serializers); } attribute_serializers.AddRange (element_serializers); if (attribute_serializers.Count == 0) { return (obj, context) => { if (obj != null) { context.Writer.WriteValue (obj.ToString ()); } }; } else { var serializers = attribute_serializers.ToArray (); return (obj, context) => { foreach (var serializer in serializers) { serializer (obj, context); } }; } } protected virtual void ProcessProperty (PropertyInfo property, ICollection> attributeSerializers, ICollection> elementSerializers) { XmlAttributeAttribute attribute_attribute = null; XmlElementAttribute element_attribute = null; XmlFlagAttribute flag_attribute = null; XmlArrayAttribute array_attribute = null; XmlArrayItemAttribute array_item_attribute = null; XmlValueAttribute value_attribute = null; foreach (var custom_attribute in property.GetCustomAttributes (false)) { if (custom_attribute is DoNotSerializeAttribute) { attribute_attribute = null; element_attribute = null; flag_attribute = null; array_attribute = null; value_attribute = null; break; } var attribute = custom_attribute as XmlAttributeAttribute; if(attribute != null) { attribute_attribute = attribute; continue; } var element = custom_attribute as XmlElementAttribute; if (element != null) { element_attribute = element; continue; } var flag = custom_attribute as XmlFlagAttribute; if (flag != null) { flag_attribute = flag; continue; } var array = custom_attribute as XmlArrayAttribute; if (array != null) { array_attribute = array; continue; } var array_item = custom_attribute as XmlArrayItemAttribute; if (array_item != null) { array_item_attribute = array_item; continue; } var value = custom_attribute as XmlValueAttribute; if (value != null) { value_attribute = value; continue; } } if (attribute_attribute != null) { attributeSerializers.Add ( CreateSerializer (property, CreateAttributeSerializer (property, attribute_attribute))); } else if (element_attribute != null) { elementSerializers.Add ( CreateSerializer (property, CreateElementSerializer (property, element_attribute))); } else if (flag_attribute != null) { elementSerializers.Add ( CreateSerializer (property, CreateFlagSerializer (property, flag_attribute))); } else if (array_attribute != null) { elementSerializers.Add ( CreateSerializer (property, CreateArraySerializer (property, array_attribute, array_item_attribute))); } else if (array_item_attribute != null) { elementSerializers.Add ( CreateSerializer (property, CreateArrayItemSerializer (property, array_item_attribute))); } else if (value_attribute != null) { elementSerializers.Add ( CreateSerializer (property, CreateValueSerializer (property))); } } protected virtual Serializer CreateSerializer (PropertyInfo property, Serializer serializer) { return (obj, context) => serializer (property.GetValue (obj, null), context); } static Serializer CreateSerializer (Serializer serializer, bool omitIfNull) { if (omitIfNull) { return (obj, writer) => { if (obj != null) { serializer (obj, writer); } }; } else { return serializer; } } protected virtual Serializer CreateAttributeSerializer (PropertyInfo property, XmlAttributeAttribute attributeAttribute) { return CreateSerializer ( CreateAttributeSerializer ( property, string.IsNullOrEmpty (attributeAttribute.Name) ? property.Name : attributeAttribute.Name, attributeAttribute.Namespace, attributeAttribute.Prefix), attributeAttribute.OmitIfNull); } protected virtual Serializer CreateAttributeSerializer (PropertyInfo property, string name, string @namespace, string prefix) { if (!property.CanRead) { // TODO throw } if (property.PropertyType.IsEnum) { var map = GetEnumMap (property.PropertyType); return (obj, context) => { context.Writer.WriteAttributeString (prefix, name, @namespace, map[obj]); }; } else { return (obj, context) => { context.Writer.WriteAttributeString ( prefix, name, @namespace, obj != null ? obj.ToString () : string.Empty); }; } } protected virtual Serializer CreateElementSerializer (PropertyInfo property, XmlElementAttribute elementAttribute) { return CreateSerializer ( CreateElementSerializer ( property, string.IsNullOrEmpty (elementAttribute.Name) ? property.Name : elementAttribute.Name, elementAttribute.Namespace, elementAttribute.Prefix), elementAttribute.OmitIfNull); } protected virtual Serializer CreateElementSerializer (PropertyInfo property, string name, string @namespace, string prefix) { if (!property.CanRead) { // TODO throw } var next = GetCompilerForType (property.PropertyType).MemberSerializer; return (obj, context) => { context.Writer.WriteStartElement (prefix, name, @namespace); next (obj, context); context.Writer.WriteEndElement (); }; } protected virtual Serializer CreateArraySerializer (PropertyInfo property, XmlArrayAttribute arrayAttribute, XmlArrayItemAttribute arrayItemAttribute) { return CreateSerializer ( CreateArraySerializer ( property, string.IsNullOrEmpty (arrayAttribute.Name) ? property.Name : arrayAttribute.Name, arrayAttribute.Namespace, arrayAttribute.Prefix, arrayAttribute.OmitIfEmpty, arrayItemAttribute), arrayAttribute.OmitIfNull); } protected virtual Serializer CreateArraySerializer (PropertyInfo property, string name, string @namespace, string prefix, bool omitIfEmpty, XmlArrayItemAttribute arrayItemAttribute) { if (!property.CanRead) { // TODO throw } var item_type = GetIEnumerable (property.PropertyType).GetGenericArguments ()[0]; var next = CreateArrayItemSerializer (item_type, arrayItemAttribute); if (omitIfEmpty) { return (obj, context) => { if (obj != null) { var first = true; foreach (var item in (IEnumerable)obj) { if (first) { context.Writer.WriteStartElement (prefix, name, @namespace); first = false; } next (item, context); } if (!first) { context.Writer.WriteEndElement (); } } }; } else { return (obj, context) => { context.Writer.WriteStartElement (prefix, name, @namespace); if (obj != null) { foreach (var item in (IEnumerable)obj) { next (item, context); } } context.Writer.WriteEndElement (); }; } } protected virtual Serializer CreateArrayItemSerializer (Type type, XmlArrayItemAttribute arrayItemAttribute) { if (arrayItemAttribute == null || string.IsNullOrEmpty (arrayItemAttribute.Name)) { return GetCompilerForType (type).TypeSerializer; } else { var name = arrayItemAttribute.Name; var @namespace = arrayItemAttribute.Namespace; var prefix = arrayItemAttribute.Prefix; var next = GetCompilerForType (type).MemberSerializer; return (obj, context) => { context.Writer.WriteStartElement (prefix, name, @namespace); next (obj, context); context.Writer.WriteEndElement (); }; } } protected virtual Serializer CreateArrayItemSerializer (PropertyInfo property, XmlArrayItemAttribute arrayItemAttribute) { if (!property.CanRead) { // TODO throw } if (string.IsNullOrEmpty (arrayItemAttribute.Name)) { return CreateArrayItemSerializer (property); } else { return CreateArrayItemSerializer ( property, arrayItemAttribute.Name, arrayItemAttribute.Namespace, arrayItemAttribute.Prefix); } } protected virtual Serializer CreateArrayItemSerializer (PropertyInfo property) { var item_type = GetIEnumerable (property.PropertyType).GetGenericArguments ()[0]; var serializer = GetCompilerForType (item_type).TypeSerializer; return (obj, context) => { if (obj != null) { foreach (var item in (IEnumerable)obj) { serializer (item, context); } } }; } protected virtual Serializer CreateArrayItemSerializer (PropertyInfo property, string name, string @namespace, string prefix) { var item_type = GetIEnumerable (property.PropertyType).GetGenericArguments ()[0]; var serializer = GetCompilerForType (item_type).MemberSerializer; return (obj, context) => { if (obj != null) { foreach (var item in (IEnumerable)obj) { context.Writer.WriteStartElement (prefix, name, @namespace); serializer (item, context); context.Writer.WriteEndElement (); } } }; } protected virtual Serializer CreateFlagSerializer (PropertyInfo property, XmlFlagAttribute flagAttribute) { return CreateFlagSerializer ( property, string.IsNullOrEmpty (flagAttribute.Name) ? property.Name : flagAttribute.Name, flagAttribute.Namespace, flagAttribute.Prefix); } protected virtual Serializer CreateFlagSerializer (PropertyInfo property, string name, string @namespace, string prefix) { if (property.PropertyType != typeof (bool)) { // TODO throw } return (obj, context) => { if ((bool)obj) { context.Writer.WriteStartElement (prefix, name, @namespace); context.Writer.WriteEndElement (); } }; } protected static Type GetIEnumerable (Type type) { if (type.IsGenericType && type.GetGenericTypeDefinition () == typeof (IEnumerable<>)) { return type; } else { var ienumerable = type.GetInterface ("IEnumerable`1"); if (ienumerable != null) { return ienumerable; } else { // TODO throw return null; } } } static Serializer CreateValueSerializer (PropertyInfo property) { return (obj, context) => { if (obj != null) { context.Writer.WriteString (obj.ToString ()); } }; } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml.Compilation/ObjectDeserializer.cs0000664000175000017500000000250011707010776032141 0ustar00lorentzlorentz00000000000000// // ObjectDeserializer.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. namespace Mono.Upnp.Xml.Compilation { public delegate void ObjectDeserializer (object obj, XmlDeserializationContext context); } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml.Compilation/DeserializationCompilerProvider.cs0000664000175000017500000000270711707010776034735 0ustar00lorentzlorentz00000000000000// // DeserializationCompilerProvider.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; namespace Mono.Upnp.Xml.Compilation { public delegate DeserializationCompiler DeserializationCompilerProvider (XmlDeserializer xmlDeserializer, Type type); } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml.Compilation/DeserializationCompiler.cs0000664000175000017500000000774611707010776033232 0ustar00lorentzlorentz00000000000000// // DeserializationCompiler.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Xml; namespace Mono.Upnp.Xml.Compilation { public abstract class DeserializationCompiler : Compiler { readonly XmlDeserializer xml_deserializer; Deserializer deserializer; ObjectDeserializer auto_deserializer; ObjectDeserializer attribute_auto_deserializer; ObjectDeserializer element_auto_deserializer; public DeserializationCompiler (XmlDeserializer xmlDeserializer, Type type) : base (type) { if (xmlDeserializer == null) throw new ArgumentNullException ("xmlDeserializer"); this.xml_deserializer = xmlDeserializer; } public Deserializer Deserializer { get { if (this.deserializer == null) { Deserializer deserializer = null; this.deserializer = context => deserializer (context); deserializer = CreateDeserializer (); this.deserializer = deserializer; } return this.deserializer; } } public ObjectDeserializer AutoDeserializer { get { if (auto_deserializer == null) { auto_deserializer = CreateAutoDeserializer (); } return auto_deserializer; } } public ObjectDeserializer AttributeAutoDeserializer { get { if (attribute_auto_deserializer == null) { attribute_auto_deserializer = CreateAttributeAutoDeserializer (); } return attribute_auto_deserializer; } } public ObjectDeserializer ElementAutoDeserializer { get { if (element_auto_deserializer == null) { element_auto_deserializer = CreateElementAutoDeserializer (); } return element_auto_deserializer; } } protected abstract Deserializer CreateDeserializer (); protected abstract ObjectDeserializer CreateAutoDeserializer (); protected abstract ObjectDeserializer CreateAttributeAutoDeserializer (); protected abstract ObjectDeserializer CreateElementAutoDeserializer (); protected XmlDeserializationContext CreateDeserializationContext (XmlReader reader) { return new XmlDeserializationContext (xml_deserializer, reader); } protected Deserializer GetDeserializerForType (Type type) { if (type == null) throw new ArgumentNullException ("type"); return xml_deserializer.GetCompilerForType (type).Deserializer; } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml.Compilation/SerializationCompiler.cs0000664000175000017500000001552611707010776032714 0ustar00lorentzlorentz00000000000000// // SerializationCompiler.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using System.Reflection; using System.Xml; namespace Mono.Upnp.Xml.Compilation { public abstract class SerializationCompiler : Compiler { readonly XmlSerializer xml_serializer; Serializer type_serializer; Serializer type_start_auto_serializer; Serializer type_end_auto_serializer; Serializer member_serializer; Serializer member_auto_serializer; protected SerializationCompiler (XmlSerializer xmlSerializer, Type type) : base (type) { if (xmlSerializer == null) throw new ArgumentNullException ("xmlSerializer"); this.xml_serializer = xmlSerializer; } public Serializer TypeSerializer { get { if (this.type_serializer == null) { Serializer type_serializer = null; this.type_serializer = (obj, context) => type_serializer (obj, context); type_serializer = CreateTypeSerializer (); this.type_serializer = type_serializer; } return this.type_serializer; } } public Serializer TypeStartAutoSerializer { get { if (type_start_auto_serializer == null) { type_start_auto_serializer = CreateTypeStartAutoSerializer (); } return type_start_auto_serializer; } } public Serializer TypeEndAutoSerializer { get { if (type_end_auto_serializer == null) { type_end_auto_serializer = CreateTypeEndAutoSerializer (); } return type_end_auto_serializer; } } public Serializer MemberSerializer { get { if (this.member_serializer == null) { Serializer member_serializer = null; this.member_serializer = (obj, context) => member_serializer (obj, context); member_serializer = CreateMemberSerializer (); this.member_serializer = member_serializer; } return this.member_serializer; } } public Serializer MemberAutoSerializer { get { if (member_auto_serializer == null) { member_auto_serializer = CreateMemberAutoSerializer (); } return member_auto_serializer; } } protected virtual Serializer CreateTypeSerializer () { if (typeof (IXmlSerializable).IsAssignableFrom (Type)) { return (obj, context) => ((IXmlSerializable)obj).Serialize (context); } else if (typeof (IXmlSerializable).IsAssignableFrom (Type)) { return (obj, context) => ((IXmlSerializable)obj).Serialize (context); } else { return (obj, context) => { TypeStartAutoSerializer (obj, context); MemberSerializer (obj, context); TypeEndAutoSerializer (obj, context); }; } } protected abstract Serializer CreateTypeStartAutoSerializer (); protected abstract Serializer CreateTypeEndAutoSerializer (); protected virtual Serializer CreateMemberSerializer () { if (typeof (IXmlSerializable).IsAssignableFrom (Type)) { return (obj, context) => ((IXmlSerializable)obj).SerializeMembers (context); } else if (typeof (IXmlSerializable).IsAssignableFrom (Type)) { return (obj, context) => ((IXmlSerializable)obj).SerializeMembers (context); } else if (Type.IsEnum) { var map = GetEnumMap (Type); return (obj, context) => context.Writer.WriteValue (map [obj]); } else { return MemberAutoSerializer; } } protected abstract Serializer CreateMemberAutoSerializer (); protected static Dictionary GetEnumMap (Type type) { var fields = type.GetFields (BindingFlags.Public | BindingFlags.Static); var dictionary = new Dictionary (fields.Length); foreach (var field in fields) { var enum_attribute = field.GetCustomAttributes (typeof (XmlEnumAttribute), false); string name; if (enum_attribute.Length != 0) { name = ((XmlEnumAttribute)enum_attribute[0]).Value; } else { name = field.Name; } dictionary.Add (field.GetValue (null), name); } return dictionary; } protected SerializationCompiler GetCompilerForType (Type type) { if (type == null) throw new ArgumentNullException ("type"); return xml_serializer.GetCompilerForType (type); } protected XmlSerializationContext CreateContext (XmlWriter writer, TContext context) { if (writer == null) throw new ArgumentNullException ("writer"); return new XmlSerializationContext (xml_serializer, writer, context); } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Makefile.am0000664000175000017500000001346411715013277023241 0ustar00lorentzlorentz00000000000000 EXTRA_DIST = # Warning: This is an automatically generated file, do not edit! if ENABLE_DEBUG ASSEMBLY_COMPILER_COMMAND = gmcs ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug -define:DEBUG "-define:DEBUG,TRACE" "-keyfile:$(srcdir)/mono-upnp.snk" ASSEMBLY = ../../../bin/Mono.Upnp.dll ASSEMBLY_MDB = $(ASSEMBLY).mdb COMPILE_TARGET = library PROJECT_REFERENCES = ../../../bin/Mono.Ssdp.dll BUILD_DIR = ../../../bin MONO_UPNP_DLL_MDB_SOURCE=../../../bin/Mono.Upnp.dll.mdb MONO_UPNP_DLL_MDB=$(BUILD_DIR)/Mono.Upnp.dll.mdb MONO_SSDP_DLL_SOURCE=../../../bin/Mono.Ssdp.dll MONO_SSDP_DLL_MDB_SOURCE=../../../bin/Mono.Ssdp.dll.mdb MONO_SSDP_DLL_MDB=$(BUILD_DIR)/Mono.Ssdp.dll.mdb endif if ENABLE_RELEASE ASSEMBLY_COMPILER_COMMAND = gmcs ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ "-keyfile:$(srcdir)/mono-upnp.snk" ASSEMBLY = ../../../bin/Mono.Upnp.dll ASSEMBLY_MDB = COMPILE_TARGET = library PROJECT_REFERENCES = \ ../../../bin/Mono.Ssdp.dll BUILD_DIR = ../../../bin MONO_UPNP_DLL_MDB= MONO_SSDP_DLL_SOURCE=../../../bin/Mono.Ssdp.dll MONO_SSDP_DLL_MDB= endif AL=al2 SATELLITE_ASSEMBLY_NAME=$(notdir $(basename $(ASSEMBLY))).resources.dll PROGRAMFILES = \ $(MONO_UPNP_DLL_MDB) \ $(MONO_SSDP_DLL) \ $(MONO_SSDP_DLL_MDB) LINUX_PKGCONFIG = \ $(MONO_UPNP_PC) RESGEN=resgen2 all: $(ASSEMBLY) $(PROGRAMFILES) $(LINUX_PKGCONFIG) FILES = \ AssemblyInfo.cs \ Mono.Upnp.Control/AllowedValueRange.cs \ Mono.Upnp.Control/Argument.cs \ Mono.Upnp.Control/ArgumentDirection.cs \ Mono.Upnp.Control/IMap.cs \ Mono.Upnp.Control/ServiceAction.cs \ Mono.Upnp.Control/ServiceActionExecutor.cs \ Mono.Upnp.Control/ServiceController.cs \ Mono.Upnp.Control/StateVariable.cs \ Mono.Upnp.Control/StateVariableChangedArgs.cs \ Mono.Upnp.Control/StateVariableEventer.cs \ Mono.Upnp.Control/StateVariableOptions.cs \ Mono.Upnp.Control/UpnpActionAttribute.cs \ Mono.Upnp.Control/UpnpArgumentAttribute.cs \ Mono.Upnp.Control/UpnpControlException.cs \ Mono.Upnp.Control/UpnpEnumAttribute.cs \ Mono.Upnp.Control/UpnpError.cs \ Mono.Upnp.Control/UpnpRelatedStateVariableAttribute.cs \ Mono.Upnp.Control/UpnpServiceDefinitionException.cs \ Mono.Upnp.Control/UpnpStateVariableAttribute.cs \ Mono.Upnp.Internal/Arguments.cs \ Mono.Upnp.Internal/CollectionMap.cs \ Mono.Upnp.Internal/ControlClient.cs \ Mono.Upnp.Internal/ControlServer.cs \ Mono.Upnp.Internal/DataServer.cs \ Mono.Upnp.Internal/EmptyDictionary.cs \ Mono.Upnp.Internal/EventClient.cs \ Mono.Upnp.Internal/EventServer.cs \ Mono.Upnp.Internal/Func.cs \ Mono.Upnp.Internal/Helper.cs \ Mono.Upnp.Internal/IMappable.cs \ Mono.Upnp.Internal/Log.cs \ Mono.Upnp.Internal/Map.cs \ Mono.Upnp.Internal/Protocol.cs \ Mono.Upnp.Internal/ServiceControllerBuilder.cs \ Mono.Upnp.Internal/SoapEnvelope.cs \ Mono.Upnp.Internal/SoapFault.cs \ Mono.Upnp.Internal/SoapHeader.cs \ Mono.Upnp.Internal/TimeoutDispatcher.cs \ Mono.Upnp.Internal/UpnpServer.cs \ Mono.Upnp.Internal/XmlShell.cs \ Mono.Upnp.Xml.Compilation/Compiler.cs \ Mono.Upnp.Xml.Compilation/DelegateDeserializationCompiler.cs \ Mono.Upnp.Xml.Compilation/DelegateSerializationCompiler.cs \ Mono.Upnp.Xml.Compilation/DeserializationCompiler.cs \ Mono.Upnp.Xml.Compilation/DeserializationCompilerProvider.cs \ Mono.Upnp.Xml.Compilation/Deserializer.cs \ Mono.Upnp.Xml.Compilation/ObjectDeserializer.cs \ Mono.Upnp.Xml.Compilation/SerializationCompiler.cs \ Mono.Upnp.Xml.Compilation/SerializationCompilerProvider.cs \ Mono.Upnp.Xml.Compilation/Serializer.cs \ Mono.Upnp.Xml/DoNotDeserializeAttribute.cs \ Mono.Upnp.Xml/DoNotSerializeAttribute.cs \ Mono.Upnp.Xml/IXmlDeserializable.cs \ Mono.Upnp.Xml/IXmlDeserializer.cs \ Mono.Upnp.Xml/IXmlSerializable.cs \ Mono.Upnp.Xml/XmlArrayAttribute.cs \ Mono.Upnp.Xml/XmlArrayItemAttribute.cs \ Mono.Upnp.Xml/XmlAttributeAttribute.cs \ Mono.Upnp.Xml/XmlAutomatable.cs \ Mono.Upnp.Xml/XmlDeclarationType.cs \ Mono.Upnp.Xml/XmlDeserializable.cs \ Mono.Upnp.Xml/XmlDeserializationContext.cs \ Mono.Upnp.Xml/XmlDeserializer.cs \ Mono.Upnp.Xml/XmlElementAttribute.cs \ Mono.Upnp.Xml/XmlEnumAttribute.cs \ Mono.Upnp.Xml/XmlFlagAttribute.cs \ Mono.Upnp.Xml/XmlNamespaceAttribute.cs \ Mono.Upnp.Xml/XmlSerializable.cs \ Mono.Upnp.Xml/XmlSerializationContext.cs \ Mono.Upnp.Xml/XmlSerializationOptions.cs \ Mono.Upnp.Xml/XmlSerializer.cs \ Mono.Upnp.Xml/XmlTypeAttribute.cs \ Mono.Upnp.Xml/XmlValueAttribute.cs \ Mono.Upnp/Client.cs \ Mono.Upnp/Description.cs \ Mono.Upnp/Deserializer.cs \ Mono.Upnp/DeserializerProducer.cs \ Mono.Upnp/Device.cs \ Mono.Upnp/DeviceAnnouncement.cs \ Mono.Upnp/DeviceOptions.cs \ Mono.Upnp/DeviceType.cs \ Mono.Upnp/DisposedEventArgs.cs \ Mono.Upnp/Icon.cs \ Mono.Upnp/Root.cs \ Mono.Upnp/Server.cs \ Mono.Upnp/Service.cs \ Mono.Upnp/ServiceAnnouncement.cs \ Mono.Upnp/ServiceType.cs \ Mono.Upnp/SpecVersion.cs \ Mono.Upnp/TypeInfo.cs \ Mono.Upnp/UpnpDeserializationException.cs \ Mono.Upnp/UpnpEventArgs.cs \ Mono.Upnp/UpnpException.cs DATA_FILES = RESOURCES = EXTRAS = \ Mono.Upnp.Xml.Compilation \ mono-upnp.snk \ mono.upnp.pc.in REFERENCES = \ System \ System.Xml DLL_REFERENCES = CLEANFILES = $(PROGRAMFILES) $(LINUX_PKGCONFIG) include $(top_srcdir)/Makefile.include MONO_SSDP_DLL = $(BUILD_DIR)/Mono.Ssdp.dll MONO_UPNP_PC = $(BUILD_DIR)/mono.upnp.pc $(eval $(call emit-deploy-wrapper,MONO_UPNP_PC,mono.upnp.pc)) $(eval $(call emit_resgen_targets)) $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(ASSEMBLY_MDB): $(ASSEMBLY) $(ASSEMBLY): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(shell dirname $(ASSEMBLY)) $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Makefile.in0000664000175000017500000006770611761736756023301 0ustar00lorentzlorentz00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/mono.upnp.pc.in $(top_srcdir)/Makefile.include subdir = src/Mono.Upnp/Mono.Upnp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/expansions.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = mono.upnp.pc CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(bindir)" \ "$(DESTDIR)$(assemblyfilesdir)" \ "$(DESTDIR)$(linuxpkgconfigdir)" \ "$(DESTDIR)$(programfilesdir)" SCRIPTS = $(bin_SCRIPTS) SOURCES = DIST_SOURCES = DATA = $(assemblyfiles_DATA) $(linuxpkgconfig_DATA) \ $(programfiles_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ GLADE_SHARP_20_CFLAGS = @GLADE_SHARP_20_CFLAGS@ GLADE_SHARP_20_LIBS = @GLADE_SHARP_20_LIBS@ GLIB_SHARP_20_CFLAGS = @GLIB_SHARP_20_CFLAGS@ GLIB_SHARP_20_LIBS = @GLIB_SHARP_20_LIBS@ GMCS = @GMCS@ GTK_SHARP_20_CFLAGS = @GTK_SHARP_20_CFLAGS@ GTK_SHARP_20_LIBS = @GTK_SHARP_20_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MONO_ADDINS_CFLAGS = @MONO_ADDINS_CFLAGS@ MONO_ADDINS_LIBS = @MONO_ADDINS_LIBS@ NUNIT_CFLAGS = @NUNIT_CFLAGS@ NUNIT_CMD = @NUNIT_CMD@ NUNIT_LIBS = @NUNIT_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TAGLIB_SHARP_CFLAGS = @TAGLIB_SHARP_CFLAGS@ TAGLIB_SHARP_LIBS = @TAGLIB_SHARP_LIBS@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_bindir = @expanded_bindir@ expanded_datadir = @expanded_datadir@ expanded_libdir = @expanded_libdir@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = $(build_sources) $(build_resx_files) \ $(build_others_files) $(ASSEMBLY_WRAPPER_IN) $(EXTRAS) \ $(DATA_FILES) $(build_culture_res_files) # Warning: This is an automatically generated file, do not edit! @ENABLE_DEBUG_TRUE@ASSEMBLY_COMPILER_COMMAND = gmcs @ENABLE_RELEASE_TRUE@ASSEMBLY_COMPILER_COMMAND = gmcs @ENABLE_DEBUG_TRUE@ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug -define:DEBUG "-define:DEBUG,TRACE" "-keyfile:$(srcdir)/mono-upnp.snk" @ENABLE_RELEASE_TRUE@ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ "-keyfile:$(srcdir)/mono-upnp.snk" @ENABLE_DEBUG_TRUE@ASSEMBLY = ../../../bin/Mono.Upnp.dll @ENABLE_RELEASE_TRUE@ASSEMBLY = ../../../bin/Mono.Upnp.dll @ENABLE_DEBUG_TRUE@ASSEMBLY_MDB = $(ASSEMBLY).mdb @ENABLE_RELEASE_TRUE@ASSEMBLY_MDB = @ENABLE_DEBUG_TRUE@COMPILE_TARGET = library @ENABLE_RELEASE_TRUE@COMPILE_TARGET = library @ENABLE_DEBUG_TRUE@PROJECT_REFERENCES = ../../../bin/Mono.Ssdp.dll @ENABLE_RELEASE_TRUE@PROJECT_REFERENCES = \ @ENABLE_RELEASE_TRUE@ ../../../bin/Mono.Ssdp.dll @ENABLE_DEBUG_TRUE@BUILD_DIR = ../../../bin @ENABLE_RELEASE_TRUE@BUILD_DIR = ../../../bin @ENABLE_DEBUG_TRUE@MONO_UPNP_DLL_MDB_SOURCE = ../../../bin/Mono.Upnp.dll.mdb @ENABLE_DEBUG_TRUE@MONO_UPNP_DLL_MDB = $(BUILD_DIR)/Mono.Upnp.dll.mdb @ENABLE_RELEASE_TRUE@MONO_UPNP_DLL_MDB = @ENABLE_DEBUG_TRUE@MONO_SSDP_DLL_SOURCE = ../../../bin/Mono.Ssdp.dll @ENABLE_RELEASE_TRUE@MONO_SSDP_DLL_SOURCE = ../../../bin/Mono.Ssdp.dll @ENABLE_DEBUG_TRUE@MONO_SSDP_DLL_MDB_SOURCE = ../../../bin/Mono.Ssdp.dll.mdb @ENABLE_DEBUG_TRUE@MONO_SSDP_DLL_MDB = $(BUILD_DIR)/Mono.Ssdp.dll.mdb @ENABLE_RELEASE_TRUE@MONO_SSDP_DLL_MDB = AL = al2 SATELLITE_ASSEMBLY_NAME = $(notdir $(basename $(ASSEMBLY))).resources.dll PROGRAMFILES = \ $(MONO_UPNP_DLL_MDB) \ $(MONO_SSDP_DLL) \ $(MONO_SSDP_DLL_MDB) LINUX_PKGCONFIG = \ $(MONO_UPNP_PC) RESGEN = resgen2 FILES = \ AssemblyInfo.cs \ Mono.Upnp.Control/AllowedValueRange.cs \ Mono.Upnp.Control/Argument.cs \ Mono.Upnp.Control/ArgumentDirection.cs \ Mono.Upnp.Control/IMap.cs \ Mono.Upnp.Control/ServiceAction.cs \ Mono.Upnp.Control/ServiceActionExecutor.cs \ Mono.Upnp.Control/ServiceController.cs \ Mono.Upnp.Control/StateVariable.cs \ Mono.Upnp.Control/StateVariableChangedArgs.cs \ Mono.Upnp.Control/StateVariableEventer.cs \ Mono.Upnp.Control/StateVariableOptions.cs \ Mono.Upnp.Control/UpnpActionAttribute.cs \ Mono.Upnp.Control/UpnpArgumentAttribute.cs \ Mono.Upnp.Control/UpnpControlException.cs \ Mono.Upnp.Control/UpnpEnumAttribute.cs \ Mono.Upnp.Control/UpnpError.cs \ Mono.Upnp.Control/UpnpRelatedStateVariableAttribute.cs \ Mono.Upnp.Control/UpnpServiceDefinitionException.cs \ Mono.Upnp.Control/UpnpStateVariableAttribute.cs \ Mono.Upnp.Internal/Arguments.cs \ Mono.Upnp.Internal/CollectionMap.cs \ Mono.Upnp.Internal/ControlClient.cs \ Mono.Upnp.Internal/ControlServer.cs \ Mono.Upnp.Internal/DataServer.cs \ Mono.Upnp.Internal/EmptyDictionary.cs \ Mono.Upnp.Internal/EventClient.cs \ Mono.Upnp.Internal/EventServer.cs \ Mono.Upnp.Internal/Func.cs \ Mono.Upnp.Internal/Helper.cs \ Mono.Upnp.Internal/IMappable.cs \ Mono.Upnp.Internal/Log.cs \ Mono.Upnp.Internal/Map.cs \ Mono.Upnp.Internal/Protocol.cs \ Mono.Upnp.Internal/ServiceControllerBuilder.cs \ Mono.Upnp.Internal/SoapEnvelope.cs \ Mono.Upnp.Internal/SoapFault.cs \ Mono.Upnp.Internal/SoapHeader.cs \ Mono.Upnp.Internal/TimeoutDispatcher.cs \ Mono.Upnp.Internal/UpnpServer.cs \ Mono.Upnp.Internal/XmlShell.cs \ Mono.Upnp.Xml.Compilation/Compiler.cs \ Mono.Upnp.Xml.Compilation/DelegateDeserializationCompiler.cs \ Mono.Upnp.Xml.Compilation/DelegateSerializationCompiler.cs \ Mono.Upnp.Xml.Compilation/DeserializationCompiler.cs \ Mono.Upnp.Xml.Compilation/DeserializationCompilerProvider.cs \ Mono.Upnp.Xml.Compilation/Deserializer.cs \ Mono.Upnp.Xml.Compilation/ObjectDeserializer.cs \ Mono.Upnp.Xml.Compilation/SerializationCompiler.cs \ Mono.Upnp.Xml.Compilation/SerializationCompilerProvider.cs \ Mono.Upnp.Xml.Compilation/Serializer.cs \ Mono.Upnp.Xml/DoNotDeserializeAttribute.cs \ Mono.Upnp.Xml/DoNotSerializeAttribute.cs \ Mono.Upnp.Xml/IXmlDeserializable.cs \ Mono.Upnp.Xml/IXmlDeserializer.cs \ Mono.Upnp.Xml/IXmlSerializable.cs \ Mono.Upnp.Xml/XmlArrayAttribute.cs \ Mono.Upnp.Xml/XmlArrayItemAttribute.cs \ Mono.Upnp.Xml/XmlAttributeAttribute.cs \ Mono.Upnp.Xml/XmlAutomatable.cs \ Mono.Upnp.Xml/XmlDeclarationType.cs \ Mono.Upnp.Xml/XmlDeserializable.cs \ Mono.Upnp.Xml/XmlDeserializationContext.cs \ Mono.Upnp.Xml/XmlDeserializer.cs \ Mono.Upnp.Xml/XmlElementAttribute.cs \ Mono.Upnp.Xml/XmlEnumAttribute.cs \ Mono.Upnp.Xml/XmlFlagAttribute.cs \ Mono.Upnp.Xml/XmlNamespaceAttribute.cs \ Mono.Upnp.Xml/XmlSerializable.cs \ Mono.Upnp.Xml/XmlSerializationContext.cs \ Mono.Upnp.Xml/XmlSerializationOptions.cs \ Mono.Upnp.Xml/XmlSerializer.cs \ Mono.Upnp.Xml/XmlTypeAttribute.cs \ Mono.Upnp.Xml/XmlValueAttribute.cs \ Mono.Upnp/Client.cs \ Mono.Upnp/Description.cs \ Mono.Upnp/Deserializer.cs \ Mono.Upnp/DeserializerProducer.cs \ Mono.Upnp/Device.cs \ Mono.Upnp/DeviceAnnouncement.cs \ Mono.Upnp/DeviceOptions.cs \ Mono.Upnp/DeviceType.cs \ Mono.Upnp/DisposedEventArgs.cs \ Mono.Upnp/Icon.cs \ Mono.Upnp/Root.cs \ Mono.Upnp/Server.cs \ Mono.Upnp/Service.cs \ Mono.Upnp/ServiceAnnouncement.cs \ Mono.Upnp/ServiceType.cs \ Mono.Upnp/SpecVersion.cs \ Mono.Upnp/TypeInfo.cs \ Mono.Upnp/UpnpDeserializationException.cs \ Mono.Upnp/UpnpEventArgs.cs \ Mono.Upnp/UpnpException.cs DATA_FILES = RESOURCES = EXTRAS = \ Mono.Upnp.Xml.Compilation \ mono-upnp.snk \ mono.upnp.pc.in REFERENCES = \ System \ System.Xml DLL_REFERENCES = CLEANFILES = $(PROGRAMFILES) $(LINUX_PKGCONFIG) $(ASSEMBLY) \ $(ASSEMBLY).mdb $(BINARIES) $(build_resx_resources) \ $(build_satellite_assembly_list) VALID_CULTURES = ar bg ca zh-CHS cs da de el en es fi fr he hu is it ja ko nl no pl pt ro ru hr sk sq sv th tr id uk be sl et lv lt fa vi hy eu mk af ka fo hi sw gu ta te kn mr gl kok ar-SA bg-BG ca-ES zh-TW cs-CZ da-DK de-DE el-GR en-US fi-FI fr-FR he-IL hu-HU is-IS it-IT ja-JP ko-KR nl-NL nb-NO pl-PL pt-BR ro-RO ru-RU hr-HR sk-SK sq-AL sv-SE th-TH tr-TR id-ID uk-UA be-BY sl-SI et-EE lv-LV lt-LT fa-IR vi-VN hy-AM eu-ES mk-MK af-ZA ka-GE fo-FO hi-IN sw-KE gu-IN ta-IN te-IN kn-IN mr-IN gl-ES kok-IN ar-IQ zh-CN de-CH en-GB es-MX fr-BE it-CH nl-BE nn-NO pt-PT sv-FI ar-EG zh-HK de-AT en-AU es-ES fr-CA ar-LY zh-SG de-LU en-CA es-GT fr-CH ar-DZ zh-MO en-NZ es-CR fr-LU ar-MA en-IE es-PA ar-TN en-ZA es-DO ar-OM es-VE ar-YE es-CO ar-SY es-PE ar-JO en-TT es-AR ar-LB en-ZW es-EC ar-KW en-PH es-CL ar-AE es-UY ar-BH es-PY ar-QA es-BO es-SV es-HN es-NI es-PR zh-CHT s2q = $(subst \ ,?,$1) q2s = $(subst ?,\ ,$1) # use this when result will be quoted unesc2 = $(subst ?, ,$1) build_sources = $(FILES) $(GENERATED_FILES) build_sources_esc = $(call s2q,$(build_sources)) # use unesc2, as build_sources_embed is quoted build_sources_embed = $(call unesc2,$(build_sources_esc:%='$(srcdir)/%')) comma__ = , get_resource_name = $(firstword $(subst $(comma__), ,$1)) get_culture = $(lastword $(subst ., ,$(basename $1))) is_cultured_resource = $(and $(word 3,$(subst ., ,$1)), $(filter $(VALID_CULTURES),$(lastword $(subst ., ,$(basename $1))))) RESOURCES_ESC = $(call s2q,$(RESOURCES)) build_resx_list = $(foreach res, $(RESOURCES_ESC), $(if $(filter %.resx, $(call get_resource_name,$(res))),$(res),)) build_non_culture_resx_list = $(foreach res, $(build_resx_list),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_non_culture_others_list = $(foreach res, $(filter-out $(build_resx_list),$(RESOURCES_ESC)),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_others_list = $(build_non_culture_others_list) build_xamlg_list = $(filter %.xaml.g.cs, $(FILES)) # resgen all .resx resources build_resx_files = $(foreach res, $(build_resx_list), $(call get_resource_name,$(res))) build_resx_resources_esc = $(build_resx_files:.resx=.resources) build_resx_resources = $(call q2s,$(build_resx_resources_esc)) # embed resources for the main assembly build_resx_resources_hack = $(subst .resx,.resources, $(build_non_culture_resx_list)) # use unesc2, as build_resx_resources_embed is quoted build_resx_resources_embed = $(call unesc2,$(build_resx_resources_hack:%='-resource:%')) build_others_files = $(call q2s,$(foreach res, $(build_others_list),$(call get_resource_name,$(res)))) build_others_resources = $(build_others_files) # use unesc2, as build_others_resources_embed is quoted build_others_resources_embed = $(call unesc2,$(build_others_list:%='-resource:$(srcdir)/%')) build_resources = $(build_resx_resources) $(build_others_resources) build_resources_embed = $(build_resx_resources_embed) $(build_others_resources_embed) # -usesourcepath is available only for resgen2 emit_resgen_target_1 = $(call q2s,$1) : $(call q2s,$(subst .resources,.resx,$1)); cd '$$(shell dirname '$$<')' && MONO_IOMAP=drive $$(RESGEN) '$$(shell basename '$$<')' '$$(shell basename '$$@')' emit_resgen_target_2 = $(call q2s,$1) : $(call q2s,$(subst .resources,.resx,$1)); MONO_IOMAP=drive $$(RESGEN) -usesourcepath '$$<' '$$@' emit_resgen_target = $(if $(filter resgen2,$(RESGEN)),$(emit_resgen_target_2),$(emit_resgen_target_1)) emit_resgen_targets = $(foreach res,$(build_resx_resources_esc),$(eval $(call emit_resgen_target,$(res)))) build_references_ref = $(call q2s,$(foreach ref, $(call \ s2q,$(REFERENCES)), $(if $(filter -pkg:%, $(ref)), $(ref), \ $(if $(filter -r:%, $(ref)), $(ref), -r:$(ref))))) $(call \ q2s,$(foreach ref, $(call s2q,$(DLL_REFERENCES)), -r:$(ref))) \ $(call q2s,$(foreach ref, $(call s2q,$(PROJECT_REFERENCES)), \ -r:$(ref))) s2q2s = $(call unesc2,$(call s2q,$1)) cp_actual = test -z $1 || cp $1 $2 cp = $(call cp_actual,'$(call s2q2s,$1)','$(call s2q2s,$2)') rm_actual = test -z '$1' || rm -f '$2' rm = $(call rm_actual,$(call s2q2s,$1),$(call s2q2s,$2)/$(shell basename '$(call s2q2s,$1)')) DISTCLEANFILES = $(GENERATED_FILES) $(pc_files) $(BUILD_DIR)/* assemblyfilesdir = $(pkglibdir) assemblyfiles_DATA = $(ASSEMBLY) bin_SCRIPTS = $(BINARIES) programfilesdir = @libdir@/@PACKAGE@ programfiles_DATA = $(PROGRAMFILES) linuxpkgconfigdir = @libdir@/pkgconfig linuxpkgconfig_DATA = $(LINUX_PKGCONFIG) # generating satellite assemblies culture_resources = $(foreach res, $(RESOURCES_ESC), $(if $(call is_cultured_resource,$(call get_resource_name, $(res))),$(res))) cultures = $(sort $(foreach res, $(culture_resources), $(call get_culture,$(call get_resource_name,$(res))))) culture_resource_dependencies = $(call q2s,$(BUILD_DIR)/$1/$(SATELLITE_ASSEMBLY_NAME): $(subst .resx,.resources,$2)) culture_resource_commandlines = $(call unesc2,cmd_line_satellite_$1 += '/embed:$(subst .resx,.resources,$2)') build_satellite_assembly_list = $(call q2s,$(cultures:%=$(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME))) build_culture_res_files = $(call q2s,$(foreach res, $(culture_resources),$(call get_resource_name,$(res)))) install_satellite_assembly_list = $(subst $(BUILD_DIR),$(DESTDIR)$(libdir)/$(PACKAGE),$(build_satellite_assembly_list)) MONO_SSDP_DLL = $(BUILD_DIR)/Mono.Ssdp.dll MONO_UPNP_PC = $(BUILD_DIR)/mono.upnp.pc all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.include $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Mono.Upnp/Mono.Upnp/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Mono.Upnp/Mono.Upnp/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/Makefile.include: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mono.upnp.pc: $(top_builddir)/config.status $(srcdir)/mono.upnp.pc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) install-assemblyfilesDATA: $(assemblyfiles_DATA) @$(NORMAL_INSTALL) test -z "$(assemblyfilesdir)" || $(MKDIR_P) "$(DESTDIR)$(assemblyfilesdir)" @list='$(assemblyfiles_DATA)'; test -n "$(assemblyfilesdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(assemblyfilesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(assemblyfilesdir)" || exit $$?; \ done uninstall-assemblyfilesDATA: @$(NORMAL_UNINSTALL) @list='$(assemblyfiles_DATA)'; test -n "$(assemblyfilesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(assemblyfilesdir)'; $(am__uninstall_files_from_dir) install-linuxpkgconfigDATA: $(linuxpkgconfig_DATA) @$(NORMAL_INSTALL) test -z "$(linuxpkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(linuxpkgconfigdir)" @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(linuxpkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(linuxpkgconfigdir)" || exit $$?; \ done uninstall-linuxpkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(linuxpkgconfigdir)'; $(am__uninstall_files_from_dir) install-programfilesDATA: $(programfiles_DATA) @$(NORMAL_INSTALL) test -z "$(programfilesdir)" || $(MKDIR_P) "$(DESTDIR)$(programfilesdir)" @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(programfilesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(programfilesdir)" || exit $$?; \ done uninstall-programfilesDATA: @$(NORMAL_UNINSTALL) @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(programfilesdir)'; $(am__uninstall_files_from_dir) tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(assemblyfilesdir)" "$(DESTDIR)$(linuxpkgconfigdir)" "$(DESTDIR)$(programfilesdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-assemblyfilesDATA install-linuxpkgconfigDATA \ install-programfilesDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binSCRIPTS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-assemblyfilesDATA uninstall-binSCRIPTS \ uninstall-linuxpkgconfigDATA uninstall-programfilesDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-assemblyfilesDATA \ install-binSCRIPTS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-linuxpkgconfigDATA install-man install-pdf \ install-pdf-am install-programfilesDATA install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \ uninstall-am uninstall-assemblyfilesDATA uninstall-binSCRIPTS \ uninstall-linuxpkgconfigDATA uninstall-programfilesDATA all: $(ASSEMBLY) $(PROGRAMFILES) $(LINUX_PKGCONFIG) # macros # $(call emit-deploy-target,deploy-variable-name) define emit-deploy-target $($1): $($1_SOURCE) mkdir -p '$$(shell dirname '$$@')' cp '$$<' '$$@' endef # $(call emit-deploy-wrapper,wrapper-variable-name,wrapper-sourcefile,x) # assumes that for a wrapper foo.pc its source template is foo.pc.in # if $3 is non-empty then wrapper is marked exec define emit-deploy-wrapper $($1): $2 mkdir -p '$$(shell dirname '$$@')' cp '$$<' '$$@' $(if $3,chmod +x '$$@') endef $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_dependencies,$(call get_culture,$(call get_resource_name,$(res))),$(call get_resource_name,$(res)))))) $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_commandlines,$(call get_culture,$(call get_resource_name,$(res))),$(res))))) $(build_satellite_assembly_list): $(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME): mkdir -p '$(@D)' $(AL) -out:'$@' -culture:$* -t:lib $(cmd_line_satellite_$*) $(install_satellite_assembly_list): mkdir -p '$(@D)' cp $(subst $(DESTDIR)$(libdir)/$(PACKAGE), $(BUILD_DIR), $@) $@ install-satellite-assemblies: $(install_satellite_assembly_list) uninstall-satellite-assemblies: rm -rf $(install_satellite_assembly_list) $(eval $(call emit-deploy-wrapper,MONO_UPNP_PC,mono.upnp.pc)) $(eval $(call emit_resgen_targets)) $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(ASSEMBLY_MDB): $(ASSEMBLY) $(ASSEMBLY): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(shell dirname $(ASSEMBLY)) $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp/0000775000175000017500000000000011761740036023027 5ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp/TypeInfo.cs0000664000175000017500000001255311707010776025122 0ustar00lorentzlorentz00000000000000// // TypeInfo.cs // // Author: // Scott Thomas // // Copyright (C) 2008 S&S Black Ltd. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; namespace Mono.Upnp { public class TypeInfo { readonly string domain_name; readonly string type; readonly Version version; readonly string kind; internal TypeInfo (string domainName, string type, Version version, string kind) { if (domainName == null) { throw new ArgumentNullException ("domainName"); } else if (type == null) { throw new ArgumentNullException ("type"); } else if (version == null) { throw new ArgumentNullException ("version"); } this.domain_name = domainName; this.type = type; this.version = version; this.kind = kind; } public string DomainName { get { return domain_name; } } public string Type { get { return type; } } public Version Version { get { return version; } } public string ToUrlString () { var version = this.version.Minor == 0 ? this.version.Major.ToString () : string.Format ("{0}.{1}", this.version.Major, this.version.Minor); return string.Format ("{0}/{1}/{2}", domain_name, type, version); } public override string ToString () { var version = this.version.Minor == 0 ? this.version.Major.ToString () : string.Format ("{0}.{1}", this.version.Major, this.version.Minor); return string.Format ("urn:{0}:{1}:{2}:{3}", domain_name, kind, type, version); } public override bool Equals (object obj) { var type_info = obj as TypeInfo; return type_info == this; } public override int GetHashCode () { return domain_name.GetHashCode () ^ type.GetHashCode () ^ version.GetHashCode () ^ kind.GetHashCode (); } public static bool operator == (TypeInfo type1, TypeInfo type2) { if (ReferenceEquals (type1, null)) { return ReferenceEquals (type2, null); } return !ReferenceEquals (type2, null) && type1.domain_name == type2.domain_name && type1.type == type2.type && type1.version == type2.version && type1.kind == type2.kind; } public static bool operator != (TypeInfo type1, TypeInfo type2) { return !(type1 == type2); } internal static void Parse (string typeDescription, out string domainName, out string type, out Version version) { if (typeDescription == null) { throw new ArgumentNullException ("typeDescription"); } var sections = typeDescription.Trim ().Split (':'); if (sections.Length < 5) { throw new UpnpDeserializationException (string.Format ( @"The type description string contained too few components: ""{0}"".", typeDescription)); } var versions = sections[4].Split ('.'); int major; if (!int.TryParse (versions[0], out major)) { throw new UpnpDeserializationException (string.Format ( "The type description version number could not be parsed: {0}.", versions[0])); } if (versions.Length == 1) { version = new Version (major, 0); } else { int minor; if (!int.TryParse (versions[1], out minor)) { throw new UpnpDeserializationException (string.Format ( "The type description minor version number could not be parsed: {0}.", versions[1])); } version = new Version (major, minor); } domainName = sections[1]; type = sections[3]; } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp/Client.cs0000664000175000017500000002443211761734012024576 0ustar00lorentzlorentz00000000000000// // Client.cs // // Author: // Scott Thomas // // Copyright (C) 2008 S&S Black Ltd. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Collections.Generic; using Mono.Ssdp; using Mono.Upnp.Internal; using Mono.Upnp.Xml; namespace Mono.Upnp { public class Client : IDisposable { static WeakReference static_deserializer = new WeakReference (null); readonly Dictionary devices = new Dictionary (); readonly Dictionary services = new Dictionary (); readonly Dictionary descriptions = new Dictionary (); readonly Mono.Ssdp.Client client = new Mono.Ssdp.Client (); DeserializerProducer deserializer_producer; public Client () : this (null) { } public Client (DeserializerProducer deserializerProducer) { DeserializerProducer = deserializerProducer ?? (xmlDeserializer => new Deserializer (xmlDeserializer)); client.ServiceAdded += ClientServiceAdded; client.ServiceRemoved += ClientServiceRemoved; } public DeserializerProducer DeserializerProducer { get { return deserializer_producer; } set { if (value == null) { throw new ArgumentNullException ("value"); } deserializer_producer = value; } } public event EventHandler DeviceAdded; public event EventHandler DeviceRemoved; public event EventHandler ServiceAdded; public event EventHandler ServiceRemoved; public void BrowseRoots () { client.Browse ("upnp:rootdevice"); } public void BrowseAll () { client.BrowseAll (); } public void Browse (TypeInfo type) { client.Browse (type.ToString ()); } void ClientServiceAdded (object sender, Mono.Ssdp.ServiceArgs args) { ClientServiceEvent (args, (device) => { if (!devices.ContainsKey (device)) { OnDeviceAdded (new DeviceEventArgs (device, UpnpOperation.Added)); devices.Add (device, device); } }, (service) => { if (!services.ContainsKey (service)) { OnServiceAdded (new ServiceEventArgs (service, UpnpOperation.Added)); services.Add (service, service); } } ); } void ClientServiceRemoved (object sender, Mono.Ssdp.ServiceArgs args) { ClientServiceEvent (args, (device) => { if (devices.ContainsKey (device)) { device.Dispose (); OnDeviceRemoved (new DeviceEventArgs (device, UpnpOperation.Removed)); devices.Remove (device); } }, (service) => { if (services.ContainsKey (service)) { service.Dispose (); OnServiceRemoved (new ServiceEventArgs (service, UpnpOperation.Removed)); services.Remove (service); } } ); } void ClientServiceEvent (Mono.Ssdp.ServiceArgs args, Action deviceHandler, Action serviceHandler) { if (!args.Usn.StartsWith ("uuid:")) { return; } var colon = args.Usn.IndexOf (':', 5); var usn = colon == -1 ? args.Usn : args.Usn.Substring (0, colon); var suffix = colon == -1 ? args.Usn : args.Usn.Substring (colon + 2); var service_type = args.Service == null ? suffix : args.Service.ServiceType; var locations = args.Service == null ? null : args.Service.Locations; if (args.Usn.Contains (":device:")) { var type = DeviceType.Parse (service_type); var device = new DeviceAnnouncement (this, type, usn, locations); deviceHandler (device); } else if (args.Usn.Contains (":service:")) { var type = ServiceType.Parse (service_type); var service = new ServiceAnnouncement (this, type, usn, locations); serviceHandler (service); } } protected virtual void OnDeviceAdded (DeviceEventArgs e) { OnEvent (DeviceAdded, e); } protected virtual void OnServiceAdded (ServiceEventArgs e) { OnEvent (ServiceAdded, e); } protected virtual void OnDeviceRemoved (DeviceEventArgs e) { OnEvent (DeviceRemoved, e); } protected virtual void OnServiceRemoved (ServiceEventArgs e) { OnEvent (ServiceRemoved, e); } void OnEvent (EventHandler handler, T e) where T : EventArgs { if (handler != null) { handler (this, e); } } internal Service GetService (ServiceAnnouncement announcement) { return GetDescription (announcement.Locations, announcement, GetService); } internal Device GetDevice (DeviceAnnouncement announcement) { return GetDescription (announcement.Locations, announcement, GetDevice); } TResult GetDescription (IEnumerable urls, TAnnouncement announcement, Mono.Upnp.Internal.Func getter) where TResult : class { foreach (var url in urls) { Root root; if (descriptions.TryGetValue (url, out root)) { if (!root.IsDisposed) { var result = getter (announcement, root.RootDevice); if (result != null) { return result; } } } try { var deserializer = Helper.Get (static_deserializer); root = deserializer_producer (deserializer).DeserializeRoot (new Uri (url)); if (root == null) { continue; } descriptions[url] = root; if (root.RootDevice == null) { Log.Error (string.Format ("The description root does not have a root device: {0}.", url)); continue; } var result = getter (announcement, root.RootDevice); if (result == null) { continue; } return result; } catch (Exception e) { Log.Exception (string.Format ("There was a problem fetching the description at {0}.", url), e); } } return null; } Service GetService (ServiceAnnouncement announcement, Device device) { foreach (var description in device.Services) { if (device.Udn == announcement.DeviceUdn && announcement.Type == description.Type) { return description; } } foreach (var childDevice in device.Devices) { var description = GetService (announcement, childDevice); if (description != null) { return description; } } return null; } Device GetDevice (DeviceAnnouncement announcement, Device device) { if (device.Type == announcement.Type && device.Udn == announcement.Udn) { return device; } foreach (var childDevice in device.Devices) { var description = GetDevice (announcement, childDevice); if (description != null) { return description; } } return null; } public void Dispose () { // TODO proper dispose pattern client.Dispose (); } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp/UpnpDeserializationException.cs0000664000175000017500000000314311707010776031230 0ustar00lorentzlorentz00000000000000// // UpnpDeserializationException.cs // // Author: // Scott Thomas // // Copyright (C) 2008 S&S Black Ltd. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; namespace Mono.Upnp { public class UpnpDeserializationException : Exception { public UpnpDeserializationException (string message) : base (message) { } public UpnpDeserializationException (string message, Exception innerException) : base (message, innerException) { } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp/DeserializerProducer.cs0000664000175000017500000000250511707010776027507 0ustar00lorentzlorentz00000000000000// // DeserializerProducer.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using Mono.Upnp.Xml; namespace Mono.Upnp { public delegate Deserializer DeserializerProducer (XmlDeserializer xmlDeserializer); } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp/SpecVersion.cs0000664000175000017500000000331311707010776025617 0ustar00lorentzlorentz00000000000000// // SpecVersion.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using Mono.Upnp.Internal; using Mono.Upnp.Xml; namespace Mono.Upnp { [XmlType ("specVersion")] public class SpecVersion { protected SpecVersion () { } protected internal SpecVersion (int major, int minor) { Major = major; Minor = minor; } [XmlElement ("major")] public virtual int Major { get; protected set; } [XmlElement ("minor")] public virtual int Minor { get; protected set; } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp/Deserializer.cs0000664000175000017500000001620711707010776026007 0ustar00lorentzlorentz00000000000000// // Deserializer.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Net; using System.Xml; using Mono.Upnp.Control; using Mono.Upnp.Internal; using Mono.Upnp.Xml; namespace Mono.Upnp { public class Deserializer { readonly XmlDeserializer deserializer; Root root; public Deserializer (XmlDeserializer xmlDeserializer) { if (xmlDeserializer == null) { throw new ArgumentNullException ("xmlDeserializer"); } this.deserializer = xmlDeserializer; } public XmlDeserializer XmlDeserializer { get { return deserializer; } } public Root Root { get { return root; } } public virtual Root DeserializeRoot (Uri url) { // TODO retry fallback var request = WebRequest.Create (url); using (var response = request.GetResponse ()) { using (var stream = response.GetResponseStream ()) { using (var reader = XmlReader.Create (stream)) { // FIXME this is a workaround for Mono bug 523151 reader.MoveToContent (); return deserializer.Deserialize (reader, context => DeserializeRoot (url, context)); } } } } protected virtual Root DeserializeRoot (Uri url, XmlDeserializationContext context) { root = CreateRoot (url); Deserialize (root, context); return root; } protected virtual Root CreateRoot (Uri url) { return new Root (this, url); } public virtual Device DeserializeDevice (XmlDeserializationContext context) { var device = CreateDevice (); Deserialize (device, context); return device; } protected virtual Device CreateDevice () { return new Device (this); } public virtual Service DeserializeService (XmlDeserializationContext context) { var service = CreateService (); Deserialize (service, context); return service; } protected virtual Service CreateService () { return new Service (this); } public virtual Icon DeserializeIcon (XmlDeserializationContext context) { var icon = CreateIcon (); Deserialize (icon, context); return icon; } protected virtual Icon CreateIcon () { return new Icon (this); } public virtual ServiceAction DeserializeAction (ServiceController controller, XmlDeserializationContext context) { var action = CreateAction (controller); Deserialize (action, context); return action; } protected virtual ServiceAction CreateAction (ServiceController controller) { return new ServiceAction (this, controller); } public virtual Argument DeserializeArgument (XmlDeserializationContext context) { var argument = CreateArgument (); Deserialize (argument, context); return argument; } protected virtual Argument CreateArgument () { return new Argument (); } public virtual StateVariable DeserializeStateVariable (ServiceController controller, XmlDeserializationContext context) { var state_variable = CreateStateVariable (controller); Deserialize (state_variable, context); return state_variable; } protected virtual StateVariable CreateStateVariable (ServiceController controller) { return new StateVariable (controller); } public virtual ServiceController GetServiceController (Service service) { if (service == null) { throw new ArgumentNullException ("service"); } else if (service.ScpdUrl == null) { throw new ArgumentException ("The service has no ScpdUrl", "service"); } // TODO retry fallback var request = WebRequest.Create (service.ScpdUrl); using (var response = request.GetResponse ()) { using (var stream = response.GetResponseStream ()) { using (var reader = XmlReader.Create (stream)) { // FIXME this is a workaround for Mono bug 523151 reader.MoveToContent (); return deserializer.Deserialize (reader, context => DeserializeServiceController (service, context)); } } } } protected virtual ServiceController DeserializeServiceController (Service service, XmlDeserializationContext context) { var service_controller = CreateServiceController (service); Deserialize (service_controller, context); return service_controller; } protected virtual ServiceController CreateServiceController (Service service) { return new ServiceController (this, service); } void Deserialize (IXmlDeserializable deserializable, XmlDeserializationContext context) { if (deserializable != null) { deserializable.Deserialize (context); } } internal bool IsDisposed { get; private set; } internal event EventHandler Disposed; internal void Dispose () { } internal void CheckDisposed () { } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp/Icon.cs0000664000175000017500000001500611744513162024247 0ustar00lorentzlorentz00000000000000// // Icon.cs // // Author: // Scott Thomas // // Copyright (C) 2008 S&S Black Ltd. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.IO; using System.Net; using Mono.Upnp.Internal; using Mono.Upnp.Xml; namespace Mono.Upnp { [XmlType ("icon")] public class Icon : Description, IDisposable { DataServer server; string filename; byte[] data; protected Icon () { } protected internal Icon (Deserializer deserializer) : base (deserializer) { } public Icon (int width, int height, int depth, string mimetype, byte[] data) : this (width, height, depth, mimetype) { if (data == null) { throw new ArgumentNullException ("data"); } this.data = data; } public Icon (int width, int height, int depth, string format, string filename) : this (width, height, depth, format) { if (filename == null) { throw new ArgumentNullException ("filename"); } this.filename = filename; } protected Icon (int width, int height, int depth, string mimetype) { if (mimetype == null) { throw new ArgumentNullException ("mimetype"); } Width = width; Height = height; Depth = depth; MimeType = mimetype; } [XmlElement ("url")] protected virtual string UrlFragment { get; set; } public virtual Uri Url { get { return ExpandUrl (UrlFragment); } } [XmlElement ("mimetype")] public virtual string MimeType { get; protected set; } [XmlElement ("width")] public virtual int Width { get; protected set; } [XmlElement ("height")] public virtual int Height { get; protected set; } [XmlElement ("depth")] public virtual int Depth { get; protected set; } protected internal virtual void Initialize (Root root, string iconUrlFragment) { if (iconUrlFragment == null) { throw new ArgumentNullException ("iconUrlFragment"); } Initialize (root); UrlFragment = iconUrlFragment; server = new DataServer (Data, MimeType, Url); } protected internal virtual void Start () { if (server == null) { throw new InvalidOperationException ("The icon has not been initialized"); } server.Start (); } protected internal virtual void Stop () { if (server == null) { throw new InvalidOperationException ("The icon has not been initialized"); } server.Stop (); } public virtual byte[] GetData () { if (data == null) { try { var request = (HttpWebRequest)WebRequest.Create (Url); using (var response = Helper.GetResponse (request)) { var ms = new MemoryStream (); long bytes_read = 0; using (var stream = response.GetResponseStream ()) { byte [] buffer = new byte[8192]; int chunk_bytes_read = 0; while ((chunk_bytes_read = stream.Read (buffer, 0, buffer.Length)) > 0) { ms.Write (buffer, 0, chunk_bytes_read); bytes_read += chunk_bytes_read; } } data = ms.ToArray (); } } catch (WebException e) { if (e.Status == WebExceptionStatus.Timeout) { Deserializer.CheckDisposed (); } throw e; } } var copy = new byte [data.Length]; Array.Copy (data, copy, data.Length); return copy; } protected internal virtual byte[] Data { get { if (data == null && File.Exists (filename)) { data = File.ReadAllBytes (filename); } return data; } } protected override void DeserializeElement (XmlDeserializationContext context) { AutoDeserializeElement (this, context); } protected override void Serialize (XmlSerializationContext context) { AutoSerialize (this, context); } protected override void SerializeMembers (XmlSerializationContext context) { AutoSerializeMembers (this, context); } public override string ToString () { return string.Format ("Icon {{ {0}, {1}x{2}x{3}, {4} }}", MimeType, Width, Height, Depth, Url); } void IDisposable.Dispose () { // TODO proper dispose pattern server.Dispose (); } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp/ServiceType.cs0000664000175000017500000000337211707010776025626 0ustar00lorentzlorentz00000000000000// // ServiceType.cs // // Author: // Scott Thomas // // Copyright (C) 2008 S&S Black Ltd. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; namespace Mono.Upnp { public sealed class ServiceType : TypeInfo { public ServiceType (string domainName, string type, Version version) : base (domainName, type, version, "service") { } public static ServiceType Parse (string serviceType) { string domainName, type; Version version; Parse (serviceType, out domainName, out type, out version); return new ServiceType (domainName, type, version); } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp/DisposedEventArgs.cs0000664000175000017500000000262511707010776026755 0ustar00lorentzlorentz00000000000000// // DisposedEventArgs.cs // // Author: // Scott Thomas // // Copyright (C) 2009 S&S Black Ltd. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; namespace Mono.Upnp { public class DisposedEventArgs : EventArgs { public readonly static new DisposedEventArgs Empty = new DisposedEventArgs (); } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp/UpnpEventArgs.cs0000664000175000017500000000455211707010776026126 0ustar00lorentzlorentz00000000000000// // UpnpEventArgs.cs // // Author: // Scott Thomas // // Copyright (C) 2008 S&S Black Ltd. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; namespace Mono.Upnp { public enum UpnpOperation { Added, Removed } public class DeviceEventArgs : EventArgs { readonly DeviceAnnouncement device; readonly UpnpOperation operation; internal DeviceEventArgs (DeviceAnnouncement device, UpnpOperation operation) { this.device = device; this.operation = operation; } public DeviceAnnouncement Device { get { return device; } } public UpnpOperation Operation { get { return operation; } } } public class ServiceEventArgs : EventArgs { readonly ServiceAnnouncement service; readonly UpnpOperation operation; public ServiceEventArgs (ServiceAnnouncement service, UpnpOperation operation) { this.service = service; this.operation = operation; } public ServiceAnnouncement Service { get { return service; } } public UpnpOperation Operation { get { return operation; } } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp/Server.cs0000664000175000017500000001206611707010776024632 0ustar00lorentzlorentz00000000000000// // Server.cs // // Author: // Scott Thomas // // Copyright (C) 2008 S&S Black Ltd. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Collections.Generic; using System.Net; using System.Net.Sockets; using System.Xml; using Mono.Upnp.Internal; using Mono.Upnp.Xml; using SsdpServer = Mono.Ssdp.Server; namespace Mono.Upnp { public class Server : IDisposable { static readonly WeakReference static_serializer = new WeakReference (null); readonly DataServer description_server; readonly SsdpServer ssdp_server; Root root; public Server (Root root) : this (root, null) { } public Server (Root root, Uri url) { if (root == null) { throw new ArgumentNullException ("root"); } this.root = root; if (url == null) { url = MakeUrl (); } var serializer = Helper.Get (static_serializer); root.Initialize (serializer, url); // FIXME this is a test description_server = new DataServer (serializer.GetBytes (root), @"text/xml", url); ssdp_server = new SsdpServer (url.ToString ()); ssdp_server.Announce ("upnp:rootdevice", root.RootDevice.Udn + "::upnp:rootdevice", false); AnnounceDevice (root.RootDevice); } public bool Started { get; private set; } public void Start () { CheckDisposed (); if (Started) { return; } root.Start (); description_server.Start (); ssdp_server.Start (); Started = true; } public void Stop () { CheckDisposed (); if (!Started) { return; } ssdp_server.Stop (); root.Stop (); description_server.Stop (); Started = false; } void AnnounceDevice (Device device) { ssdp_server.Announce (device.Udn, device.Udn, false); ssdp_server.Announce (device.Type.ToString (), string.Format ("{0}::{1}", device.Udn, device.Type), false); foreach (var child_device in device.Devices) { AnnounceDevice (child_device); } foreach (var service in device.Services) { AnnounceService (device, service); } } void AnnounceService (Device device, Service service) { ssdp_server.Announce (service.Type.ToString (), string.Format ("{0}::{1}", device.Udn,service.Type), false); } static readonly Random random = new Random (); readonly int port = random.Next (1024, 5000); Uri MakeUrl () { // FIXME configure the network interface foreach (var address in Dns.GetHostAddresses (Dns.GetHostName ())) { if (address.AddressFamily == AddressFamily.InterNetwork) { return new Uri (String.Format ("http://{0}:{1}/upnp/", address, port)); } } return null; } public bool IsDisposed { get { return root == null; } } void CheckDisposed () { if (IsDisposed) { throw new ObjectDisposedException (ToString ()); } } public void Dispose () { Dispose (true); GC.SuppressFinalize (this); } protected virtual void Dispose (bool disposing) { if (IsDisposed) { return; } if (disposing) { Stop (); root.Dispose (); description_server.Dispose (); ssdp_server.Dispose (); } root = null; } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp/DeviceType.cs0000664000175000017500000000336211707010776025424 0ustar00lorentzlorentz00000000000000// // DeviceType.cs // // Author: // Scott Thomas // // Copyright (C) 2008 S&S Black Ltd. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; namespace Mono.Upnp { public sealed class DeviceType : TypeInfo { public DeviceType (string domainName, string type, Version version) : base (domainName, type, version, "device") { } public static DeviceType Parse (string deviceType) { string domainName, type; Version version; Parse (deviceType, out domainName, out type, out version); return new DeviceType (domainName, type, version); } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp/DeviceOptions.cs0000664000175000017500000000336511707010776026141 0ustar00lorentzlorentz00000000000000// // DeviceOptions.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; namespace Mono.Upnp { public class DeviceOptions { public IEnumerable EmbeddedDevices { get; set; } public IEnumerable Services { get; set; } public IEnumerable Icons { get; set; } public Uri ManufacturerUrl { get; set; } public string ModelDescription { get; set; } public string ModelNumber { get; set; } public Uri ModelUrl { get; set; } public string SerialNumber { get; set; } public string Upc { get; set; } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp/Description.cs0000664000175000017500000000642711707010776025653 0ustar00lorentzlorentz00000000000000// // Description.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using Mono.Upnp.Xml; namespace Mono.Upnp { public abstract class Description : XmlAutomatable { readonly Deserializer deserializer; bool is_disposed; internal Description () { } internal Description (Deserializer deserializer) { if (deserializer == null) { throw new ArgumentNullException ("deserializer"); } this.deserializer = deserializer; Root = deserializer.Root; } internal Deserializer Deserializer { get { return deserializer; } } internal Root Root { get; private set; } internal void Initialize (Root root) { Root = root; } public bool IsDisposed { get { return deserializer != null ? deserializer.IsDisposed : is_disposed; } } internal virtual void Dispose () { is_disposed = true; } event EventHandler disposed; public event EventHandler Disposed { add { if (deserializer != null) { deserializer.Disposed += value; } else { disposed += value; } } remove { if (deserializer != null) { deserializer.Disposed -= value; } else { disposed -= value; } } } internal Uri ExpandUrl (string urlFragment) { Uri url; if (Root != null && Uri.TryCreate (Root.UrlBase, urlFragment, out url)) { return url; } else if (Uri.TryCreate (urlFragment, UriKind.Absolute, out url)) { return url; } else { throw new UpnpDeserializationException ( string.Format(@"The URL fragment is not valid: ""{0}""", urlFragment)); } } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp/Root.cs0000664000175000017500000001075011707010776024305 0ustar00lorentzlorentz00000000000000// // Root.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using Mono.Upnp.Control; using Mono.Upnp.Internal; using Mono.Upnp.Xml; namespace Mono.Upnp { [XmlType ("root", Protocol.DeviceSchema)] public class Root : Description, IXmlDeserializer { protected Root () { } protected internal Root (Deserializer deserializer, Uri url) : base (deserializer) { if (url == null) { throw new ArgumentNullException ("url"); } UrlBase = url; } public Root (DeviceType type, string udn, string friendlyName, string manufacturer, string modelName) : this (type, udn, friendlyName, manufacturer, modelName, null) { } public Root (DeviceType type, string udn, string friendlyName, string manufacturer, string modelName, DeviceOptions options) { // The device knows how to handle embedded devices itself so don't pass them in RootDevice = new Device(type, udn, friendlyName, manufacturer, modelName, options, null); SpecVersion = new SpecVersion (1, 1); } [XmlAttribute ("configId")] public virtual string ConfigurationId { get; protected set; } [XmlElement ("specVersion")] public virtual SpecVersion SpecVersion { get; protected set; } [DoNotSerialize] [XmlElement ("URLBase")] public virtual Uri UrlBase { get; protected set; } [XmlElement ("device")] public virtual Device RootDevice { get; protected set; } protected internal virtual void Initialize (XmlSerializer serializer, Uri url) { UrlBase = url; if (RootDevice != null) { RootDevice.Initialize (serializer, this, ""); } } protected internal virtual void Start () { if (RootDevice != null) { RootDevice.Start (); } } protected internal virtual void Stop () { if (RootDevice != null) { RootDevice.Stop (); } } Device IXmlDeserializer.Deserialize (XmlDeserializationContext context) { return DeserializeDevice (context); } protected virtual Device DeserializeDevice (XmlDeserializationContext context) { return Deserializer != null ? Deserializer.DeserializeDevice (context) : null; } protected override void DeserializeAttribute (XmlDeserializationContext context) { AutoDeserializeAttribute (this, context); } protected override void DeserializeElement (XmlDeserializationContext context) { AutoDeserializeElement (this, context); } protected override void Serialize (XmlSerializationContext context) { AutoSerialize (this, context); } protected override void SerializeMembers (XmlSerializationContext context) { AutoSerializeMembers (this, context); } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp/Device.cs0000664000175000017500000002634111707010776024564 0ustar00lorentzlorentz00000000000000// // Device.cs // // Author: // Scott Thomas // // Copyright (C) 2009 S&S Black Ltd. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Collections.Generic; using System.Collections.ObjectModel; using Mono.Upnp.Internal; using Mono.Upnp.Xml; namespace Mono.Upnp { [XmlType ("device")] public class Device : Description, IXmlDeserializable, IXmlDeserializer, IXmlDeserializer, IXmlDeserializer, IXmlDeserializer { public Device (DeviceType type, string udn, string friendlyName, string manufacturer, string modelName) : this (type, udn, friendlyName, manufacturer, modelName, null) { } public Device (DeviceType type, string udn, string friendlyName, string manufacturer, string modelName, DeviceOptions options) : this (type, udn, friendlyName, manufacturer, modelName, options, null) { } protected internal Device (DeviceType type, string udn, string friendlyName, string manufacturer, string modelName, DeviceOptions options, IEnumerable devices) : this (Helper.Flatten(devices, options != null ? options.EmbeddedDevices : null), GetServices (options), GetIcons (options)) { if (type == null) { throw new ArgumentNullException ("type"); } else if (udn == null) { throw new ArgumentNullException ("udn"); } else if (!udn.StartsWith ("uuid:")) { throw new ArgumentException (@"The udn must begin with ""uuid:"".", "udn"); } else if (friendlyName == null) { throw new ArgumentNullException ("friendlyName"); } else if (manufacturer == null) { throw new ArgumentException ("manufacturer"); } else if (modelName == null) { throw new ArgumentNullException ("modelName"); } Type = type; Udn = udn; FriendlyName = friendlyName; Manufacturer = manufacturer; ModelName = modelName; if (options != null) { ManufacturerUrl = options.ManufacturerUrl; ModelDescription = options.ModelDescription; ModelNumber = options.ModelNumber; ModelUrl = options.ModelUrl; SerialNumber = options.SerialNumber; Upc = options.Upc; } } protected internal Device (IEnumerable devices, IEnumerable services, IEnumerable icons) { Devices = Helper.MakeReadOnlyCopy (devices); Services = Helper.MakeReadOnlyCopy (services); Icons = Helper.MakeReadOnlyCopy (icons); } protected internal Device (Deserializer deserializer) : base (deserializer) { Devices = new List (); Services = new List (); Icons = new List (); } static IEnumerable GetServices (DeviceOptions options) { return options == null ? null : options.Services; } static IEnumerable GetIcons (DeviceOptions options) { return options == null ? null : options.Icons; } [XmlElement ("deviceType")] public virtual DeviceType Type { get; protected set; } [XmlElement ("friendlyName")] public virtual string FriendlyName { get; protected set; } [XmlElement ("manufacturer")] public virtual string Manufacturer { get; protected set; } [XmlElement ("manufacturerURL", OmitIfNull = true)] public virtual Uri ManufacturerUrl { get; protected set; } [XmlElement ("modelDescription", OmitIfNull = true)] public virtual string ModelDescription { get; protected set; } [XmlElement ("modelName")] public virtual string ModelName { get; protected set; } [XmlElement ("modelNumber", OmitIfNull = true)] public virtual string ModelNumber { get; protected set; } [XmlElement ("modelURL", OmitIfNull = true)] public virtual Uri ModelUrl { get; protected set; } [XmlElement ("serialNumber", OmitIfNull = true)] public virtual string SerialNumber { get; protected set; } [XmlElement ("UDN")] public virtual string Udn { get; protected set; } [XmlElement ("UPC", OmitIfNull = true)] public virtual string Upc { get; protected set; } [XmlArray ("iconList", OmitIfEmpty = true)] public virtual IList Icons { get; private set; } [XmlArray ("serviceList", OmitIfEmpty = true)] public virtual IList Services { get; private set; } [XmlArray ("deviceList", OmitIfEmpty = true)] public virtual IList Devices { get; private set; } protected internal virtual void Initialize (XmlSerializer serializer, Root root, string deviceUrlFragment) { if (deviceUrlFragment == null) { throw new ArgumentNullException ("deviceUrlFragment"); } else if (Deserializer != null) { throw new InvalidOperationException ( "The device was constructed for deserialization and cannot be initalized." + "Use one of the other constructors."); } for (var i = 0; i < Devices.Count; i++) { Devices[i].Initialize (serializer, root, string.Concat (deviceUrlFragment, "/device/", i.ToString ())); } for (var i = 0; i < Services.Count; i++) { Services[i].Initialize (serializer, root, string.Concat ( deviceUrlFragment, "/service/", i.ToString ())); } for (var i = 0; i < Icons.Count; i++) { Icons[i].Initialize (root, string.Concat (deviceUrlFragment, "/icon/", i.ToString (), "/")); } } protected internal virtual void Start () { foreach (var device in Devices) { device.Start (); } foreach (var service in Services) { service.Start (); } foreach (var icon in Icons) { icon.Start (); } } protected internal virtual void Stop () { foreach (var device in Devices) { device.Stop (); } foreach (var service in Services) { service.Stop (); } foreach (var icon in Icons) { icon.Stop (); } } DeviceType IXmlDeserializer.Deserialize (XmlDeserializationContext context) { return DeserializeDeviceType (context); } protected virtual DeviceType DeserializeDeviceType (XmlDeserializationContext context) { if (context == null) { throw new ArgumentNullException ("context"); } return DeviceType.Parse (context.Reader.ReadElementContentAsString ()); } Device IXmlDeserializer.Deserialize (XmlDeserializationContext context) { return DeserializeDevice (context); } protected virtual Device DeserializeDevice (XmlDeserializationContext context) { return Deserializer != null ? Deserializer.DeserializeDevice (context) : null; } Service IXmlDeserializer.Deserialize (XmlDeserializationContext context) { return DeserializeService (context); } protected virtual Service DeserializeService (XmlDeserializationContext context) { return Deserializer != null ? Deserializer.DeserializeService (context) : null; } Icon IXmlDeserializer.Deserialize (XmlDeserializationContext context) { return DeserializeIcon (context); } protected virtual Icon DeserializeIcon (XmlDeserializationContext context) { return Deserializer != null ? Deserializer.DeserializeIcon (context) : null; } void IXmlDeserializable.Deserialize (XmlDeserializationContext context) { Deserialize (context); Devices = new ReadOnlyCollection (Devices); Services = new ReadOnlyCollection (Services); Icons = new ReadOnlyCollection (Icons); } void IXmlDeserializable.DeserializeAttribute (XmlDeserializationContext context) { DeserializeAttribute (context); } void IXmlDeserializable.DeserializeElement (XmlDeserializationContext context) { DeserializeElement (context); } protected override void DeserializeElement (XmlDeserializationContext context) { AutoDeserializeElement (this, context); } protected override void Serialize (XmlSerializationContext context) { AutoSerialize (this, context); } protected override void SerializeMembers (XmlSerializationContext context) { AutoSerializeMembers (this, context); } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp/Service.cs0000664000175000017500000001431611707010776024764 0ustar00lorentzlorentz00000000000000// // Service.cs // // Author: // Scott Thomas // // Copyright (C) 2008 S&S Black Ltd. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using Mono.Upnp.Control; using Mono.Upnp.Internal; using Mono.Upnp.Xml; namespace Mono.Upnp { public class Service : Service { protected Service (T service) : this (null, null, service) { } public Service (ServiceType type, string id, T service) : base (type, id, ServiceControllerBuilder.Build (service)) { } } [XmlType ("service")] public class Service : Description, IXmlDeserializer { ServiceController controller; protected internal Service (Deserializer deserializer) : base (deserializer) { } protected Service (ServiceController controller) : this (null, null, controller) { } public Service (ServiceType type, string id, ServiceController controller) { if (controller == null) { throw new ArgumentNullException ("controller"); } this.controller = controller; Type = type; Id = id; } [XmlElement ("serviceType")] public virtual ServiceType Type { get; protected set; } [XmlElement ("serviceId")] public virtual string Id { get; protected set; } [XmlElement ("SCPDURL")] protected virtual string ScpdUrlFragment { get; set; } public virtual Uri ScpdUrl { get { return ExpandUrl (ScpdUrlFragment); } } [XmlElement ("controlURL")] protected virtual string ControlUrlFragment { get; set; } public virtual Uri ControlUrl { get { return ExpandUrl (ControlUrlFragment); } } [XmlElement ("eventSubURL")] protected virtual string EventUrlFragment { get; set; } public virtual Uri EventUrl { get { return ExpandUrl (EventUrlFragment); } } protected internal virtual void Initialize (XmlSerializer serializer, Root root, string serviceUrlFragment) { Initialize (root); if (serviceUrlFragment == null) { throw new ArgumentNullException ("serviceUrlFragment"); } else if (controller == null) { throw new InvalidOperationException ( "The service was created for deserialization and cannot be initialized."); } ScpdUrlFragment = serviceUrlFragment + "/scpd/"; ControlUrlFragment = serviceUrlFragment + "/control/"; EventUrlFragment = serviceUrlFragment + "/event/"; controller.Initialize (serializer, this); } protected internal virtual void Start () { if (controller == null) { throw new InvalidOperationException ( "The service was created for deserialization and cannot be started."); } controller.Start (); } protected internal virtual void Stop () { if (controller == null) { throw new InvalidOperationException ( "The service was created for deserialization and cannot be stopped."); } controller.Stop (); } public ServiceController GetController () { if (controller == null) { if (IsDisposed) { throw new ObjectDisposedException (ToString (), "The service has gone off the network."); } controller = Deserializer.GetServiceController (this); } return controller; } ServiceType IXmlDeserializer.Deserialize (XmlDeserializationContext context) { return DeserializeServiceType (context); } protected virtual ServiceType DeserializeServiceType (XmlDeserializationContext context) { if (context == null) { throw new ArgumentNullException ("context"); } return ServiceType.Parse (context.Reader.ReadElementContentAsString ()); } protected override void DeserializeElement (XmlDeserializationContext context) { AutoDeserializeElement (this, context); } protected override void Serialize (XmlSerializationContext context) { AutoSerialize (this, context); } protected override void SerializeMembers (XmlSerializationContext context) { AutoSerializeMembers (this, context); } public override string ToString () { return string.Format ("ServiceDescription {{ {0}, {1} }}", Id, Type); } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp/ServiceAnnouncement.cs0000664000175000017500000000723111707010776027335 0ustar00lorentzlorentz00000000000000// // ServiceAnnouncement.cs // // Author: // Scott Thomas // // Copyright (C) 2008 S&S Black Ltd. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Collections.Generic; namespace Mono.Upnp { public sealed class ServiceAnnouncement { readonly Client client; readonly ServiceType type; readonly string deviceUdn; readonly IEnumerable locations; Service service; internal ServiceAnnouncement (Client client, ServiceType type, string deviceUdn, IEnumerable locations) { this.client = client; this.type = type; this.deviceUdn = deviceUdn; this.locations = locations; } public event EventHandler Disposed; public bool IsDisposed { get; private set; } public ServiceType Type { get { return type; } } public string DeviceUdn { get { return deviceUdn; } } public IEnumerable Locations { get { return locations; } } public Service GetService () { if (service == null) { if (IsDisposed) { throw new ObjectDisposedException (ToString (), "The services has gone off the network."); } service = client.GetService (this); } return service; } internal void Dispose () { if (IsDisposed) { return; } IsDisposed = true; OnDispose (DisposedEventArgs.Empty); if (service != null) { service.Deserializer.Dispose (); service = null; } } void OnDispose (DisposedEventArgs e) { var handler = Disposed; if (handler != null) { handler (this, e); } } public override bool Equals (object obj) { var announcement = obj as ServiceAnnouncement; return announcement != null && announcement.type == type && announcement.deviceUdn == deviceUdn; } public override int GetHashCode () { return type.GetHashCode () ^ deviceUdn.GetHashCode (); } public override string ToString () { return string.Format ("ServiceAnnouncement {{ uuid:{0}::{1} }}", deviceUdn, type); } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp/UpnpException.cs0000664000175000017500000000304711707010776026164 0ustar00lorentzlorentz00000000000000// // UpnpException.cs // // Author: // Scott Thomas // // Copyright (C) 2008 S&S Black Ltd. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; namespace Mono.Upnp { public class UpnpException : Exception { public UpnpException (string message) : base (message) { } public UpnpException (string message, Exception innerException) : base (message, innerException) { } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp/DeviceAnnouncement.cs0000664000175000017500000000711111707010776027131 0ustar00lorentzlorentz00000000000000// // DeviceAnnouncement.cs // // Author: // Scott Thomas // // Copyright (C) 2008 S&S Black Ltd. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Collections.Generic; namespace Mono.Upnp { public sealed class DeviceAnnouncement { readonly Client client; readonly DeviceType type; readonly string udn; readonly IEnumerable locations; Device device; internal DeviceAnnouncement (Client client, DeviceType type, string udn, IEnumerable locations) { this.client = client; this.type = type; this.udn = udn; this.locations = locations; } public event EventHandler Disposed; public bool IsDisposed { get; private set; } public DeviceType Type { get { return type; } } public string Udn { get { return udn; } } public IEnumerable Locations { get { return locations; } } public Device GetDevice () { if (device == null) { if (IsDisposed) { throw new ObjectDisposedException (ToString (), "The device has gone off the network."); } device = client.GetDevice (this); } return device; } internal void Dispose () { if (IsDisposed) { return; } IsDisposed = true; OnDispose (DisposedEventArgs.Empty); if (device != null) { device.Deserializer.Dispose (); device = null; } } void OnDispose (DisposedEventArgs e) { var handler = Disposed; if (handler != null) { handler (this, e); } } public override bool Equals (object obj) { var announcement = obj as DeviceAnnouncement; return announcement != null && announcement.type == type && announcement.udn == udn; } public override int GetHashCode () { return type.GetHashCode () ^ udn.GetHashCode (); } public override string ToString () { return string.Format ("DeviceAnnouncement {{ uuid:{0}::{1} }}", udn, type); } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Control/0000775000175000017500000000000011761740036024446 5ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Control/StateVariableEventer.cs0000664000175000017500000000322111707010776031053 0ustar00lorentzlorentz00000000000000// // StateVariableEventer.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; namespace Mono.Upnp.Control { public class StateVariableEventer { internal event EventHandler> StateVariableUpdated; protected virtual void OnStateVariableUpdated (string newValue) { var handler = StateVariableUpdated; if (handler != null) { handler (this, new StateVariableChangedArgs (newValue)); } } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Control/UpnpStateVariableAttribute.cs0000664000175000017500000000362111707010776032255 0ustar00lorentzlorentz00000000000000// // UpnpStateVariableAttribute.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; namespace Mono.Upnp.Control { [AttributeUsage (AttributeTargets.Event)] public class UpnpStateVariableAttribute : Attribute { public UpnpStateVariableAttribute () { } public UpnpStateVariableAttribute (string name) : this (name, null) { } public UpnpStateVariableAttribute (string name, string dataType) { Name = name; DataType = dataType; } public string Name { get; set; } public string DataType { get; set; } public bool IsMulticast { get; set; } public string OmitUnless { get; set; } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Control/UpnpError.cs0000664000175000017500000001720411707010776026736 0ustar00lorentzlorentz00000000000000// // UpnpError.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using Mono.Upnp.Internal; using Mono.Upnp.Xml; namespace Mono.Upnp.Control { [XmlType ("UPnPError", Protocol.ControlSchema)] public class UpnpError { protected internal UpnpError () { } public UpnpError (int errorCode, string errorDescription) { ErrorCode = errorCode; ErrorDescription = errorDescription; } public override string ToString () { return string.Format("{0}: {1}", ErrorCode, ErrorDescription); } [XmlElement ("errorCode", Protocol.ControlSchema)] public int ErrorCode { get; protected set; } [XmlElement ("errorDescription", Protocol.ControlSchema, OmitIfNull = true )] public string ErrorDescription { get; protected set; } public static UpnpError Unknown () { return Unknown (null); } public static UpnpError Unknown (string message) { return new UpnpError (0, Helper.MakeErrorDescription ("Unknown", message)); } public static UpnpError InvalidAction () { return InvalidAction (null); } public static UpnpError InvalidAction (string message) { return new UpnpError (401, Helper.MakeErrorDescription ("Invalid Action", message)); } public static UpnpError InvalidArgs () { return InvalidArgs (null); } public static UpnpError InvalidArgs (string message) { return new UpnpError (402, Helper.MakeErrorDescription ("Invalid Args", message)); } public static UpnpError InvalidVar () { return InvalidVar (null); } public static UpnpError InvalidVar (string message) { return new UpnpError (404, Helper.MakeErrorDescription ("Invalid Var", message)); } public static UpnpError ActionFailed () { return ActionFailed (null); } public static UpnpError ActionFailed (string message) { return new UpnpError (501, Helper.MakeErrorDescription ("Action Failed", message)); } public static UpnpError ArgumentValueInvalid () { return ArgumentValueInvalid (null); } public static UpnpError ArgumentValueInvalid (string message) { return new UpnpError (600, Helper.MakeErrorDescription ("Argument Value Invalid", message)); } public static UpnpError ArgumentValueOutOfRange () { return ArgumentValueOutOfRange (null); } public static UpnpError ArgumentValueOutOfRange (string message) { return new UpnpError (601, Helper.MakeErrorDescription ("Argument Value Out Of Range", message)); } public static UpnpError OptionalActionNotImplemented () { return OptionalActionNotImplemented (null); } public static UpnpError OptionalActionNotImplemented (string message) { return new UpnpError (602, Helper.MakeErrorDescription ("Optional Action Not Implemented", message)); } public static UpnpError OutOfMemory () { return OutOfMemory (null); } public static UpnpError OutOfMemory (string message) { return new UpnpError (603, Helper.MakeErrorDescription ("Out Of Memory", message)); } public static UpnpError HumanInterventionRequired () { return HumanInterventionRequired (null); } public static UpnpError HumanInterventionRequired (string message) { return new UpnpError (604, Helper.MakeErrorDescription ("Human Intervention Required", message)); } public static UpnpError StringArgumentTooLong () { return StringArgumentTooLong (null); } public static UpnpError StringArgumentTooLong (string message) { return new UpnpError (605, Helper.MakeErrorDescription ("String Argument Too Long", message)); } public static UpnpError ActionNotAuthorized () { return ActionNotAuthorized (null); } public static UpnpError ActionNotAuthorized (string message) { return new UpnpError (606, Helper.MakeErrorDescription ("Action Not Authorized", message)); } public static UpnpError SignatureFailure () { return SignatureFailure (null); } public static UpnpError SignatureFailure (string message) { return new UpnpError (607, Helper.MakeErrorDescription ("Signature Failure", message)); } public static UpnpError SignatureMissing () { return SignatureMissing (null); } public static UpnpError SignatureMissing (string message) { return new UpnpError (608, Helper.MakeErrorDescription ("Signature Missing", message)); } public static UpnpError NotEncrypted () { return NotEncrypted (null); } public static UpnpError NotEncrypted (string message) { return new UpnpError (609, Helper.MakeErrorDescription ("Not Encrypted", message)); } public static UpnpError InvalidSequence () { return InvalidSequence (null); } public static UpnpError InvalidSequence (string message) { return new UpnpError (610, Helper.MakeErrorDescription ("Invalid Sequence", message)); } public static UpnpError InvalidControlUrl () { return InvalidControlUrl (null); } public static UpnpError InvalidControlUrl (string message) { return new UpnpError (611, Helper.MakeErrorDescription ("Invalid Control URL", message)); } public static UpnpError NoSuchSession () { return NoSuchSession (null); } public static UpnpError NoSuchSession (string message) { return new UpnpError (612, Helper.MakeErrorDescription ("No Such Session", message)); } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Control/ServiceActionExecutor.cs0000664000175000017500000000256011707010776031256 0ustar00lorentzlorentz00000000000000// // ServiceActionExecutor.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System.Collections.Generic; namespace Mono.Upnp.Control { public delegate IDictionary ServiceActionExecutor (IDictionary arguments); } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Control/ServiceController.cs0000664000175000017500000002232311744512222030436 0ustar00lorentzlorentz00000000000000// // ServiceController.cs // // Author: // Scott Thomas // // Copyright (C) 2008 S&S Black Ltd. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Collections.Generic; using Mono.Upnp.Internal; using Mono.Upnp.Xml; namespace Mono.Upnp.Control { [XmlType ("scpd", Protocol.ServiceSchema)] public class ServiceController : Description, IXmlDeserializable, IXmlDeserializer, IXmlDeserializer { DataServer scpd_server; ControlServer control_server; ControlClient control_client; EventServer event_server; EventClient event_client; CollectionMap actions; CollectionMap state_variables; protected internal ServiceController (Deserializer deserializer, Service service) : base (deserializer) { if (service == null) { throw new ArgumentNullException ("service"); } else if (service.ControlUrl == null) { throw new ArgumentException ("The service has no ControlUrl.", "service"); } else if (service.EventUrl == null) { throw new ArgumentException ("The service has no EventUrl.", "service"); } actions = new CollectionMap (); state_variables = new CollectionMap (); control_client = new ControlClient ( service.Type.ToString (), service.ControlUrl, deserializer.XmlDeserializer); event_client = new EventClient (state_variables, service.EventUrl); } public ServiceController (IEnumerable actions, IEnumerable stateVariables) { this.actions = Helper.MakeReadOnlyCopy (actions); this.state_variables = Helper.MakeReadOnlyCopy (stateVariables); SpecVersion = new SpecVersion (1, 1); } [XmlAttribute ("configId")] protected internal virtual string ConfigurationId { get; set; } [XmlElement ("specVersion")] public virtual SpecVersion SpecVersion { get; protected set; } [XmlArray ("actionList")] protected virtual ICollection ActionCollection { get { return actions; } } public IMap Actions { get { return actions; } } [XmlArray ("serviceStateTable")] protected virtual ICollection StateVariableCollection { get { return state_variables; } } public IMap StateVariables { get { return state_variables; } } protected internal virtual void Initialize (XmlSerializer serializer, Service service) { if (serializer == null) { throw new ArgumentNullException ("serializer"); } else if (service == null) { throw new ArgumentNullException ("service"); } else if (service.ScpdUrl == null) { throw new ArgumentException ("The service has no ScpdUrl.", "service"); } else if (service.ControlUrl == null) { throw new ArgumentException ("The service has no ControlUrl.", "service"); } else if (service.EventUrl == null) { throw new ArgumentException ("The service has no EventUrl.", "service"); } scpd_server = new DataServer (serializer.GetBytes (this), @"text/xml; charset=""utf-8""", service.ScpdUrl); control_server = new ControlServer (actions, service.Type.ToString (), service.ControlUrl, serializer); event_server = new EventServer (state_variables.Values, service.EventUrl); foreach (var state_variable in state_variables.Values) { state_variable.Initialize (this); } } protected internal virtual void Start () { if (scpd_server == null) { throw new InvalidOperationException ("The service controller has not been initialized."); } scpd_server.Start (); control_server.Start (); event_server.Start (); } protected internal virtual void Stop () { if (scpd_server == null) { throw new InvalidOperationException ("The service controller has not been initialized."); } scpd_server.Stop (); control_server.Stop (); event_server.Stop (); } protected internal virtual IMap Invoke (ServiceAction action, IDictionary arguments, int retryAttempts) { // TODO try dispose on timeout if (control_client == null) { throw new InvalidOperationException ( "The service controller was created to describe a local service and cannot be invoked " + "across the network. Use the constructor which takes a Deserializer."); } while (true) { try { return control_client.Invoke (action.Name, arguments); } catch (UpnpControlException) { if (retryAttempts > 0) { retryAttempts--; System.Threading.Thread.Sleep (5000); } else { throw; } } } } internal void RefEvents () { event_client.Ref (); } internal void UnrefEvents () { event_client.Unref (); } internal void UpdateStateVariable (StateVariable stateVariable) { event_server.QueueUpdate (stateVariable); } ServiceAction IXmlDeserializer.Deserialize (XmlDeserializationContext context) { return DeserializeAction (context); } protected virtual ServiceAction DeserializeAction (XmlDeserializationContext context) { return Deserializer != null ? Deserializer.DeserializeAction (this, context) : null; } StateVariable IXmlDeserializer.Deserialize (XmlDeserializationContext context) { return DeserializeStateVariable (context); } protected virtual StateVariable DeserializeStateVariable (XmlDeserializationContext context) { return Deserializer != null ? Deserializer.DeserializeStateVariable (this, context) : null; } void IXmlDeserializable.Deserialize (XmlDeserializationContext context) { Deserialize (context); actions.MakeReadOnly (); state_variables.MakeReadOnly (); } void IXmlDeserializable.DeserializeAttribute (XmlDeserializationContext context) { DeserializeAttribute (context); } void IXmlDeserializable.DeserializeElement (XmlDeserializationContext context) { DeserializeElement (context); } protected override void DeserializeElement (XmlDeserializationContext context) { AutoDeserializeElement (this, context); } protected override void Serialize (Mono.Upnp.Xml.XmlSerializationContext context) { AutoSerialize (this, context); } protected override void SerializeMembers (XmlSerializationContext context) { AutoSerializeMembers (this, context); } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Control/AllowedValueRange.cs0000664000175000017500000000466211707010776030347 0ustar00lorentzlorentz00000000000000// // AllowedValueRange.cs // // Author: // Scott Thomas // // Copyright (C) 2008 S&S Black Ltd. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using Mono.Upnp.Internal; using Mono.Upnp.Xml; namespace Mono.Upnp.Control { [XmlType ("allowedValueRange")] public sealed class AllowedValueRange { AllowedValueRange () { } public AllowedValueRange (string minimum, string maximum) : this (minimum, maximum, null) { } public AllowedValueRange (string minimum, string maximum, string step) { if (minimum == null) { throw new ArgumentNullException ("minimum"); } else if (maximum == null) { throw new ArgumentNullException ("maximum"); } Minimum = minimum; Maximum = maximum; Step = step; } [XmlElement ("minimum")] public string Minimum { get; private set; } [XmlElement ("maximum")] public string Maximum { get; private set; } [XmlElement ("step", OmitIfNull = true)] public string Step { get; private set; } internal IComparable Min { get; set; } internal IComparable Max { get; set; } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Control/IMap.cs0000664000175000017500000000310011707010776025616 0ustar00lorentzlorentz00000000000000// // IMap.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System.Collections.Generic; namespace Mono.Upnp.Control { public interface IMap : IEnumerable> { int Count { get; } bool ContainsKey (TKey key); bool TryGetValue (TKey key, out TValue value); TValue this[TKey key] { get; } IEnumerable Keys { get; } IEnumerable Values { get; } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Control/UpnpEnumAttribute.cs0000664000175000017500000000306211707010776030432 0ustar00lorentzlorentz00000000000000// // UpnpEnumAttribute.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; namespace Mono.Upnp.Control { [AttributeUsage (AttributeTargets.Field)] public sealed class UpnpEnumAttribute : Attribute { readonly string name; public UpnpEnumAttribute (string name) { this.name = name; } public string Name { get { return name; } } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Control/StateVariableChangedArgs.cs0000664000175000017500000000306711707010776031621 0ustar00lorentzlorentz00000000000000// // StateVariableChangedArgs.cs // // Author: // Scott Thomas // // Copyright (C) 2008 S&S Black Ltd. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; namespace Mono.Upnp.Control { public class StateVariableChangedArgs : EventArgs { readonly T new_value; public StateVariableChangedArgs (T newValue) { new_value = newValue; } public T NewValue { get { return new_value; } } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Control/ServiceAction.cs0000664000175000017500000001720511707010776027541 0ustar00lorentzlorentz00000000000000// // ServiceAction.cs // // Author: // Scott Thomas // // Copyright (C) 2008 S&S Black Ltd. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Collections.Generic; using Mono.Upnp.Internal; using Mono.Upnp.Xml; namespace Mono.Upnp.Control { [XmlType ("action")] public class ServiceAction : Description, IMappable, IXmlDeserializer { readonly static IDictionary emptyArguments = new EmptyDictionary (); readonly ServiceController controller; readonly ServiceActionExecutor executor; CollectionMap arguments; protected internal ServiceAction (Deserializer deserializer, ServiceController controller) : base (deserializer) { if (controller == null) { throw new ArgumentNullException ("controller"); } this.controller = controller; this.arguments = new CollectionMap (); } public ServiceAction (string name, IEnumerable arguments, ServiceActionExecutor executor) : this (arguments, executor) { Name = name; } protected ServiceAction (IEnumerable arguments, ServiceActionExecutor executor) { if (executor == null) { throw new ArgumentNullException ("executor"); } this.arguments = Helper.MakeReadOnlyCopy (arguments); this.executor = executor; } [XmlElement ("name")] public virtual string Name { get; protected set; } [XmlArray ("argumentList")] protected virtual ICollection ArgumentCollection { get { return arguments; } } public IMap Arguments { get { return arguments; } } public IMap Invoke () { return Invoke (0); } public IMap Invoke (int retryAttempts) { return Invoke (emptyArguments, retryAttempts); } public IMap Invoke (IDictionary arguments) { return Invoke (arguments, 0); } public IMap Invoke (IDictionary arguments, int retryAttempts) { VerifyArguments (arguments); //CheckDisposed (); return InvokeCore (arguments, retryAttempts); } protected virtual IMap InvokeCore (IDictionary arguments, int retryAttempts) { if (arguments == null) throw new ArgumentNullException ("arguments"); return controller.Invoke (this, arguments, retryAttempts); } protected internal virtual IDictionary Execute (IDictionary arguments) { if (executor == null) { throw new InvalidOperationException ( "This ServiceAction was create for deserialization and cannot be executed locally. " + "Use the Invoke method to invoke the action across the network."); } return executor (arguments); } void VerifyArguments (IDictionary arguments) { foreach (var pair in arguments) { if (!this.arguments.ContainsKey (pair.Key) || this.arguments[pair.Key].Direction != ArgumentDirection.In) { throw new ArgumentException ("This action does not have an in argument called {0}.", pair.Key); } //VerifyArgumentValue (Arguments[pair.Key], pair.Value); } } // void VerifyArgumentValue (Argument argument, string value) // { // if (argument.RelatedStateVariable == null) { // return; // } // // var type = argument.RelatedStateVariable.Type; // var values = argument.RelatedStateVariable.AllowedValues; // if (values != null && type == typeof (string) && !values.Contains (value)) { // throw new ArgumentException ( // string.Format ("The value {0} is not allowed for the argument {1}.", value, argument.Name)); // } // // var range = argument.RelatedStateVariable.AllowedValueRange; // if (range != null && type is IComparable) { // var parse = type.GetMethod ("Parse", BindingFlags.Public | BindingFlags.Static); // var arg = parse.Invoke (null, new object[] { value }); // if (range.Min == null) { // range.Min = (IComparable)parse.Invoke (null, new object[] { range.Minimum }); // range.Max = (IComparable)parse.Invoke (null, new object[] { range.Maximum }); // } // if (range.Min.CompareTo (arg) > 0) { // throw new ArgumentOutOfRangeException (argument.Name, value, string.Format ( // "The value is less than {0}.", range.Minimum)); // } else if (range.Max.CompareTo (arg) < 0) { // throw new ArgumentOutOfRangeException (argument.Name, value, string.Format ( // "The value is greater than {0}.", range.Maximum)); // } // } // } Argument IXmlDeserializer.Deserialize (XmlDeserializationContext context) { return DeserializeArgument (context); } protected virtual Argument DeserializeArgument (XmlDeserializationContext context) { return Deserializer != null ? Deserializer.DeserializeArgument (context) : null; } protected override void DeserializeElement (XmlDeserializationContext context) { AutoDeserializeElement (this, context); } protected override void Serialize (XmlSerializationContext context) { AutoSerialize (this, context); } protected override void SerializeMembers (Mono.Upnp.Xml.XmlSerializationContext context) { AutoSerializeMembers (this, context); } string IMappable.Map () { return Name; } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Control/UpnpActionAttribute.cs0000664000175000017500000000315111707010776030742 0ustar00lorentzlorentz00000000000000// // UpnpActionAttribute.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; namespace Mono.Upnp.Control { [AttributeUsage (AttributeTargets.Method)] public sealed class UpnpActionAttribute : Attribute { public UpnpActionAttribute () { } public UpnpActionAttribute (string name) { Name = name; } public string Name { get; set; } public string OmitUnless { get; set; } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Control/UpnpControlException.cs0000664000175000017500000000347511707010776031151 0ustar00lorentzlorentz00000000000000// // UpnpControlException.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; namespace Mono.Upnp.Control { public class UpnpControlException : Exception { public UpnpControlException (UpnpError upnpError) : this (upnpError, null) { } public UpnpControlException (UpnpError upnpError, string message) : this (upnpError, message, null) { } public UpnpControlException (UpnpError upnpError, string message, Exception innerException) : base (message, innerException) { UpnpError = upnpError; } public UpnpError UpnpError { get; private set; } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Control/UpnpServiceDefinitionException.cs0000664000175000017500000000265711707010776033143 0ustar00lorentzlorentz00000000000000// // UpnpServiceDefinitionException.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; namespace Mono.Upnp.Control { public class UpnpServiceDefinitionException : Exception { public UpnpServiceDefinitionException (string message) : base (message) { } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Control/UpnpRelatedStateVariableAttribute.cs0000664000175000017500000000500611707010776033555 0ustar00lorentzlorentz00000000000000// // UpnpRelatedStateVariableAttribute.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; namespace Mono.Upnp.Control { [AttributeUsage (AttributeTargets.Parameter | AttributeTargets.ReturnValue)] public sealed class UpnpRelatedStateVariableAttribute : Attribute { readonly string minimum_value; readonly string maximum_value; public UpnpRelatedStateVariableAttribute () { } public UpnpRelatedStateVariableAttribute (string name) : this (name, null, null) { } public UpnpRelatedStateVariableAttribute (string minimumValue, string maximumValue) : this (null, minimumValue, maximumValue) { } public UpnpRelatedStateVariableAttribute (string name, string minimumValue, string maximumValue) { Name = name; this.minimum_value = minimumValue; this.maximum_value = maximumValue; } public string Name { get; set; } public string DataType { get; set; } public string DefaultValue { get; set; } public string MinimumValue { get { return minimum_value; } } public string MaximumValue { get { return maximum_value; } } public string StepValue { get; set; } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Control/UpnpArgumentAttribute.cs0000664000175000017500000000313311707010776031307 0ustar00lorentzlorentz00000000000000// // UpnpArgumentAttribute.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; namespace Mono.Upnp.Control { [AttributeUsage (AttributeTargets.Parameter | AttributeTargets.ReturnValue)] public sealed class UpnpArgumentAttribute : Attribute { public UpnpArgumentAttribute () { } public UpnpArgumentAttribute (string name) { Name = name; } public string Name { get; set; } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Control/StateVariable.cs0000664000175000017500000002022011707010776027520 0ustar00lorentzlorentz00000000000000// // StateVariable.cs // // Author: // Scott Thomas // // Copyright (C) 2008 S&S Black Ltd. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Collections.Generic; using Mono.Upnp.Internal; using Mono.Upnp.Xml; namespace Mono.Upnp.Control { [XmlType ("stateVariable")] public class StateVariable : XmlAutomatable, IMappable { readonly LinkedList>> value_changed = new LinkedList>> (); ServiceController controller; IList allowed_values; string value; protected StateVariable () { } protected internal StateVariable (ServiceController serviceController) { if (serviceController == null) { throw new ArgumentNullException ("serviceController"); } this.controller = serviceController; } public StateVariable (string name, string dataType) { if (name == null) { throw new ArgumentNullException ("name"); } else if (dataType == null) { throw new ArgumentNullException ("dataType"); } Name = name; DataType = dataType; } public StateVariable (string name, string dataType, StateVariableOptions options) : this (name, dataType) { if (options != null) { DefaultValue = options.DefaultValue; if (options.Eventer != null) { SetEventer (options.Eventer, options.IsMulticast); } } } public StateVariable (string name, IEnumerable allowedValues) : this (name, allowedValues, null) { } public StateVariable (string name, IEnumerable allowedValues, StateVariableOptions options) : this (name, "string", options) { allowed_values = Helper.MakeReadOnlyCopy (allowedValues); } public StateVariable (string name, string dataType, AllowedValueRange allowedValueRange) : this (name, dataType, allowedValueRange, null) { } public StateVariable (string name, string dataType, AllowedValueRange allowedValueRange, StateVariableOptions options) : this (name, dataType, options) { AllowedValueRange = allowedValueRange; } [XmlElement ("name")] public virtual string Name { get; protected set; } [XmlElement ("dataType")] public virtual string DataType { get; protected set; } [XmlAttribute ("sendEvents", OmitIfNull = true)] protected virtual string SendsEventsString { get { return SendsEvents ? "yes" : null; } set { SendsEvents = value == "yes"; } } public bool SendsEvents { get; protected set; } public virtual bool IsMulticast { get; protected set; } [XmlAttribute ("multicast", OmitIfNull = true)] protected virtual string IsMulticastString { get { return IsMulticast ? "yes" : null; } set { IsMulticast = value == "yes"; } } [XmlElement ("defaultValue", OmitIfNull = true)] public string DefaultValue { get; protected set; } [XmlArray ("allowedValueList", OmitIfNull = true)] [XmlArrayItem ("allowedValue")] protected virtual ICollection AllowedValueCollection { get { return allowed_values; } } public IEnumerable AllowedValues { get { return allowed_values; } } [XmlElement ("allowedValueRange", OmitIfNull = true)] public virtual AllowedValueRange AllowedValueRange { get; protected set; } public event EventHandler> ValueChanged { add { if (value == null) { return; } value_changed.AddLast (value); controller.RefEvents (); } remove { if (value == null || value_changed.Count == 0) { return; } var node = value_changed.First; do { if (node.Value == value) { value_changed.Remove (node); controller.UnrefEvents (); break; } node = node.Next; } while (node != null); } } protected internal string Value { get { return value; } set { this.value = value; foreach (var handler in value_changed) { handler (this, new StateVariableChangedArgs (value)); } } } internal void SetEventer (StateVariableEventer eventer, bool isMulticast) { eventer.StateVariableUpdated += OnStateVariableUpdated; SendsEvents = true; IsMulticast = isMulticast; } protected internal virtual void Initialize (ServiceController serviceController) { if (serviceController == null) { throw new ArgumentNullException ("serviceController"); } this.controller = serviceController; } protected virtual void OnStateVariableUpdated (object sender, StateVariableChangedArgs args) { Value = args.NewValue; if (controller != null) { controller.UpdateStateVariable (this); } } protected override void DeserializeAttribute (XmlDeserializationContext context) { AutoDeserializeAttribute (this, context); } protected override void DeserializeElement (XmlDeserializationContext context) { if (context == null) { throw new ArgumentNullException ("context"); } if (context.Reader.Name == "allowedValueList") { allowed_values = new List (); } context.AutoDeserializeElement (this); } protected override void Serialize (XmlSerializationContext context) { AutoSerialize (this, context); } protected override void SerializeMembers (Mono.Upnp.Xml.XmlSerializationContext context) { AutoSerializeMembers (this, context); } string IMappable.Map () { return Name; } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Control/StateVariableOptions.cs0000664000175000017500000000267211707010776031107 0ustar00lorentzlorentz00000000000000// // StateVariableOptions.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. namespace Mono.Upnp.Control { public class StateVariableOptions { public string DefaultValue { get; set; } public StateVariableEventer Eventer { get; set; } public bool IsMulticast { get; set; } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Control/ArgumentDirection.cs0000664000175000017500000000257211707010776030427 0ustar00lorentzlorentz00000000000000// // ArgumentDirection.cs // // Author: // Scott Thomas // // Copyright (C) 2008 S&S Black Ltd. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using Mono.Upnp.Xml; namespace Mono.Upnp.Control { public enum ArgumentDirection { [XmlEnum ("in")] In, [XmlEnum ("out")] Out } }mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Control/Argument.cs0000664000175000017500000000665111707010776026570 0ustar00lorentzlorentz00000000000000// // Argument.cs // // Author: // Scott Thomas // // Copyright (C) 2008 S&S Black Ltd. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using Mono.Upnp.Internal; using Mono.Upnp.Xml; namespace Mono.Upnp.Control { [XmlType ("argument")] public class Argument : XmlAutomatable, IMappable { protected internal Argument () { } public Argument (string name, string relatedStateVariable, ArgumentDirection direction) { if (direction < ArgumentDirection.In || direction > ArgumentDirection.Out) { throw new ArgumentOutOfRangeException ("direction"); } Name = name; RelatedStateVariable = relatedStateVariable; Direction = direction; } public Argument (string name, string relatedStateVariable, ArgumentDirection direction, bool isReturnValue) : this (name, relatedStateVariable, direction) { if (isReturnValue && direction == ArgumentDirection.In) { throw new ArgumentException ("The direction is In, but isReturnValue is true. " + "An IsReturnValue argument must have the direction Out."); } IsReturnValue = isReturnValue; } [XmlElement ("name")] public virtual string Name { get; protected set; } [XmlElement ("direction")] public virtual ArgumentDirection Direction { get; protected set; } [XmlFlag ("retval")] public virtual bool IsReturnValue { get; protected set; } [XmlElement ("relatedStateVariable")] public virtual string RelatedStateVariable { get; protected set; } protected override void DeserializeElement (XmlDeserializationContext context) { AutoDeserializeElement (this, context); } protected override void Serialize (XmlSerializationContext context) { AutoSerialize (this, context); } protected override void SerializeMembers (XmlSerializationContext context) { AutoSerializeMembers (this, context); } string IMappable.Map () { return Name; } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/AssemblyInfo.cs0000664000175000017500000000456311707010776024131 0ustar00lorentzlorentz00000000000000using System; using System.Reflection; using System.Runtime.CompilerServices; // Information about this assembly is defined by the following attributes. // Change them to the values specific to your project. [assembly: AssemblyTitle ("Mono.Upnp")] [assembly: AssemblyDescription ("A client and server Universal Plug 'n Play stack.")] [assembly: AssemblyConfiguration ("")] [assembly: AssemblyCompany ("")] [assembly: AssemblyProduct ("")] [assembly: AssemblyCopyright ("")] [assembly: AssemblyTrademark ("")] [assembly: AssemblyCulture ("")] [assembly: CLSCompliant (true)] // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". // The form "{Major}.{Minor}.*" will automatically update the build and revision, // and "{Major}.{Minor}.{Build}.*" will update just the revision. [assembly: AssemblyVersion ("1.0.*")] // The following attributes are used to specify the signing key for the assembly, // if desired. See the Mono documentation for more information about signing. [assembly: AssemblyDelaySign (false)] [assembly: InternalsVisibleTo ("Mono.Upnp.Dcp.MediaServer1, PublicKey=" + "00240000048000009400000006020000002400" + "0052534131000400001100000007CA7138D878" + "FFB4E68E1222C8FD84557E0336F4FB76D83774" + "13CC48DAB29CE14BEA65AAB4250A04FB059F39" + "CCE2593DC29ADAF8954E922F4A6354B6DEB71E" + "909137B33DEA212BB04F1492FBDFE50B0B7614" + "2974F2E5D86049D7F44706839CD76C57FAC02E" + "86C977188DD5185F5DDBA8EE46CA8F6F40224F" + "9D8653092BBAFE9F")] [assembly: InternalsVisibleTo ("Mono.Upnp.Dcp.MediaServer1.FileSystem, PublicKey=" + "0024000004800000940000000602000000240000525341310" + "0040000110000007FD08FD4F03157DEE6573823B967BCF78D" + "A200777DF681030D1C8EC06BEA3BE2C9CEC6735CF0046953E" + "1949882B0FB1D6F13ED43A72465BDA6EB3DA794D98D3921AF" + "D24996E2FFE2FCF87B2B715DA8F20363314259C8F280E71C7" + "46781846E73D54C383DC32B8C19038F317F9394815C0307BE" + "92D0BA9CB278C2019B31A28D83")] mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/mono.upnp.pc.in0000664000175000017500000000030511761736670024067 0ustar00lorentzlorentz00000000000000assemblies_dir=@expanded_libdir@/@PACKAGE@ Libraries=${assemblies_dir}/Mono.Upnp.dll Name: Mono.Upnp Description: Mono.Upnp Version: @VERSION@ Requires: Libs: -r:${assemblies_dir}/Mono.Upnp.dll mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml/0000775000175000017500000000000011761740036023566 5ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml/XmlTypeAttribute.cs0000664000175000017500000000424311707010776027407 0ustar00lorentzlorentz00000000000000// // SerializeTypeAttribute.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; namespace Mono.Upnp.Xml { [AttributeUsage (AttributeTargets.Class | AttributeTargets.Struct)] public sealed class XmlTypeAttribute : Attribute { readonly string name; readonly string @namespace; readonly string prefix; public XmlTypeAttribute (string name) : this (name, null) { } public XmlTypeAttribute (string name, string @namespace) : this (name, @namespace, null) { } public XmlTypeAttribute (string name, string @namespace, string prefix) { this.name = name; this.@namespace = @namespace; this.prefix = prefix; } public string Name { get { return name; } } public string Namespace { get { return @namespace; } } public string Prefix { get { return prefix; } } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml/XmlFlagAttribute.cs0000664000175000017500000000374611707010776027346 0ustar00lorentzlorentz00000000000000// // XmlFlagAttribute.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; namespace Mono.Upnp.Xml { [AttributeUsage (AttributeTargets.Property)] public sealed class XmlFlagAttribute : Attribute { public XmlFlagAttribute () { } public XmlFlagAttribute (string name) : this (name, null) { } public XmlFlagAttribute (string name, string @namespace) : this (name, @namespace, null) { } public XmlFlagAttribute (string name, string @namespace, string prefix) { Name = name; Namespace = @namespace; Prefix = prefix; } public string Name { get; set; } public string Namespace { get; set; } public string Prefix { get; set; } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml/XmlSerializable.cs0000664000175000017500000000451311707010776027210 0ustar00lorentzlorentz00000000000000// // XmlSerializable.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. namespace Mono.Upnp.Xml { public abstract class XmlSerializable : IXmlSerializable { void IXmlSerializable.Serialize (XmlSerializationContext context) { Serialize (context); } void IXmlSerializable.SerializeMembers (XmlSerializationContext context) { SerializeMembers (context); } protected abstract void Serialize (XmlSerializationContext context); protected abstract void SerializeMembers (XmlSerializationContext context); } public abstract class XmlSerializable : IXmlSerializable { void IXmlSerializable.Serialize (XmlSerializationContext context) { Serialize (context); } void IXmlSerializable.SerializeMembers (XmlSerializationContext context) { SerializeMembers (context); } protected abstract void Serialize (XmlSerializationContext context); protected abstract void SerializeMembers (XmlSerializationContext context); } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml/XmlNamespaceAttribute.cs0000664000175000017500000000345411707010776030365 0ustar00lorentzlorentz00000000000000// // XmlNamespace.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; namespace Mono.Upnp.Xml { [AttributeUsage (AttributeTargets.Class | AttributeTargets.Property, AllowMultiple = true)] public sealed class XmlNamespaceAttribute : Attribute { readonly string @namespace; readonly string prefix; public XmlNamespaceAttribute (string @namespace, string prefix) { this.@namespace = @namespace; this.prefix = prefix; } public string Namespace { get { return @namespace; } } public string Prefix { get { return prefix; } } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml/DoNotSerializeAttribute.cs0000664000175000017500000000254411707010776030702 0ustar00lorentzlorentz00000000000000// // DoNotSerializeAttribute.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; namespace Mono.Upnp.Xml { [AttributeUsage (AttributeTargets.Property)] public sealed class DoNotSerializeAttribute : Attribute { } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml/XmlSerializationContext.cs0000664000175000017500000001063511707010776030766 0ustar00lorentzlorentz00000000000000// // XmlSerializationContext.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Xml; namespace Mono.Upnp.Xml { public abstract class XmlSerializationContext { readonly XmlWriter writer; internal XmlSerializationContext (XmlWriter writer) { this.writer = writer; } public XmlWriter Writer { get { return writer; } } public abstract void AutoSerializeObjectStart (TObject obj); public abstract void AutoSerializeObjectEnd (TObject obj); public abstract void AutoSerializeMembers (TObject obj); public abstract void Serialize (TObject obj); } public sealed class XmlSerializationContext : XmlSerializationContext { readonly XmlSerializer serializer; readonly TContext context; internal XmlSerializationContext (XmlSerializer serializer, XmlWriter writer, TContext context) : base (writer) { this.serializer = serializer; this.context = context; } public TContext Context { get { return context; } } public override void AutoSerializeObjectStart (TObject obj) { if (obj == null) throw new ArgumentNullException ("obj"); serializer.AutoSerializeObjectStart (obj, this); } public void AutoSerializeObjectStart (TObject obj, TContext context) { if (obj == null) throw new ArgumentNullException ("obj"); serializer.AutoSerializeObjectStart (obj, new XmlSerializationContext (serializer, Writer, context)); } public override void AutoSerializeObjectEnd (TObject obj) { if (obj == null) throw new ArgumentNullException ("obj"); serializer.AutoSerializeObjectEnd (obj, this); } public void AutoSerializeObjectEnd (TObject obj, TContext context) { if (obj == null) throw new ArgumentNullException ("obj"); serializer.AutoSerializeObjectEnd (obj, new XmlSerializationContext (serializer, Writer, context)); } public override void AutoSerializeMembers (TObject obj) { if (obj == null) throw new ArgumentNullException ("obj"); serializer.AutoSerializeMembers (obj, this); } public void AutoSerializeMembers (TObject obj, TContext context) { if (obj == null) throw new ArgumentNullException ("obj"); serializer.AutoSerializeMembers (obj, new XmlSerializationContext (serializer, Writer, context)); } public override void Serialize (TObject obj) { serializer.Serialize (obj, this); } public void Serialize (TObject obj, TContext context) { serializer.Serialize (obj, new XmlSerializationContext (serializer, Writer, context)); } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml/IXmlDeserializer.cs0000664000175000017500000000250411707010776027333 0ustar00lorentzlorentz00000000000000// // IXmlDeserializer.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. namespace Mono.Upnp.Xml { public interface IXmlDeserializer { T Deserialize(XmlDeserializationContext context); } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml/XmlSerializer.cs0000664000175000017500000002322511707010776026714 0ustar00lorentzlorentz00000000000000// // XmlSerializer.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using System.IO; using System.Text; using System.Xml; using Mono.Upnp.Internal; using Mono.Upnp.Xml.Compilation; namespace Mono.Upnp.Xml { public sealed class XmlSerializer { struct Nothing { } readonly XmlSerializer serializer = new XmlSerializer (); public void Serialize (TObject obj, XmlWriter writer) { serializer.Serialize (obj, writer, new Nothing ()); } public void Serialize (TObject obj, Stream stream) { Serialize (obj, stream, null); } public void Serialize (TObject obj, Stream stream, XmlSerializationOptions options) { if (options == null) { serializer.Serialize (obj, stream); } else { serializer.Serialize (obj, stream, new XmlSerializationOptions { Encoding = options.Encoding, XmlDeclarationType = options.XmlDeclarationType }); } } public byte[] GetBytes (TObject obj) { return GetBytes (obj, null); } public byte[] GetBytes (TObject obj, XmlSerializationOptions options) { if (options == null) { return serializer.GetBytes (obj); } else { return serializer.GetBytes (obj, new XmlSerializationOptions { Encoding = options.Encoding, XmlDeclarationType = options.XmlDeclarationType }); } } public string GetString (TObject obj) { return GetString (obj, null); } public string GetString (TObject obj, XmlSerializationOptions options) { if (options == null) { return serializer.GetString (obj); } else { return serializer.GetString (obj, new XmlSerializationOptions { Encoding = options.Encoding, XmlDeclarationType = options.XmlDeclarationType }); } } } public sealed class XmlSerializer { readonly SerializationCompilerProvider compiler_provider; readonly Dictionary> compilers = new Dictionary> (); public XmlSerializer () : this (null) { } public XmlSerializer (SerializationCompilerProvider compilerProvider) { if (compilerProvider == null) { compiler_provider = (serializer, type) => new DelegateSerializationCompiler (serializer, type); } else { compiler_provider = compilerProvider; } } public void Serialize (TObject obj, XmlWriter writer) { Serialize (obj, writer, default (TContext)); } public void Serialize (TObject obj, XmlWriter writer, TContext context) { if (writer == null) throw new ArgumentNullException ("writer"); SerializeCore (obj, writer, context); } public void Serialize (TObject obj, Stream stream) { Serialize (obj, stream, null); } public void Serialize (TObject obj, Stream stream, XmlSerializationOptions options) { if (stream == null) throw new ArgumentNullException ("stream"); var serializationOptions = new XmlSerializationOptions(options); using (var writer = XmlWriter.Create (stream, new XmlWriterSettings { Encoding = serializationOptions.Encoding, OmitXmlDeclaration = true })) { WriteXmlDeclaration (writer, serializationOptions); SerializeCore (obj, writer, serializationOptions.Context); } } public byte[] GetBytes (TObject obj) { return GetBytes (obj, null); } public byte[] GetBytes (TObject obj, XmlSerializationOptions options) { var serializationOptions = new XmlSerializationOptions(options); using (var stream = new MemoryStream ()) { using (var writer = XmlWriter.Create (stream, new XmlWriterSettings { Encoding = serializationOptions.Encoding ?? Helper.UTF8Unsigned, OmitXmlDeclaration = serializationOptions.XmlDeclarationType == XmlDeclarationType.None})) { WriteXmlDeclaration (writer, serializationOptions); SerializeCore (obj, writer, serializationOptions.Context); } return stream.ToArray (); } } public string GetString (TObject obj) { return GetString (obj, null); } public string GetString (TObject obj, XmlSerializationOptions options) { if (options == null) { options = new XmlSerializationOptions (); } var encoding = options.Encoding ?? Helper.UTF8Unsigned; return encoding.GetString (GetBytes (obj, options)); } void WriteXmlDeclaration (XmlWriter writer, XmlSerializationOptions options) { switch (options.XmlDeclarationType) { case XmlDeclarationType.Version: writer.WriteProcessingInstruction ("xml", @"version=""1.0"""); break; case XmlDeclarationType.VersionAndEncoding: writer.WriteProcessingInstruction ("xml", string.Format( @"version=""1.0"" encoding=""{0}""", options.Encoding.HeaderName)); break; } } void SerializeCore (TObject obj, XmlWriter writer, TContext context) { Serialize (obj, new XmlSerializationContext (this, writer, context)); } internal void Serialize (TObject obj, XmlSerializationContext context) { if (obj == null) throw new ArgumentNullException ("obj"); var serializer = GetCompilerForType (typeof (TObject)).TypeSerializer; serializer (obj, context); } internal void AutoSerializeObjectStart (TObject obj, XmlSerializationContext context) { var serializer = GetCompilerForType (typeof (TObject)).TypeStartAutoSerializer; serializer (obj, context); } internal void AutoSerializeObjectEnd (TObject obj, XmlSerializationContext context) { var serializer = GetCompilerForType (typeof (TObject)).TypeEndAutoSerializer; serializer (obj, context); } internal void AutoSerializeMembers (TObject obj, XmlSerializationContext context) { var serialzer = GetCompilerForType (typeof (TObject)).MemberAutoSerializer; serialzer (obj, context); } internal SerializationCompiler GetCompilerForType (Type type) { SerializationCompiler compiler; if (!compilers.TryGetValue (type, out compiler)) { compiler = compiler_provider (this, type); compilers[type] = compiler; } return compiler; } struct XmlSerializationOptions { public readonly Encoding Encoding; public readonly TContext Context; public readonly XmlDeclarationType XmlDeclarationType; public XmlSerializationOptions (XmlSerializationOptions options) { if (options == null) { Encoding = Helper.UTF8Unsigned; Context = default (TContext); XmlDeclarationType = 0; } else { Encoding = options.Encoding ?? Helper.UTF8Unsigned; Context = options.Context; XmlDeclarationType = options.XmlDeclarationType; } } } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml/IXmlDeserializable.cs0000664000175000017500000000275011707010776027633 0ustar00lorentzlorentz00000000000000// // IXmlDeserializable.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System.Xml; namespace Mono.Upnp.Xml { public interface IXmlDeserializable { void Deserialize (XmlDeserializationContext context); void DeserializeAttribute (XmlDeserializationContext context); void DeserializeElement (XmlDeserializationContext context); } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml/XmlArrayAttribute.cs0000664000175000017500000000413311707010776027542 0ustar00lorentzlorentz00000000000000// // SerializeEnumerable.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; namespace Mono.Upnp.Xml { [AttributeUsage (AttributeTargets.Property)] public sealed class XmlArrayAttribute : Attribute { public XmlArrayAttribute () { } public XmlArrayAttribute (string name) : this (name, null) { } public XmlArrayAttribute (string name, string @namespace) : this (name, @namespace, null) { } public XmlArrayAttribute (string name, string @namespace, string prefix) { Name = name; Namespace = @namespace; Prefix = prefix; } public string Name { get; set; } public string Namespace { get; set; } public string Prefix { get; set; } public bool OmitIfNull { get; set; } public bool OmitIfEmpty { get; set; } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml/XmlDeclarationType.cs0000664000175000017500000000251711707010776027673 0ustar00lorentzlorentz00000000000000// // XmlDeclarationType.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; namespace Mono.Upnp.Xml { public enum XmlDeclarationType { Version, VersionAndEncoding, None } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml/IXmlSerializable.cs0000664000175000017500000000312211707010776027314 0ustar00lorentzlorentz00000000000000// // IXmlSerializable.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. namespace Mono.Upnp.Xml { public interface IXmlSerializable { void Serialize (XmlSerializationContext context); void SerializeMembers (XmlSerializationContext context); } public interface IXmlSerializable { void Serialize (XmlSerializationContext context); void SerializeMembers (XmlSerializationContext context); } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml/XmlSerializationOptions.cs0000664000175000017500000000364211707010776030775 0ustar00lorentzlorentz00000000000000// // XmlSerializationOptions.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Text; namespace Mono.Upnp.Xml { public class XmlSerializationOptions { XmlDeclarationType xml_declaration_type; public Encoding Encoding { get; set; } public XmlDeclarationType XmlDeclarationType { get { return xml_declaration_type; } set { if (value < XmlDeclarationType.Version || value > XmlDeclarationType.None) throw new ArgumentOutOfRangeException ("value"); xml_declaration_type = value; } } } public class XmlSerializationOptions : XmlSerializationOptions { public TContext Context { get; set; } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml/XmlAttributeAttribute.cs0000664000175000017500000000410011707010776030421 0ustar00lorentzlorentz00000000000000// // SerializeAttributeAttribute.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; namespace Mono.Upnp.Xml { [AttributeUsage (AttributeTargets.Property)] public sealed class XmlAttributeAttribute : Attribute { public XmlAttributeAttribute () { } public XmlAttributeAttribute (string name) : this (name, null) { } public XmlAttributeAttribute (string name, string @namespace) : this (name, @namespace, null) { } public XmlAttributeAttribute (string name, string @namespace, string prefix) { Name = name; Namespace = @namespace; Prefix = prefix; } public string Name { get; set; } public string Namespace { get; set; } public string Prefix { get; set; } public bool OmitIfNull { get; set; } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml/XmlAutomatable.cs0000664000175000017500000000722311707010776027041 0ustar00lorentzlorentz00000000000000// // XmlAutomatable.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; namespace Mono.Upnp.Xml { public abstract class XmlAutomatable : XmlDeserializable, IXmlSerializable { void IXmlSerializable.Serialize (XmlSerializationContext context) { Serialize (context); } void IXmlSerializable.SerializeMembers (XmlSerializationContext context) { SerializeMembers (context); } protected abstract void Serialize (XmlSerializationContext context); protected abstract void SerializeMembers (XmlSerializationContext context); protected void AutoSerialize (T @this, XmlSerializationContext context) { if (context == null) { throw new ArgumentNullException ("context"); } context.AutoSerializeObjectStart (@this); SerializeMembers (context); context.AutoSerializeObjectEnd (@this); } protected static void AutoSerializeMembers (T @this, XmlSerializationContext context) { if (context == null) { throw new ArgumentNullException ("context"); } context.AutoSerializeMembers (@this); } } public abstract class XmlAutomatable : XmlDeserializable, IXmlSerializable { void IXmlSerializable.Serialize (XmlSerializationContext context) { Serialize (context); } void IXmlSerializable.SerializeMembers (XmlSerializationContext context) { SerializeMembers (context); } protected abstract void Serialize (XmlSerializationContext context); protected abstract void SerializeMembers (XmlSerializationContext context); internal void AutoSerialize (T @this, XmlSerializationContext context) { if (context == null) { throw new ArgumentNullException ("context"); } context.AutoSerializeObjectStart (@this); SerializeMembers (context); context.AutoSerializeObjectEnd (@this); } internal static void AutoSerializeMembersOnly (T @this, XmlSerializationContext context) { if (context == null) { throw new ArgumentNullException ("context"); } context.AutoSerializeMembers (@this); } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml/XmlElementAttribute.cs0000664000175000017500000000405311707010776030056 0ustar00lorentzlorentz00000000000000// // SerializeElement.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; namespace Mono.Upnp.Xml { [AttributeUsage (AttributeTargets.Property)] public sealed class XmlElementAttribute : Attribute { public XmlElementAttribute () { } public XmlElementAttribute (string name) : this (name, null) { } public XmlElementAttribute (string name, string @namespace) : this (name, @namespace, null) { } public XmlElementAttribute (string name, string @namespace, string prefix) { Name = name; Namespace = @namespace; Prefix = prefix; } public string Name { get; set; } public string Namespace { get; set; } public string Prefix { get; set; } public bool OmitIfNull { get; set; } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml/XmlValueAttribute.cs0000664000175000017500000000244711707010776027546 0ustar00lorentzlorentz00000000000000// // XmlValueAttribute.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; namespace Mono.Upnp.Xml { public sealed class XmlValueAttribute : Attribute { } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml/XmlArrayItemAttribute.cs0000664000175000017500000000377311707010776030372 0ustar00lorentzlorentz00000000000000// // XmlArrayItem.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; namespace Mono.Upnp.Xml { [AttributeUsage (AttributeTargets.Property)] public sealed class XmlArrayItemAttribute : Attribute { public XmlArrayItemAttribute () { } public XmlArrayItemAttribute (string name) : this (name, null) { } public XmlArrayItemAttribute (string name, string @namespace) : this (name, @namespace, null) { } public XmlArrayItemAttribute (string name, string @namespace, string prefix) { Name = name; Namespace = @namespace; Prefix = prefix; } public string Name { get; set; } public string Namespace { get; set; } public string Prefix { get; set; } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml/XmlDeserializable.cs0000664000175000017500000000546011707010776027523 0ustar00lorentzlorentz00000000000000// // XmlDeserializable.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; namespace Mono.Upnp.Xml { public abstract class XmlDeserializable : IXmlDeserializable { void IXmlDeserializable.Deserialize (XmlDeserializationContext context) { Deserialize (context); } void IXmlDeserializable.DeserializeAttribute (XmlDeserializationContext context) { DeserializeAttribute (context); } void IXmlDeserializable.DeserializeElement (XmlDeserializationContext context) { DeserializeElement (context); } protected virtual void Deserialize (XmlDeserializationContext context) { if (context == null) { throw new ArgumentNullException ("context"); } context.AutoDeserialize (this); } protected virtual void DeserializeAttribute (XmlDeserializationContext context) { } protected virtual void DeserializeElement (XmlDeserializationContext context) { } internal static void AutoDeserializeAttribute (T @this, XmlDeserializationContext context) { if (context == null) { throw new ArgumentNullException ("context"); } context.AutoDeserializeAttribute (@this); } internal static void AutoDeserializeElement (T @this, XmlDeserializationContext context) { if (context == null) { throw new ArgumentNullException ("context"); } context.AutoDeserializeElement (@this); } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml/XmlEnumAttribute.cs0000664000175000017500000000304711707010776027373 0ustar00lorentzlorentz00000000000000// // XmlEnum.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; namespace Mono.Upnp.Xml { [AttributeUsage (AttributeTargets.Field)] public sealed class XmlEnumAttribute : Attribute { readonly string value; public XmlEnumAttribute(string value) { this.value = value; } public string Value { get { return value; } } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml/XmlDeserializationContext.cs0000664000175000017500000000470111707010776031274 0ustar00lorentzlorentz00000000000000// // XmlDeserializationContext.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Xml; namespace Mono.Upnp.Xml { public class XmlDeserializationContext { readonly XmlDeserializer deserializer; readonly XmlReader reader; internal XmlDeserializationContext (XmlDeserializer deserializer, XmlReader reader) { this.deserializer = deserializer; this.reader = reader; } public XmlReader Reader { get { return reader; } } public void AutoDeserialize (T obj) { if (obj == null) throw new ArgumentNullException ("obj"); deserializer.AutoDeserialize (obj, this); } public void AutoDeserializeAttribute (T obj) { if (obj == null) throw new ArgumentNullException ("obj"); deserializer.AutoDeserializeAttribute (obj, this); } public void AutoDeserializeElement (T obj) { if (obj == null) throw new ArgumentNullException ("obj"); deserializer.AutoDeserializeElement (obj, this); } public T Deserialize () { return deserializer.Deserialize (Reader); } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml/XmlDeserializer.cs0000664000175000017500000000760211707010776027226 0ustar00lorentzlorentz00000000000000// // XmlDeserializer.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using System.Xml; using Mono.Upnp.Xml.Compilation; namespace Mono.Upnp.Xml { public delegate T Deserializer (XmlDeserializationContext context); public sealed class XmlDeserializer { readonly DeserializationCompilerProvider compiler_provider; readonly Dictionary compilers = new Dictionary (); public XmlDeserializer () : this (null) { } public XmlDeserializer (DeserializationCompilerProvider compilerProvider) { this.compiler_provider = compilerProvider ?? ((xmlDeserializer, type) => new DelegateDeserializationCompiler (xmlDeserializer, type)); } public T Deserialize (XmlReader reader) { return Deserialize (reader, null); } public T Deserialize (XmlReader reader, Deserializer typeDeserializer) { if (reader == null) throw new ArgumentNullException ("reader"); return DeserializeCore (reader, typeDeserializer); } T DeserializeCore (XmlReader reader, Deserializer typeDeserializer) { var context = new XmlDeserializationContext (this, reader); if (typeDeserializer != null) { return typeDeserializer (context); } else { var deserializer = GetCompilerForType (typeof (T)).Deserializer; return (T) deserializer (context); } } internal void AutoDeserialize (T obj, XmlDeserializationContext context) { var deserializer = GetCompilerForType (typeof (T)).AutoDeserializer; deserializer (obj, context); } internal void AutoDeserializeAttribute (T obj, XmlDeserializationContext context) { var deserializer = GetCompilerForType (typeof (T)).AttributeAutoDeserializer; deserializer (obj, context); } internal void AutoDeserializeElement (T obj, XmlDeserializationContext context) { var deserializer = GetCompilerForType (typeof (T)).ElementAutoDeserializer; deserializer (obj, context); } internal DeserializationCompiler GetCompilerForType (Type type) { DeserializationCompiler compiler; if (!compilers.TryGetValue (type, out compiler)) { compiler = compiler_provider (this, type); compilers[type] = compiler; } return compiler; } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml/DoNotDeserializeAttribute.cs0000664000175000017500000000255011707010776031210 0ustar00lorentzlorentz00000000000000// // DoNotDeserializeAttribute.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; namespace Mono.Upnp.Xml { [AttributeUsage (AttributeTargets.Property)] public sealed class DoNotDeserializeAttribute : Attribute { } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/mono-upnp.snk0000664000175000017500000000112411707010776023642 0ustar00lorentzlorentz00000000000000$RSA2Oà Ä~©‘tˆp9 Yõ86Ü Ê|bP~JÛ±¥ÇÝ‘ÄüRšý?³·§þê"S dgf¹()KmysT‚t´ÿfwÿ\&¢$1aÕ¡8¼ Êfq^Ñ3€g™Ñè‹ÁjÔ³×ÓHdi±§s¨J]øûþÆDzú(pUtãÆ0!1ƒÂ›Ë$¤KwIŽŸƒºü ÍЦmߣ@©D ð?uŸ³¦”àã¹Hœ¡EÃ-mr6ÜÏ::7Åþ"’qìÉ•†ýÙ)(‡"N@ÈÒæ*®ÌÞ¶yáåRç„r•KƬC'!Z7*^btx’~ŒxÈ+¸5–1]')¸TÙ0ZHus¸³~?V) ú‡¾“›b%íVÔ‹ÇUʆWèWHÚ@«Àq—¦"l¹Ó %”\ãõîµXmono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Internal/0000775000175000017500000000000011761740036024602 5ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Internal/DataServer.cs0000664000175000017500000000424211707010776027174 0ustar00lorentzlorentz00000000000000// // DataServer.cs // // Author: // Scott Thomas // // Copyright (C) 2008 S&S Black Ltd. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Net; using Mono.Upnp.Control; namespace Mono.Upnp.Internal { sealed class DataServer : UpnpServer { readonly byte[] data; readonly string content_type; public DataServer (byte[] data, string contentType, Uri url) : base (url) { this.data = data; this.content_type = contentType; } protected override void HandleContext (HttpListenerContext context) { base.HandleContext (context); context.Response.SendChunked = false; context.Response.ContentLength64 = data.LongLength; context.Response.ContentType = content_type; context.Response.OutputStream.Write (data, 0, data.Length); Log.Information (string.Format ( "{0} requested {1}.", context.Request.RemoteEndPoint, context.Request.Url)); } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Internal/EmptyDictionary.cs0000664000175000017500000000630011707010776030255 0ustar00lorentzlorentz00000000000000// // EmptyDictionary.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections; using System.Collections.Generic; namespace Mono.Upnp.Internal { class EmptyDictionary : IDictionary { public void Add (string key, string value) { throw new NotSupportedException (); } public bool ContainsKey (string key) { return false; } public bool Remove (string key) { return false; } public bool TryGetValue (string key, out string value) { value = null; return false; } public string this[string key] { get { return null; } set { throw new NotSupportedException (); } } public ICollection Keys { get { return new string[0]; } } public ICollection Values { get { return new string[0]; } } public IEnumerator> GetEnumerator () { yield break; } IEnumerator IEnumerable.GetEnumerator () { return GetEnumerator(); } public void Add (KeyValuePair item) { throw new NotSupportedException (); } public void Clear () { throw new NotSupportedException (); } public bool Contains (KeyValuePair item) { return false; } public void CopyTo (KeyValuePair[] array, int arrayIndex) { } public bool Remove (KeyValuePair item) { throw new NotSupportedException (); } public int Count { get { return 0; } } public bool IsReadOnly { get { return true; } } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Internal/CollectionMap.cs0000664000175000017500000000611711707010776027670 0ustar00lorentzlorentz00000000000000// // CollectionMap.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections; using System.Collections.Generic; namespace Mono.Upnp.Internal { sealed class CollectionMap : Map, ICollection where TValue : IMappable { bool is_read_only; public CollectionMap () : base (new Dictionary ()) { } public void Add (TValue value) { CheckReadOnly (); if (value == null) { return; } Dictionary.Add (value.Map (), value); } public void Clear () { CheckReadOnly (); Dictionary.Clear (); } public bool Remove (TValue value) { CheckReadOnly (); if (value == null) { return false; } return Dictionary.Remove (value.Map ()); } public bool Contains (TValue value) { if (value == null) { return false; } return Dictionary.ContainsKey (value.Map ()); } public void CopyTo (TValue[] array, int arrayIndex) { Dictionary.Values.CopyTo (array, arrayIndex); } public bool IsReadOnly { get { return is_read_only; } } public new IEnumerator GetEnumerator () { return Dictionary.Values.GetEnumerator (); } IEnumerator IEnumerable.GetEnumerator () { return GetEnumerator (); } public void MakeReadOnly () { is_read_only = true; } void CheckReadOnly () { if (is_read_only) { throw new NotSupportedException ("The collection is read-only."); } } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Internal/ControlClient.cs0000664000175000017500000002026511733333217027713 0ustar00lorentzlorentz00000000000000// // ControlClient.cs // // Author: // Scott Thomas // // Copyright (C) 2008 S&S Black Ltd. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Collections.Generic; using System.IO; using System.Net; using System.Xml; using Mono.Upnp.Control; using Mono.Upnp.Xml; namespace Mono.Upnp.Internal { sealed class ControlClient { readonly static WeakReference static_serializer = new WeakReference (null); readonly string service_type; readonly Uri url; readonly XmlSerializer serializer; readonly XmlDeserializer deserializer; public ControlClient (string serviceType, Uri url, XmlDeserializer deserializer) { this.service_type = serviceType; this.url = url; this.deserializer = deserializer; if (static_serializer.IsAlive) { this.serializer = (XmlSerializer)static_serializer.Target; } else { this.serializer = new XmlSerializer (); static_serializer.Target = this.serializer; } } public IMap Invoke (string actionName, IDictionary arguments) { var request = (HttpWebRequest)WebRequest.Create (url); request.Method = "POST"; request.ContentType = @"text/xml; charset=""utf-8"""; request.UserAgent = Protocol.UserAgent; request.Headers.Add ("SOAPACTION", string.Format (@"""{0}#{1}""", service_type, actionName)); using (var stream = request.GetRequestStream ()) { serializer.Serialize ( new SoapEnvelope (new Arguments (service_type, actionName, arguments)), stream); } HttpWebResponse response; WebException exception; try { response = Helper.GetResponse (request); exception = null; } catch (WebException e) { response = e.Response as HttpWebResponse; if (response == null) { Log.Error (string.Format ( "The request for the {0} action request on {1} failed.", actionName, url)); throw new UpnpControlException (UpnpError.Unknown(), "The invokation failed.", e); } exception = e; } using (response) { switch (response.StatusCode) { case HttpStatusCode.OK: using (var reader = XmlReader.Create (response.GetResponseStream ())) { // FIXME this is a workaround for Mono bug 523151 reader.MoveToContent (); var envelope = deserializer.Deserialize> (reader); if (envelope == null) { Log.Error (string.Format ( "The response to the {0} action request on {1} has no envelope.", actionName, url)); throw new UpnpControlException (UpnpError.Unknown(), "The service did not provide a valid response (unable to deserialize SOAP envelope)."); } else if (envelope.Body == null) { Log.Error (string.Format ( "The response to the {0} action request on {1} " + "has no envelope body.", actionName, url)); throw new UpnpControlException (UpnpError.Unknown(), "The service did not provide a valid response " + "(unable to deserialize SOAP envelope body)."); } return new Map (envelope.Body.Values); } case HttpStatusCode.InternalServerError: using (var reader = XmlReader.Create (response.GetResponseStream ())) { // FIME this is a workaround for Mono bug 523151 reader.MoveToContent (); var envelope = deserializer .Deserialize>>>> (reader); if (envelope == null) { Log.Error (string.Format ( "The faulty response to the {0} action request " + "on {1} has no envelope.", actionName, url)); throw new UpnpControlException (UpnpError.Unknown(), "The invokation failed but the service did not provide valid fault information " + "(unable to deserialize SOAP envelope).", exception); } else if (envelope.Body == null) { Log.Error (string.Format ( "The faulty response to the {0} action request on {1} " + "has no envelope body.", actionName, url)); throw new UpnpControlException (UpnpError.Unknown(), "The invokation failed but the service did not provide valid fault information " + "(unable to deserialize SOAP envelope body).", exception); } else if (envelope.Body.Value.Detail == null || envelope.Body.Value.Detail.Value == null) { Log.Error (string.Format ( "The faulty response to the {0} action request on {1} has no UPnPError. " + @"The faultcode and faultstring are ""{2}"" and ""{3}"" respectively.", actionName, url, envelope.Body.Value.FaultCode, envelope.Body.Value.FaultString)); throw new UpnpControlException (UpnpError.Unknown(), "The invokation failed but the service did not provide valid fault information " + "(unable to deserialize a UPnPError from the SOAP envelope).", exception); } Log.Error (string.Format ( "The invokation for the {0} action request on {1} failed: {2}", actionName, url, envelope.Body.Value.Detail.Value)); throw new UpnpControlException (envelope.Body.Value.Detail.Value, "The invokation failed.", exception); } default: Log.Error (string.Format ( "The response to the {0} action request on {1} returned with status code {2}: {3}.", actionName, url, (int)response.StatusCode, response.StatusDescription)); throw new UpnpControlException (UpnpError.Unknown(), "The invokation failed.", exception); } } } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Internal/SoapEnvelope.cs0000664000175000017500000000455311707010776027541 0ustar00lorentzlorentz00000000000000// // SoapEnvelope.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using Mono.Upnp.Xml; namespace Mono.Upnp.Internal { [XmlType ("Envelope", Protocol.SoapEnvelopeSchema, "s")] class SoapEnvelope : SoapEnvelope { protected SoapEnvelope () { } public SoapEnvelope (T body) : base (body) { } } [XmlType ("Envelope", Protocol.SoapEnvelopeSchema, "s")] class SoapEnvelope { protected SoapEnvelope () { } public SoapEnvelope (TBody body) : this (null, body) { } public SoapEnvelope (SoapHeader header, TBody body) { Header = header; Body = body; EncodingStyle = Protocol.SoapEncodingSchema; } [XmlAttribute ("encodingStyle", Protocol.SoapEnvelopeSchema)] public string EncodingStyle { get; set; } [XmlElement (OmitIfNull = true, Namespace = Protocol.SoapEnvelopeSchema)] public SoapHeader Header { get; set; } [XmlElement (Namespace = Protocol.SoapEnvelopeSchema)] public TBody Body { get; set; } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Internal/XmlShell.cs0000664000175000017500000000570311707010776026667 0ustar00lorentzlorentz00000000000000// // XmlShell.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using Mono.Upnp.Xml; namespace Mono.Upnp.Internal { class XmlShell : XmlAutomatable { static readonly string local_name; static readonly string @namespace; static readonly string prefix; static XmlShell () { var xml_types = typeof (T).GetCustomAttributes (typeof (XmlTypeAttribute), true); if (xml_types.Length == 0) { throw new TypeLoadException ("XmlShell may only be closed with a type annotated with XmlType"); } var xml_type = (XmlTypeAttribute)xml_types[0]; local_name = xml_type.Name; @namespace = xml_type.Namespace; prefix = xml_type.Prefix; } public XmlShell () { } public XmlShell (T value) { Value = value; } public T Value { get; set; } protected override void Deserialize (XmlDeserializationContext context) { if (context.Reader.ReadToDescendant (local_name, @namespace)) { using (var reader = context.Reader.ReadSubtree ()) { reader.Read (); Value = context.Deserialize (); } } } protected override void SerializeMembers (XmlSerializationContext context) { context.Writer.WriteStartElement (prefix, local_name, @namespace); context.Serialize (Value); context.Writer.WriteEndElement (); } protected override void Serialize (XmlSerializationContext context) { throw new InvalidOperationException ("An XmlShell cannot be the root of a serialization operation."); } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Internal/SoapHeader.cs0000664000175000017500000000370311707010776027150 0ustar00lorentzlorentz00000000000000// // SoapHeader.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using Mono.Upnp.Xml; namespace Mono.Upnp.Internal { [XmlType ("Header")] class SoapHeader { readonly T header; readonly bool must_understand; protected SoapHeader() : this(default(T), false) { } public SoapHeader (T header, bool mustUnderstand) { this.header = header; this.must_understand = mustUnderstand; } [XmlAttribute ("mustUnderstand")] public int MustUnderstand { get { return must_understand ? 1 : 0; } } [XmlAttribute ("actor")] public Uri Actor { get; private set; } [XmlValue] public T Header { get { return header; } } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Internal/IMappable.cs0000664000175000017500000000241411707010776026765 0ustar00lorentzlorentz00000000000000// // IMappable.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. namespace Mono.Upnp.Internal { interface IMappable { T Map (); } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Internal/Map.cs0000664000175000017500000000510611707010776025651 0ustar00lorentzlorentz00000000000000// // Map.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections; using System.Collections.Generic; using Mono.Upnp.Control; namespace Mono.Upnp.Internal { class Map : IMap { readonly IDictionary dictionary; protected IDictionary Dictionary { get { return dictionary; } } public Map (IDictionary dictionary) { this.dictionary = dictionary; } public int Count { get { return dictionary.Count; } } public bool ContainsKey (TKey key) { return dictionary.ContainsKey (key); } public TValue this[TKey key] { get { return dictionary[key]; } } public bool TryGetValue (TKey key, out TValue value) { return dictionary.TryGetValue (key, out value); } public IEnumerable Keys { get { return dictionary.Keys; } } public IEnumerable Values { get { return dictionary.Values; } } public IEnumerator> GetEnumerator () { return dictionary.GetEnumerator (); } IEnumerator IEnumerable.GetEnumerator () { return GetEnumerator (); } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Internal/Func.cs0000664000175000017500000000255711707010776026036 0ustar00lorentzlorentz00000000000000// // Func.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. namespace Mono.Upnp.Internal { // Look Mom, no 3.5 dependency! delegate TResult Func (T argument); delegate TResult Func (T1 argument1, T2 argument2); } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Internal/Log.cs0000664000175000017500000000536311707010776025662 0ustar00lorentzlorentz00000000000000// // Log.cs // // Author: // Aaron Bockover // // Copyright (C) 2008 Novell, Inc. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Diagnostics; namespace Mono.Upnp.Internal { internal static class Log { static bool? enabled; static bool Enabled { get { if (enabled == null) { enabled = Environment.GetEnvironmentVariable ("MONO_UPNP_DEBUG") != null; } return enabled.Value; } } public static void Exception (Exception e) { Error (e.ToString ()); } public static void Exception (string message, Exception e) { Error (string.Format ("{0}, {1}", message, e)); } public static void Error (string message) { if (Enabled) { Console.Error.WriteLine ("Mono.Upnp Error: {0}", message); } } [Conditional ("DEBUG")] public static void Warning (string message) { if (Enabled) { Console.WriteLine ("Mono.Upnp Warning: {0}", message); } } [Conditional ("DEBUG")] public static void Information (string message) { if (Enabled) { Console.WriteLine ("Mono.Upnp Message: {0}", message); } } [Conditional ("TRACE")] public static void Trace (string message) { if (Enabled) { Console.WriteLine ("Mono.Upnp Trace: {0}", message); } } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Internal/Arguments.cs0000664000175000017500000000723511707010776027106 0ustar00lorentzlorentz00000000000000// // Arguments.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using System.Xml; using Mono.Upnp.Control; using Mono.Upnp.Xml; namespace Mono.Upnp.Internal { sealed class Arguments : XmlAutomatable { readonly IDictionary arguments; readonly bool response; Arguments () { arguments = new Dictionary (); } public Arguments (string serviceType, string actionName, IDictionary arguments) : this (serviceType, actionName, arguments, false) { } public Arguments (string serviceType, string actionName, IDictionary arguments, bool response) { ServiceType = serviceType; ActionName = actionName; this.arguments = arguments; this.response = response; } public string ServiceType { get; private set; } public string ActionName { get; private set; } public IDictionary Values { get { return arguments; } } protected override void Serialize (XmlSerializationContext context) { SerializeMembers (context); } protected override void SerializeMembers (XmlSerializationContext context) { var writer = context.Writer; writer.WriteStartElement ("u", response ? ActionName + "Response" : ActionName, ServiceType); foreach (var argument in arguments) { writer.WriteElementString (argument.Key, argument.Value); } writer.WriteEndElement (); } protected override void Deserialize (XmlDeserializationContext context) { // TODO clean this for safety var reader = context.Reader; Helper.ReadToNextElement (reader); ActionName = reader.LocalName; ServiceType = reader.NamespaceURI; var depth = reader.Depth; Helper.ReadToNextElement (reader); while (reader.NodeType == XmlNodeType.Element && reader.Depth > depth) { arguments.Add (reader.LocalName, reader.ReadElementContentAsString ()); while (reader.NodeType != XmlNodeType.Element && reader.Depth > depth) { reader.Read (); } } } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Internal/Helper.cs0000664000175000017500000001204011707010776026346 0ustar00lorentzlorentz00000000000000// // Helper.cs // // Author: // Scott Thomas // // Copyright (C) 2008 S&S Black Ltd. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Net; using System.Net.Sockets; using System.Text; using System.Xml; namespace Mono.Upnp.Internal { static class Helper { public static T Get (WeakReference weakReference) where T : new () { if (weakReference.IsAlive) { return (T)weakReference.Target; } else { var t = new T (); weakReference.Target = t; return t; } } public static IList MakeReadOnlyCopy (IEnumerable items) { var list = items as IList; if (list == null) { if (items == null) { list = new T[0]; } else { list = new List (items); } } return new ReadOnlyCollection (list); } public static CollectionMap MakeReadOnlyCopy (IEnumerable items) where TValue : IMappable { var map = new CollectionMap (); if (items != null) { foreach (var item in items) { map.Add (item); } } map.MakeReadOnly (); return map; } public static bool ReadToNextElement (XmlReader reader) { while (reader.Read ()) { if (reader.NodeType == XmlNodeType.Element) { return true; } } return false; } public static HttpWebResponse GetResponse (Uri location) { return GetResponse ((HttpWebRequest)WebRequest.Create (location)); } public static HttpWebResponse GetResponse (Uri location, int retry) { return GetResponse ((HttpWebRequest)WebRequest.Create (location), retry); } public static HttpWebResponse GetResponse (HttpWebRequest request) { return GetResponse (request, 1); } public static HttpWebResponse GetResponse (HttpWebRequest request, int retry) { request.Timeout = 30000; while(true) { try { var response = (HttpWebResponse)request.GetResponse (); if (response.StatusCode == HttpStatusCode.GatewayTimeout) { throw new WebException ("", WebExceptionStatus.Timeout); } return response; } catch (WebException e) { if (e.Status == WebExceptionStatus.Timeout && retry > 0) { retry--; } else if (e.Response != null) { return (HttpWebResponse)e.Response; } else { throw; } } } } public static string MakeErrorDescription (string errorDescription, string message) { if (message == null) { return errorDescription; } else { return string.Concat (errorDescription, ": ", message); } } public static IEnumerable Flatten(params IEnumerable[] lists) { foreach (var enumerable in lists) { if (enumerable == null) { continue; } foreach (var item in enumerable) { yield return item; } } } public readonly static Encoding UTF8Unsigned = new UTF8Encoding (false); } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Internal/ServiceControllerBuilder.cs0000664000175000017500000004643111707010776032115 0ustar00lorentzlorentz00000000000000// // ServiceControllerBuilder.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Text; using Mono.Upnp.Control; namespace Mono.Upnp.Internal { // FIXME I am not happy with the state of this class. Let's clean it up later. static class ServiceControllerBuilder { class Eventer : StateVariableEventer { public static readonly MethodInfo HandlerMethod = typeof (Eventer).GetMethod ("Handler"); public void Handler (object sender, StateVariableChangedArgs args) { OnStateVariableUpdated (args.NewValue.ToString ()); } } class ArgumentInfo { public Argument Argument; public ParameterInfo ParameterInfo; } class StateVariableInfo { public StateVariable StateVariable; public Type Type; } public static ServiceController Build (T service) { var state_variables = new Dictionary (); return new ServiceController ( BuildActions (service, state_variables), BuildStateVariables (service, state_variables)); } static IEnumerable BuildActions (T service, Dictionary stateVariables) { foreach (var method in typeof (T).GetMethods (BindingFlags.Public | BindingFlags.Instance)) { var action = BuildAction (method, service, stateVariables); if (action != null) { yield return action; } } } readonly static object[] empty_args = new object[0]; static bool Omit (Type type, object service, string unless) { if (unless == null) { return false; } var property = type.GetProperty (unless); if (property == null || property.PropertyType != typeof (bool) || !property.CanRead) { throw new UpnpServiceDefinitionException ( "The OmitUnless property must reference a readable bool property in the same type."); } return property.GetValue (service, empty_args).Equals (false); } static ServiceAction BuildAction (MethodInfo method, object service, Dictionary stateVariables) { var attributes = method.GetCustomAttributes (typeof (UpnpActionAttribute), false); if (attributes.Length != 0) { var attribute = (UpnpActionAttribute)attributes[0]; if (Omit (method.DeclaringType, service, attribute.OmitUnless)) { return null; } var name = string.IsNullOrEmpty (attribute.Name) ? method.Name : attribute.Name; var parameters = method.GetParameters (); var arguments = new ArgumentInfo[parameters.Length]; for (var i = 0; i < parameters.Length; i++) { arguments[i] = BuildArgumentInfo (parameters[i], name, stateVariables); } var return_argument = BuildArgumentInfo (method.ReturnParameter, name, stateVariables, true); return new ServiceAction (name, Combine (arguments, return_argument), args => { Trace (name, args.Values); var argument_array = new object[arguments.Length]; for (var i = 0; i < arguments.Length; i++) { var argument = arguments[i]; if (argument.Argument.Direction == ArgumentDirection.Out) { continue; } string value; if (args.TryGetValue (argument.Argument.Name, out value)) { var parameter_type = argument.ParameterInfo.ParameterType; if (parameter_type.IsEnum) { // TODO handle attributes foreach (var enum_value in Enum.GetValues (parameter_type)) { if (Enum.GetName (parameter_type, enum_value) == value) { argument_array[i] = enum_value; break; } } } else { argument_array[i] = Convert.ChangeType (value, parameter_type); } } else { // TODO throw } } object result; try { result = method.Invoke (service, argument_array); } catch (TargetInvocationException e) { if (e.InnerException is UpnpControlException) { throw e.InnerException; } else { throw new UpnpControlException ( UpnpError.Unknown (), "Unexpected exception.", e.InnerException); } } var out_arguments = new Dictionary (); for (var i = 0; i < arguments.Length; i++) { if (arguments[i].Argument.Direction == ArgumentDirection.In) { continue; } var value = argument_array[i]; out_arguments.Add (arguments[i].Argument.Name, value != null ? value.ToString () : ""); } if (return_argument != null) { out_arguments.Add (return_argument.Argument.Name, result.ToString ()); } Trace (name, out_arguments); return out_arguments; }); } else { return null; } } [Conditional ("TRACE")] static void Trace (string name, IEnumerable values) { var builder = new StringBuilder (); builder.Append (name); builder.Append (" ("); foreach (var value in values) { if (name == null) { builder.Append (", "); } else { name = null; } builder.Append (value); } builder.Append (')'); Log.Trace (builder.ToString ()); } [Conditional ("TRACE")] static void Trace (string name, IDictionary results) { var builder = new StringBuilder (); builder.Append (name); builder.Append (": "); foreach (var result in results) { builder.Append ("\n\t"); builder.Append (result.Key); builder.Append (": "); builder.Append (result.Value); } Log.Trace (builder.ToString ()); } static ArgumentInfo BuildArgumentInfo (ParameterInfo parameterInfo, string actionName, Dictionary stateVariables) { return BuildArgumentInfo(parameterInfo, actionName, stateVariables, false); } static ArgumentInfo BuildArgumentInfo (ParameterInfo parameterInfo, string actionName, Dictionary stateVariables, bool isReturnValue) { if (parameterInfo.ParameterType == typeof (void)) { return null; } var attributes = parameterInfo.GetCustomAttributes (typeof (UpnpArgumentAttribute), false); var attribute = attributes.Length != 0 ? (UpnpArgumentAttribute)attributes[0] : null; var name = attribute != null && !string.IsNullOrEmpty (attribute.Name) ? attribute.Name : (string.IsNullOrEmpty (parameterInfo.Name) ? "result" : parameterInfo.Name); var related_state_variable = BuildRelatedStateVariable ( parameterInfo, actionName, name, stateVariables); var direction = parameterInfo.IsRetval || parameterInfo.ParameterType.IsByRef || isReturnValue ? ArgumentDirection.Out : ArgumentDirection.In; return new ArgumentInfo { ParameterInfo = parameterInfo, Argument = new Argument ( name, related_state_variable.StateVariable.Name, direction, parameterInfo.IsRetval || isReturnValue) }; } static StateVariableInfo BuildRelatedStateVariable (ParameterInfo parameterInfo, string actionName, string argumentName, Dictionary stateVariables) { var attributes = parameterInfo.GetCustomAttributes (typeof (UpnpRelatedStateVariableAttribute), false); var attribute = attributes.Length != 0 ? (UpnpRelatedStateVariableAttribute)attributes[0] : null; var name = attribute != null && !string.IsNullOrEmpty (attribute.Name) ? attribute.Name : CreateRelatedStateVariableName (argumentName); var data_type = attribute != null && !string.IsNullOrEmpty (attribute.DataType) ? attribute.DataType : GetDataType (parameterInfo.ParameterType); var default_value = attribute != null && !string.IsNullOrEmpty (attribute.DefaultValue) ? attribute.DefaultValue : null; var allowed_values = parameterInfo.ParameterType.IsEnum ? BuildAllowedValues (parameterInfo.ParameterType) : null; var allowed_value_range = attribute != null && !string.IsNullOrEmpty (attribute.MinimumValue) ? new AllowedValueRange (attribute.MinimumValue, attribute.MaximumValue, attribute.StepValue) : null; StateVariableInfo state_variable_info; if (stateVariables.TryGetValue (name, out state_variable_info)) { var state_variable = state_variable_info.StateVariable; if (state_variable.DataType != data_type || state_variable.DefaultValue != default_value || state_variable.AllowedValueRange != allowed_value_range || ((state_variable.AllowedValues != null || allowed_values != null) && state_variable_info.Type != parameterInfo.ParameterType)) { if (attribute == null || string.IsNullOrEmpty (attribute.Name)) { name = CreateRelatedStateVariableName (actionName, parameterInfo.Name); } } else { return state_variable_info; } } if (allowed_values != null) { state_variable_info = new StateVariableInfo { StateVariable = new StateVariable (name, allowed_values, new StateVariableOptions { DefaultValue = default_value }), Type = parameterInfo.ParameterType }; } else if (allowed_value_range != null) { state_variable_info = new StateVariableInfo { StateVariable = new StateVariable (name, data_type, allowed_value_range, new StateVariableOptions { DefaultValue = default_value }) }; } else { state_variable_info = new StateVariableInfo { StateVariable = new StateVariable (name, data_type, new StateVariableOptions { DefaultValue = default_value }) }; } stateVariables[name] = state_variable_info; return state_variable_info; } static string CreateRelatedStateVariableName (string name) { return string.Format ("A_ARG_{0}", name); } static string CreateRelatedStateVariableName (string actionName, string argumentName) { return string.Format ("A_ARG_{0}_{1}", actionName, argumentName); } static string GetDataType (Type type) { if (type.IsByRef) { type = type.GetElementType (); } if (type.IsEnum || type == typeof (string)) return "string"; if (type == typeof (int)) return "i4"; if (type == typeof (byte)) return "ui1"; if (type == typeof (ushort)) return "ui2"; if (type == typeof (uint)) return "ui4"; if (type == typeof (sbyte)) return "i1"; if (type == typeof (short)) return "i2"; if (type == typeof (long)) return "int"; // TODO Is this right? The UPnP docs are vague if (type == typeof (float)) return "r4"; if (type == typeof (double)) return "r8"; if (type == typeof (char)) return "char"; if (type == typeof (DateTime)) return "date"; // TODO what about "time"? if (type == typeof (bool)) return "boolean"; if (type == typeof (byte[])) return "bin"; if (type == typeof (Uri)) return "uri"; throw new UpnpServiceDefinitionException (string.Format ("The data type {0} is unsupported.", type)); } static IEnumerable BuildAllowedValues (Type type) { foreach (var field in type.GetFields (BindingFlags.Public | BindingFlags.Static)) { var attributes = field.GetCustomAttributes (typeof (UpnpEnumAttribute), false); var attribute = attributes.Length != 0 ? (UpnpEnumAttribute)attributes[0] : null; if (attribute != null && !string.IsNullOrEmpty (attribute.Name)) { yield return attribute.Name; } else { yield return field.Name; } } } static IEnumerable BuildStateVariables (T service, Dictionary stateVariables) { foreach (var state_variable_info in stateVariables.Values) { yield return state_variable_info.StateVariable; } foreach (var event_info in typeof (T).GetEvents (BindingFlags.Public | BindingFlags.Instance)) { var state_variable = BuildStateVariable (event_info, service, stateVariables); if (state_variable != null) { yield return state_variable; } } } static StateVariable BuildStateVariable (EventInfo eventInfo, object service, Dictionary stateVariables) { var attributes = eventInfo.GetCustomAttributes (typeof (UpnpStateVariableAttribute), false); if (attributes.Length == 0) { return null; } var type = eventInfo.EventHandlerType; if (!type.IsGenericType || type.GetGenericTypeDefinition () != typeof (EventHandler<>)) { throw new UpnpServiceDefinitionException ( "A event must be handled by the type EventHandler>."); } type = type.GetGenericArguments ()[0]; if (!type.IsGenericType || type.GetGenericTypeDefinition () != typeof (StateVariableChangedArgs<>)) { throw new UpnpServiceDefinitionException ( "A event must be handled by the type EventHandler>."); } var attribute = (UpnpStateVariableAttribute)attributes[0]; if (Omit (eventInfo.DeclaringType, service, attribute.OmitUnless)) { return null; } type = type.GetGenericArguments ()[0]; var eventer = new Eventer (); var method = Eventer.HandlerMethod.MakeGenericMethod (new[] { type }); var handler = Delegate.CreateDelegate (eventInfo.EventHandlerType, eventer, method); eventInfo.AddEventHandler (service, handler); var name = string.IsNullOrEmpty (attribute.Name) ? eventInfo.Name : attribute.Name; var data_type = string.IsNullOrEmpty (attribute.DataType) ? GetDataType (type) : attribute.DataType; StateVariableInfo info; if (stateVariables.TryGetValue (name, out info)) { // TODO check type info.StateVariable.SetEventer (eventer, attribute.IsMulticast); return null; } else { return new StateVariable (name, data_type, new StateVariableOptions { Eventer = eventer, IsMulticast = attribute.IsMulticast }); } } static IEnumerable Combine (IEnumerable arguments, ArgumentInfo return_argument) { foreach (var argument in arguments) { yield return argument.Argument; } if (return_argument != null) { yield return return_argument.Argument; } } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Internal/EventServer.cs0000664000175000017500000003362611707010776027414 0ustar00lorentzlorentz00000000000000// // EventServer.cs // // Author: // Scott Thomas // // Copyright (C) 2008 S&S Black Ltd. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Collections.Generic; using System.IO; using System.Net; using System.Text; using System.Threading; using System.Xml; using Mono.Upnp.Control; namespace Mono.Upnp.Internal { sealed class EventServer : UpnpServer { class Subscription { public readonly Uri Callback; public readonly string Sid; public volatile uint Seq; public volatile int ConnectFailures; public uint TimeoutId; public Subscription (Uri callback, string sid) { this.Callback = callback; this.Sid = sid; } } readonly IEnumerable state_variables; volatile bool started; readonly Dictionary subscribers = new Dictionary (); readonly TimeoutDispatcher dispatcher = new TimeoutDispatcher (); readonly List updated_state_variables = new List (); Thread publish_thread; public EventServer (IEnumerable stateVariables, Uri url) : base (url) { this.state_variables = GetEventedStateVariables (stateVariables); } public void QueueUpdate (StateVariable stateVariable) { lock (this) { if (!updated_state_variables.Contains (stateVariable)) { updated_state_variables.Add (stateVariable); Monitor.Pulse (this); } } } public override void Start () { started = true; publish_thread = new Thread (new ThreadStart (Publish)); publish_thread.Start (); base.Start (); } public override void Stop () { started = false; lock (this) { Monitor.Pulse (this); } base.Stop (); } void Publish () { lock (this) { Monitor.Wait (this); while (started) { Monitor.Exit (this); Thread.Sleep (TimeSpan.FromSeconds (1)); Monitor.Enter (this); PublishUpdates (updated_state_variables); updated_state_variables.Clear (); Monitor.Wait (this); } } } void PublishUpdates (IEnumerable stateVariables) { lock (subscribers) { foreach (var subscriber in subscribers.Values) { PublishUpdates (subscriber, stateVariables); } } } void PublishUpdates (Subscription subscriber, IEnumerable stateVariables) { var request = (HttpWebRequest)WebRequest.Create (subscriber.Callback); var seq = subscriber.Seq; request.Method = "NOTIFY"; request.ContentType = "text/xml"; request.Headers.Add ("NT", "upnp:event"); request.Headers.Add ("NTS", "upnp:propchange"); request.Headers.Add ("SID", subscriber.Sid); request.Headers.Add ("SEQ", seq.ToString ()); request.KeepAlive = false; subscriber.Seq++; using (var stream = request.GetRequestStream ()) { using (var writer = XmlWriter.Create (stream, new XmlWriterSettings { Encoding = Helper.UTF8Unsigned })) { writer.WriteProcessingInstruction ("xml", @"version=""1.0"""); writer.WriteStartElement ("e", "propertyset", Protocol.EventSchema); foreach (var state_variable in stateVariables) { writer.WriteStartElement ("property", Protocol.EventSchema); writer.WriteElementString (state_variable.Name, state_variable.Value); writer.WriteEndElement (); } writer.WriteEndElement (); } } request.BeginGetResponse (async => { try { request.EndGetResponse (async).Close (); #pragma warning disable 0420 Interlocked.Exchange (ref subscriber.ConnectFailures, 0); #pragma warning restore 0420 } catch (Exception e) { Log.Exception (string.Format ( "There was a problem publishing updates to subscription {0}.", subscriber.Sid), e); #pragma warning disable 0420 Interlocked.Increment (ref subscriber.ConnectFailures); #pragma warning restore 0420 if (subscriber.ConnectFailures == 2) { lock (subscribers) { if (subscribers.ContainsKey (subscriber.Sid)) { subscribers.Remove (subscriber.Sid); Log.Information (string.Format ( "Subscription {0} failed multiple times and was removed.", subscriber.Sid)); } } } } }, null); } protected override void HandleContext (HttpListenerContext context) { base.HandleContext (context); var method = context.Request.HttpMethod.ToUpper (); if (method == "SUBSCRIBE") { var callback = context.Request.Headers["CALLBACK"]; if (callback != null) { Subscribe (context, callback); } else { Renew (context); } } else if (method == "UNSUBSCRIBE") { Unsubscribe (context); } else { Log.Warning (string.Format ( "A request from {0} to {1} uses an unsupported HTTP method: {2}.", context.Request.RemoteEndPoint, context.Request.Url, method)); } } void Subscribe (HttpListenerContext context, string callback) { var url_string = callback.Length < 3 ? null : callback.Substring (1, callback.Length - 2); if (url_string == null || !Uri.IsWellFormedUriString (url_string, UriKind.Absolute)) { Log.Error (string.Format ( "The subscription request from {0} to {1} provided an illegal callback: {2}.", context.Request.RemoteEndPoint, context.Request.Url, callback)); return; } var url = new Uri (url_string); if (url.Scheme != Uri.UriSchemeHttp) { Log.Error (string.Format ( "The callback for the subscription request from {0} to {1} is not HTTP: {2}.", context.Request.RemoteEndPoint, context.Request.Url, url)); return; } var uuid = string.Format ("uuid:{0}", Guid.NewGuid ()); var subscriber = new Subscription (url, uuid); if (!HandleSubscription (context, subscriber)) { Log.Error (string.Format ( "{0} from {1} failed to subscribe to {0}.", subscriber.Callback, context.Request.RemoteEndPoint, context.Request.Url)); return; } lock (subscribers) { subscribers.Add (uuid, subscriber); } Log.Information (string.Format ( "{0} from {1} subscribed to {2} as {3}.", subscriber.Callback, context.Request.RemoteEndPoint, context.Request.Url, subscriber.Sid)); // NOTE: This will cause an exception in UpnpServer when it tries to close the OutputStream // I think we should be ok just closing the response and it should handle closing the OutputStream, but not sure // We have to finish responding with our previous context otherwise the updates don't mean anything to the client // The client won't have an SID so it won't make sense to publish the updates yet context.Response.OutputStream.Close(); context.Response.Close(); PublishUpdates (subscriber, state_variables); } void Renew (HttpListenerContext context) { var sid = context.Request.Headers["SID"]; if (sid == null) { Log.Error (string.Format ( "A subscription request from {0} to {1} provided neither a CALLBACK nor a SID.", context.Request.RemoteEndPoint, context.Request.Url)); return; } Subscription subscription; lock (subscribers) { if (!subscribers.TryGetValue (sid, out subscription)) { Log.Error (string.Format ( "A renewal request from {0} to {1} was for subscription {2} which does not exist.", context.Request.RemoteEndPoint, context.Request.Url, sid)); return; } } if (!HandleSubscription (context, subscription)) { Log.Error (string.Format ("Failed to renew subscription {0}.", sid)); return; } Log.Information (string.Format ("Subscription {0} was renewed.", sid)); } void Unsubscribe (HttpListenerContext context) { var sid = context.Request.Headers["SID"]; if (sid == null) { Log.Error (string.Format ( "An unsubscribe request from {0} to {1} did not provide an SID.", context.Request.RemoteEndPoint, context.Request.Url)); return; } Subscription subscription; lock (subscribers) { if (!subscribers.TryGetValue (sid, out subscription)) { Log.Error (string.Format ( "An unsubscribe request from {0} to {1} was for subscription {2} which does not exist.", context.Request.RemoteEndPoint, context.Request.Url, sid)); return; } subscribers.Remove (sid); } dispatcher.Remove (subscription.TimeoutId); Log.Information (string.Format ("Subscription {0} was canceled.", sid)); } bool HandleSubscription (HttpListenerContext context, Subscription subscriber) { dispatcher.Remove (subscriber.TimeoutId); var timeout = context.Request.Headers["TIMEOUT"] ?? "Second-1800"; if (timeout != "infinite") { int time; if (timeout.Length > 7 && int.TryParse (timeout.Substring (7), out time)) { subscriber.TimeoutId = dispatcher.Add (TimeSpan.FromSeconds (time), OnTimeout, subscriber.Sid); } else { Log.Error (string.Format ( "Subscription request {0} from {1} to {2} has an illegal TIMEOUT value: {3}", subscriber.Callback, context.Request.RemoteEndPoint, context.Request.Url, timeout)); return false; } } context.Response.AddHeader ("DATE", DateTime.Now.ToString ("r")); context.Response.AddHeader ("SERVER", Protocol.UserAgent); context.Response.AddHeader ("SID", subscriber.Sid); context.Response.AddHeader ("TIMEOUT", timeout); context.Response.StatusCode = 200; context.Response.StatusDescription = "OK"; return true; } bool OnTimeout (object state, ref TimeSpan interval) { lock (subscribers) { subscribers.Remove ((string)state); } Log.Information (string.Format ("Subscription {0} expired and was removed.", state)); return false; } static IEnumerable GetEventedStateVariables (IEnumerable stateVariables) { foreach (var state_variable in stateVariables) { if (state_variable.SendsEvents) { yield return state_variable; } } } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Internal/SoapFault.cs0000664000175000017500000000351711707010776027036 0ustar00lorentzlorentz00000000000000// // SoapFault.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using Mono.Upnp.Internal; using Mono.Upnp.Xml; namespace Mono.Upnp.Internal { [XmlType ("Fault", Protocol.SoapEnvelopeSchema, "s")] class SoapFault { public SoapFault () { } public SoapFault (T detail) { FaultCode = "s:Client"; FaultString = "UPnPError"; Detail = detail; } [XmlElement ("faultcode")] public string FaultCode { get; set; } [XmlElement ("faultstring")] public string FaultString { get; set; } [XmlElement ("detail")] public T Detail { get; set; } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Internal/Protocol.cs0000664000175000017500000000377411707010776026746 0ustar00lorentzlorentz00000000000000// // Protocol.cs // // Author: // Scott Thomas // // Copyright (C) 2008 S&S Black Ltd. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; namespace Mono.Upnp.Internal { static class Protocol { public const string DeviceSchema = "urn:schemas-upnp-org:device-1-0"; public const string ServiceSchema = "urn:schemas-upnp-org:service-1-0"; public const string ControlSchema = "urn:schemas-upnp-org:control-1-0"; public const string EventSchema = "urn:schemas-upnp-org:event-1-0"; public const string SoapEnvelopeSchema = "http://schemas.xmlsoap.org/soap/envelope/"; public const string SoapEncodingSchema = "http://schemas.xmlsoap.org/soap/encoding/"; // TODO make this better public readonly static string UserAgent = string.Format ( "{0}/{1} UPnp/1.1 Mono.Upnp/1.0", Environment.OSVersion.Platform, Environment.OSVersion.Version); } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Internal/EventClient.cs0000664000175000017500000002675011707010776027364 0ustar00lorentzlorentz00000000000000// // EventClient.cs // // Author: // Scott Thomas // // Copyright (C) 2008 S&S Black Ltd. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Net; using System.Net.Sockets; using System.Xml; using Mono.Upnp.Control; namespace Mono.Upnp.Internal { class EventClient : IDisposable { static readonly Random random = new Random (); static int id; readonly IMap state_variables; readonly Uri url; readonly TimeoutDispatcher dispatcher = new TimeoutDispatcher (); readonly string prefix = GeneratePrefix (); volatile bool started; volatile bool confidently_subscribed; HttpListener listener; uint expire_timeout_id; uint renew_timeout_id; string subscription_uuid; int ref_count; public EventClient (IMap stateVariable, Uri url) { this.state_variables = stateVariable; this.url = url; } static string GeneratePrefix () { // FIXME configure the network interface foreach (var address in Dns.GetHostAddresses (Dns.GetHostName ())) { if (address.AddressFamily == AddressFamily.InterNetwork) { return string.Format ( "http://{0}:{1}/upnp/event-subscriber/{2}/", address, random.Next (1024, 5000), id++); } } return null; } public void Ref () { if (ref_count == 0) { Start (); } ref_count++; } public void Unref () { ref_count--; if (ref_count == 0) { Stop (); } } public void Start () { if (started) { return; } StartListening (); Subscribe (); started = true; } void StartListening () { if (listener == null) { listener = new HttpListener { IgnoreWriteExceptions = true }; listener.Prefixes.Add (prefix); } lock (listener) { listener.Start (); listener.BeginGetContext (OnGotContext, null); } } void OnGotContext (IAsyncResult asyncResult) { lock (listener) { if (!listener.IsListening) { return; } var context = listener.EndGetContext (asyncResult); try { using (var stream = context.Request.InputStream) { using (var reader = XmlReader.Create (stream)) { if (reader.MoveToContent () != XmlNodeType.Element) { Log.Warning ("The event update has no root XML element."); } else if (reader.LocalName != "propertyset" && reader.NamespaceURI != Protocol.EventSchema) { Log.Warning ("The event update has no propertyset."); } else if (!reader.ReadToDescendant ("property", Protocol.EventSchema)) { Log.Warning ("The event update has an empty propertyset."); } else { do { reader.Read (); StateVariable state_variable; if (state_variables.TryGetValue (reader.Name, out state_variable)) { state_variable.Value = reader.ReadElementContentAsString (); } else { Log.Warning (string.Format ( "{0} published an event update to {1} " + "which includes unknown state variable {2}.", context.Request.RemoteEndPoint, context.Request.Url, reader.Name)); } } while (reader.ReadToNextSibling ("property", Protocol.EventSchema)); } } } } catch (Exception e) { Log.Exception (string.Format ("There was a problem processing an event update from {0} to {1}.", context.Request.RemoteEndPoint, context.Request.Url), e); } context.Response.Close (); listener.BeginGetContext (OnGotContext, null); } } void StopListening () { lock (listener) { listener.Stop (); } } void Subscribe () { var request = WebRequest.Create (url); request.Method = "SUBSCRIBE"; request.Headers.Add ("USERAGENT", Protocol.UserAgent); request.Headers.Add ("CALLBACK", string.Format ("<{0}>", prefix)); request.Headers.Add ("NT", "upnp:event"); request.Headers.Add ("TIMEOUT", "Second-1800"); lock (this) { request.BeginGetResponse (OnSubscribeResponse, request); expire_timeout_id = dispatcher.Add (TimeSpan.FromSeconds (30), OnSubscribeTimeout, request); confidently_subscribed = false; } } bool OnSubscribeTimeout (object state, ref TimeSpan interval) { lock (this) { expire_timeout_id = 0; if (!confidently_subscribed) { var request = (WebRequest)state; request.Abort (); Stop (); // TODO retry Log.Error ("Failed to subscribe or renew. The server did not respond in 30 seconds."); //controller.Description.CheckDisposed (); } } return false; } void OnSubscribeResponse (IAsyncResult asyncResult) { lock (this) { if (expire_timeout_id != 0) { dispatcher.Remove (expire_timeout_id); } var request = (WebRequest)asyncResult.AsyncState; try { using (var response = (HttpWebResponse)request.EndGetResponse (asyncResult)) { if (response.StatusCode == HttpStatusCode.GatewayTimeout) { throw new WebException ("", WebExceptionStatus.Timeout); } else if (response.StatusCode != HttpStatusCode.OK) { throw new WebException (); } else if (!started) { return; } confidently_subscribed = true; subscription_uuid = response.Headers["SID"]; var timeout_header = response.Headers["TIMEOUT"]; if (timeout_header == "infinate") { return; } var timeout = TimeSpan.FromSeconds (double.Parse (timeout_header.Substring (7))); if (timeout > TimeSpan.FromMinutes (2)) { timeout -= TimeSpan.FromMinutes (2); } renew_timeout_id = dispatcher.Add (timeout, OnRenewTimeout); } } catch (WebException e) { Stop (); // TODO more info Log.Exception (new UpnpException ("Failed to subscribe or renew.", e)); if (e.Status == WebExceptionStatus.Timeout) { //controller.Description.CheckDisposed (); } } } } bool OnRenewTimeout (object state, ref TimeSpan interval) { lock (this) { renew_timeout_id = 0; if (started) { Renew (); } return false; } } void Renew () { lock (this) { var request = WebRequest.Create (url); request.Method = "SUBSCRIBE"; request.Headers.Add ("SID", subscription_uuid); request.Headers.Add ("TIMEOUT", "Second-1800"); request.BeginGetResponse (OnSubscribeResponse, request); expire_timeout_id = dispatcher.Add (TimeSpan.FromSeconds (30), OnSubscribeTimeout, request); confidently_subscribed = false; } } void Unsubscribe () { lock (this) { var request = WebRequest.Create (url); request.Method = "UNSUBSCRIBE"; request.Headers.Add ("SID", subscription_uuid); request.BeginGetResponse (OnUnsubscribeResponse, request); confidently_subscribed = false; } } void OnUnsubscribeResponse (IAsyncResult asyncResult) { try { ((WebRequest)asyncResult).EndGetResponse (asyncResult).Close (); } catch { } } public void Stop () { if (!started) { return; } if (renew_timeout_id != 0) { dispatcher.Remove (renew_timeout_id); renew_timeout_id = 0; } if (expire_timeout_id != 0) { dispatcher.Remove (expire_timeout_id); expire_timeout_id = 0; } lock (this) { if (confidently_subscribed) { Unsubscribe (); } } StopListening (); started = false; } public void Dispose () { Stop (); lock (listener) { listener.Close (); } } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Internal/TimeoutDispatcher.cs0000664000175000017500000001373211707010776030575 0ustar00lorentzlorentz00000000000000// // TimeoutDispatcher.cs // // Author: // Aaron Bockover // // Copyright (C) 2008 Novell, Inc. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Collections.Generic; using System.Threading; namespace Mono.Upnp.Internal { delegate bool TimeoutHandler (object state, ref TimeSpan interval); sealed class TimeoutDispatcher : IDisposable { private static uint timeout_ids = 1; private struct TimeoutItem : IComparable { public uint Id; public TimeSpan Timeout; public DateTime Trigger; public TimeoutHandler Handler; public object State; public int CompareTo (TimeoutItem item) { return Trigger.CompareTo (item.Trigger); } public override string ToString () { return String.Format ("{0} ({1})", Id, Trigger); } } private bool disposed; private AutoResetEvent wait = new AutoResetEvent (false); private List timeouts = new List (); public uint Add (uint timeoutMs, TimeoutHandler handler) { return Add (timeoutMs, handler, null); } public uint Add (TimeSpan timeout, TimeoutHandler handler) { return Add (timeout, handler, null); } public uint Add (uint timeoutMs, TimeoutHandler handler, object state) { return Add (TimeSpan.FromMilliseconds (timeoutMs), handler, state); } public uint Add (DateTime timeout, TimeoutHandler handler, object state) { return Add (timeout - DateTime.Now, handler, state); } public uint Add (TimeSpan timeout, TimeoutHandler handler, object state) { lock (this) { CheckDisposed (); TimeoutItem item = new TimeoutItem (); item.Id = timeout_ids++; item.Timeout = timeout; item.Trigger = DateTime.Now + timeout; item.Handler = handler; item.State = state; Add (ref item); if (timeouts.Count == 1) { Start (); } return item.Id; } } private void Add (ref TimeoutItem item) { lock (timeouts) { int index = timeouts.BinarySearch (item); index = index >= 0 ? index : ~index; timeouts.Insert (index, item); if (index == 0 && timeouts.Count > 1) { wait.Set (); } } } public void Remove (uint id) { lock (timeouts) { CheckDisposed (); // FIXME: Comparer for BinarySearch for (int i = 0; i < timeouts.Count; i++) { if (timeouts[i].Id == id) { timeouts.RemoveAt (i); if (i == 0) { wait.Set (); } return; } } } } private void Start () { wait.Reset (); ThreadPool.QueueUserWorkItem (TimerThread); } private void TimerThread (object state) { while (true) { TimeoutItem item; lock (timeouts) { if (timeouts.Count == 0) { break; } item = timeouts[0]; } TimeSpan interval = item.Trigger - DateTime.Now; if (interval < TimeSpan.Zero) { interval = TimeSpan.Zero; } if (!wait.WaitOne (interval, false)) { bool requeue = item.Handler (item.State, ref item.Timeout); lock (timeouts) { Remove (item.Id); if (requeue) { item.Trigger += item.Timeout; Add (ref item); } } } } } public void Clear () { lock (timeouts) { timeouts.Clear (); wait.Set (); } } private void CheckDisposed () { if (disposed) { throw new ObjectDisposedException (ToString ()); } } public void Dispose () { if (disposed) { return; } Clear (); wait.Close (); disposed = true; } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Internal/ControlServer.cs0000664000175000017500000001517711707010776027754 0ustar00lorentzlorentz00000000000000// // ControlServer.cs // // Author: // Scott Thomas // // Copyright (C) 2008 S&S Black Ltd. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.IO; using System.Net; using System.Reflection; using System.Xml; using Mono.Upnp.Control; using Mono.Upnp.Xml; namespace Mono.Upnp.Internal { sealed class ControlServer : UpnpServer { static readonly WeakReference static_deserializer = new WeakReference (null); readonly IMap actions; readonly string service_type; readonly XmlSerializer serializer; readonly XmlDeserializer deserializer; public ControlServer (IMap actions, string serviceType, Uri url, XmlSerializer serializer) : base (url) { this.actions = actions; this.service_type = serviceType; this.serializer = serializer; this.deserializer = Helper.Get (static_deserializer); } protected override void HandleContext (HttpListenerContext context) { base.HandleContext (context); context.Response.ContentType = @"text/xml; charset=""utf-8"""; context.Response.AddHeader ("EXT", string.Empty); using (var reader = XmlReader.Create (context.Request.InputStream)) { // FIXME this is a workaround for mono bug 523151 if (reader.MoveToContent () != XmlNodeType.Element) { Log.Error (string.Format ( "A control request from {0} to {1} does not have a SOAP envelope.", context.Request.RemoteEndPoint, context.Request.Url)); return; } SoapEnvelope requestEnvelope; try { requestEnvelope = deserializer.Deserialize> (reader); } catch (Exception e) { Log.Exception (string.Format ( "Failed to deserialize a control request from {0} to {1}.", context.Request.RemoteEndPoint, context.Request.Url), e); return; } if (requestEnvelope == null) { Log.Error (string.Format ( "A control request from {0} to {1} does not have a valid SOAP envelope.", context.Request.RemoteEndPoint, context.Request.Url)); return; } var arguments = requestEnvelope.Body; if (arguments == null) { Log.Error (string.Format ( "A control request from {0} to {1} does not have a valid argument list.", context.Request.RemoteEndPoint, context.Request.Url)); return; } if (arguments.ActionName == null) { Log.Error (string.Format ( "A control request from {0} to {1} does not have an action name.", context.Request.RemoteEndPoint, context.Request.Url)); return; } ServiceAction action; try { if (actions.TryGetValue (arguments.ActionName, out action)) { Log.Information (string.Format ("{0} invoked {1} on {2}.", context.Request.RemoteEndPoint, arguments.ActionName, context.Request.Url)); Arguments result; try { result = new Arguments ( service_type, action.Name, action.Execute (arguments.Values), true); } catch (UpnpControlException) { throw; } catch (Exception e) { throw new UpnpControlException (UpnpError.Unknown (), "Unexpected exception.", e); } // TODO If we're allowing consumer code to subclass Argument, then we need to expose that in a // Mono.Upnp.Serializer class. We would then need to put this in a try/catch because custom // serialization code could throw. serializer.Serialize (new SoapEnvelope (result), context.Response.OutputStream); } else { throw new UpnpControlException (UpnpError.InvalidAction (), string.Format ( "{0} attempted to invoke the non-existant action {1} on {2}.", context.Request.RemoteEndPoint, arguments.ActionName, context.Request.Url)); } } catch (UpnpControlException e) { Log.Exception (e); context.Response.StatusCode = 500; context.Response.StatusDescription = "Internal Server Error"; // TODO This needs to be a try/catch in the future too. serializer.Serialize (new SoapEnvelope> ( new SoapFault (e.UpnpError)), context.Response.OutputStream); } } } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Internal/UpnpServer.cs0000664000175000017500000000607711707010776027255 0ustar00lorentzlorentz00000000000000// // UpnpServer.cs // // Author: // Scott Thomas // // Copyright (C) 2008 S&S Black Ltd. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Net; namespace Mono.Upnp.Internal { abstract class UpnpServer : IDisposable { readonly HttpListener listener; protected UpnpServer (Uri url) { listener = new HttpListener { IgnoreWriteExceptions = true }; listener.Prefixes.Add (url.ToString ()); } public virtual void Start () { listener.Start (); listener.BeginGetContext (OnGetContext, null); } void OnGetContext (IAsyncResult asyncResult) { lock (listener) { if (!listener.IsListening) { return; } var context = listener.EndGetContext (asyncResult); HandleContext (context); try { // FIXME this is a bug in Mono context.Response.OutputStream.Close(); context.Response.Close(); } catch (ObjectDisposedException) { // If we already completed the context in HandleContext we may get this exception, just ignore it... } listener.BeginGetContext (OnGetContext, null); } } protected virtual void HandleContext (HttpListenerContext context) { context.Response.AppendHeader ("SERVER", Protocol.UserAgent); context.Response.AppendHeader ("DATE", DateTime.Now.ToUniversalTime ().ToString ("r")); } public virtual void Stop () { lock (listener) { listener.Stop (); } } public virtual void Dispose () { lock (listener) { listener.Close (); } } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp.GtkClient/0000775000175000017500000000000011761740036023061 5ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp.GtkClient/gtk-gui/0000775000175000017500000000000011761740036024430 5ustar00lorentzlorentz00000000000000Mono.Upnp.GtkClient.ActionInvocationWindow.cs0000664000175000017500000000644311715013277035060 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp.GtkClient/gtk-gui // This file has been generated by the GUI designer. Do not modify. namespace Mono.Upnp.GtkClient { public partial class ActionInvocationWindow { private global::Gtk.VBox vbox; private global::Gtk.Label name; private global::Gtk.VBox inputsBox; private global::Gtk.Button invoke; private global::Gtk.VBox outputsBox; protected virtual void Build () { global::Stetic.Gui.Initialize (this); // Widget Mono.Upnp.GtkClient.ActionInvocationWindow this.WidthRequest = 0; this.HeightRequest = 0; this.Name = "Mono.Upnp.GtkClient.ActionInvocationWindow"; this.Title = "Invoke Action"; this.WindowPosition = ((global::Gtk.WindowPosition)(1)); this.DefaultWidth = 0; this.DefaultHeight = 0; // Container child Mono.Upnp.GtkClient.ActionInvocationWindow.Gtk.Container+ContainerChild this.vbox = new global::Gtk.VBox (); this.vbox.Name = "vbox"; this.vbox.Spacing = 6; this.vbox.BorderWidth = ((uint)(6)); // Container child vbox.Gtk.Box+BoxChild this.name = new global::Gtk.Label (); this.name.Name = "name"; this.name.Xalign = 0F; this.name.LabelProp = "action"; this.name.UseMarkup = true; this.vbox.Add (this.name); global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.vbox [this.name])); w1.Position = 0; w1.Expand = false; w1.Fill = false; // Container child vbox.Gtk.Box+BoxChild this.inputsBox = new global::Gtk.VBox (); this.inputsBox.Name = "inputsBox"; this.inputsBox.Spacing = 6; this.vbox.Add (this.inputsBox); global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox [this.inputsBox])); w2.Position = 1; // Container child vbox.Gtk.Box+BoxChild this.invoke = new global::Gtk.Button (); this.invoke.CanFocus = true; this.invoke.Name = "invoke"; this.invoke.UseUnderline = true; this.invoke.Relief = ((global::Gtk.ReliefStyle)(2)); // Container child invoke.Gtk.Container+ContainerChild global::Gtk.Alignment w3 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F); // Container child GtkAlignment.Gtk.Container+ContainerChild global::Gtk.HBox w4 = new global::Gtk.HBox (); w4.Spacing = 2; // Container child GtkHBox.Gtk.Container+ContainerChild global::Gtk.Image w5 = new global::Gtk.Image (); w5.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-execute", global::Gtk.IconSize.Menu); w4.Add (w5); // Container child GtkHBox.Gtk.Container+ContainerChild global::Gtk.Label w7 = new global::Gtk.Label (); w7.LabelProp = global::Mono.Unix.Catalog.GetString ("_Invoke"); w7.UseUnderline = true; w4.Add (w7); w3.Add (w4); this.invoke.Add (w3); this.vbox.Add (this.invoke); global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.vbox [this.invoke])); w11.Position = 2; w11.Expand = false; w11.Fill = false; // Container child vbox.Gtk.Box+BoxChild this.outputsBox = new global::Gtk.VBox (); this.outputsBox.Name = "outputsBox"; this.outputsBox.Spacing = 6; this.vbox.Add (this.outputsBox); global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.vbox [this.outputsBox])); w12.Position = 3; this.Add (this.vbox); if ((this.Child != null)) { this.Child.ShowAll (); } this.Show (); this.invoke.Clicked += new global::System.EventHandler (this.OnInvokeClicked); } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp.GtkClient/gtk-gui/Mono.Upnp.GtkClient.LazyDeviceInfo.cs0000664000175000017500000000210011715013277033335 0ustar00lorentzlorentz00000000000000 // This file has been generated by the GUI designer. Do not modify. namespace Mono.Upnp.GtkClient { public partial class LazyDeviceInfo { private global::Gtk.Alignment alignment; private global::Gtk.Label loading; protected virtual void Build () { global::Stetic.Gui.Initialize (this); // Widget Mono.Upnp.GtkClient.LazyDeviceInfo global::Stetic.BinContainer.Attach (this); this.Name = "Mono.Upnp.GtkClient.LazyDeviceInfo"; // Container child Mono.Upnp.GtkClient.LazyDeviceInfo.Gtk.Container+ContainerChild this.alignment = new global::Gtk.Alignment (0.5F, 0.5F, 1F, 1F); this.alignment.Name = "alignment"; // Container child alignment.Gtk.Container+ContainerChild this.loading = new global::Gtk.Label (); this.loading.Name = "loading"; this.loading.LabelProp = global::Mono.Unix.Catalog.GetString ("Loading"); this.alignment.Add (this.loading); this.Add (this.alignment); if ((this.Child != null)) { this.Child.ShowAll (); } this.Hide (); this.Mapped += new global::System.EventHandler (this.OnMapped); } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp.GtkClient/gtk-gui/Mono.Upnp.GtkClient.MainWindow.cs0000664000175000017500000000572211715013277032553 0ustar00lorentzlorentz00000000000000 // This file has been generated by the GUI designer. Do not modify. namespace Mono.Upnp.GtkClient { public partial class MainWindow { private global::Gtk.UIManager UIManager; private global::Gtk.VBox vbox1; private global::Gtk.HPaned hpaned; private global::Gtk.ScrolledWindow GtkScrolledWindow; private global::Gtk.TreeView list; private global::Gtk.VBox infoBox; private global::Gtk.Label infoFiller; protected virtual void Build () { global::Stetic.Gui.Initialize (this); // Widget Mono.Upnp.GtkClient.MainWindow this.UIManager = new global::Gtk.UIManager (); global::Gtk.ActionGroup w1 = new global::Gtk.ActionGroup ("Default"); this.UIManager.InsertActionGroup (w1, 0); this.AddAccelGroup (this.UIManager.AccelGroup); this.WidthRequest = 0; this.HeightRequest = 0; this.Name = "Mono.Upnp.GtkClient.MainWindow"; this.Title = global::Mono.Unix.Catalog.GetString ("Mono.Upnp"); this.WindowPosition = ((global::Gtk.WindowPosition)(1)); // Container child Mono.Upnp.GtkClient.MainWindow.Gtk.Container+ContainerChild this.vbox1 = new global::Gtk.VBox (); this.vbox1.Name = "vbox1"; this.vbox1.Spacing = 6; // Container child vbox1.Gtk.Box+BoxChild this.hpaned = new global::Gtk.HPaned (); this.hpaned.CanFocus = true; this.hpaned.Name = "hpaned"; this.hpaned.Position = 354; this.hpaned.BorderWidth = ((uint)(5)); // Container child hpaned.Gtk.Paned+PanedChild this.GtkScrolledWindow = new global::Gtk.ScrolledWindow (); this.GtkScrolledWindow.Name = "GtkScrolledWindow"; this.GtkScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1)); // Container child GtkScrolledWindow.Gtk.Container+ContainerChild this.list = new global::Gtk.TreeView (); this.list.CanFocus = true; this.list.Name = "list"; this.GtkScrolledWindow.Add (this.list); this.hpaned.Add (this.GtkScrolledWindow); global::Gtk.Paned.PanedChild w3 = ((global::Gtk.Paned.PanedChild)(this.hpaned [this.GtkScrolledWindow])); w3.Resize = false; // Container child hpaned.Gtk.Paned+PanedChild this.infoBox = new global::Gtk.VBox (); this.infoBox.Name = "infoBox"; this.infoBox.Spacing = 6; // Container child infoBox.Gtk.Box+BoxChild this.infoFiller = new global::Gtk.Label (); this.infoFiller.Name = "infoFiller"; this.infoFiller.LabelProp = global::Mono.Unix.Catalog.GetString ("Select a device or service"); this.infoBox.Add (this.infoFiller); global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.infoBox [this.infoFiller])); w4.Position = 0; w4.Fill = false; this.hpaned.Add (this.infoBox); this.vbox1.Add (this.hpaned); global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.hpaned])); w6.Position = 0; this.Add (this.vbox1); if ((this.Child != null)) { this.Child.ShowAll (); } this.DefaultWidth = 1077; this.DefaultHeight = 527; this.Show (); this.DeleteEvent += new global::Gtk.DeleteEventHandler (this.OnDeleteEvent); } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp.GtkClient/gtk-gui/gui.stetic0000664000175000017500000016072311715013277026441 0ustar00lorentzlorentz00000000000000 .. 2.12 stock:gtk-harddisk Menu stock:gtk-execute Menu stock:gtk-go-forward Menu stock:gtk-go-back Menu stock:gtk-go-up Menu False 11 2 10 10 10 0 deviceType True 1 2 True Fill Fill False True False False True False 0 friendlyName True 2 3 1 2 True Fill Fill False True False False True False 6 10 11 1 2 True Fill Fill False True False False True False 1 0 <b>Icons</b> True 10 11 True Fill Fill False True False False True False 1 <b>UPC</b> True 9 10 True Fill Fill False True False False True False 1 <b>Device Type</b> True True Fill Fill False True False False True False 1 <b>UDN</b> True 1 2 True Fill Fill False True False False True False 1 <b>Friendly Name</b> True 2 3 True Fill Fill False True False False True False 1 <b>Manufacturer</b> True 3 4 True Fill Fill False True False False True False 1 <b>Manufacturer URL</b> True 4 5 True Fill Fill False True False False True False 1 <b>Model Name</b> True 5 6 True Fill Fill False True False False True False 1 <b>Model Number</b> True 6 7 True Fill Fill False True False False True False 1 <b>Model URL</b> True 7 8 True Fill Fill False True False False True False 1 <b>Serial Number</b> True 8 9 True Fill Fill False True False False True False 0 manufacturer True 3 4 1 2 True Fill Fill False True False False True False 0 manufacturerUrl True 4 5 1 2 True Fill Fill False True False False True False 0 modelUrl True 5 6 1 2 True Fill Fill False True False False True False 0 modelNumber True 6 7 1 2 True Fill Fill False True False False True False 0 modelUrl True 7 8 1 2 True Fill Fill False True False False True False 0 serialNumber True 8 9 1 2 True Fill Fill False True False False True False 0 udn True 1 2 1 2 True Fill Fill False True False False True False 0 upc True 9 10 1 2 True Fill Fill False True False False True False False 3 2 10 10 10 0 deviceType True 1 2 True Fill Fill False True False False True False 1 <b>Device Type</b> True True Fill Fill False True False False True False 1 <b>UDN</b> True 1 2 True Fill Fill False True False False True False 1 0 <b>Locations</b> True 2 3 False Fill Fill False True False False True False 6 2 3 1 2 True Fill Fill False True False False True False 0 udn True 1 2 1 2 True Fill Fill False True False False True False False Loading 0 0 Mono.Upnp Center 6 True 354 5 In True True False 6 Select a device or service 0 False False 0 False False Loading False 3 2 10 10 10 0 deviceUdn True 1 2 1 2 True Fill Fill False True False False True False 1 <b>Service Type</b> True True Fill Fill False True False False True False 1 <b>Device UDN</b> True 1 2 True Fill Fill False True False False True False 1 0 <b>Locations</b> True 2 3 True Fill Fill False True False False True False 6 2 3 1 2 True Fill Fill False True False False True False 0 serviceType True 1 2 True Fill Fill False True False False True False False 5 2 10 10 10 0 controlUrl True 3 4 1 2 True Fill Fill False True False False True False 0 eventUrl True 4 5 1 2 True Fill Fill False True False False True False 1 <b>Control URL</b> True 3 4 True Fill Fill False True False False True False 1 <b>Event URL</b> True 4 5 True Fill Fill False True False False True False 1 <b>ServiceType</b> True True Fill Fill False True False False True False 1 <b>Service ID</b> True 1 2 True Fill Fill False True False False True False 1 <b>SCPD URL</b> True 2 3 True Fill Fill False True False False True False 0 scpdUrl True 2 3 1 2 True Fill Fill False True False False True False 0 serviceId True 1 2 1 2 True Fill Fill False True False False True False 0 serviceType True 1 2 True Fill Fill False True False False True False False Loading Icon False 6 In True True 0 True In True True 1 True False True In None 6 True False 0 True 0 0 Invoke Action Center 0 0 6 6 0 <big><b>action</b></big> True 0 True False False 6 1 True True TextAndIcon stock:gtk-execute Menu _Invoke True None 2 True False False 6 3 True mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp.GtkClient/gtk-gui/Mono.Upnp.GtkClient.LazyServiceInfo.cs0000664000175000017500000000210411715013277033542 0ustar00lorentzlorentz00000000000000 // This file has been generated by the GUI designer. Do not modify. namespace Mono.Upnp.GtkClient { public partial class LazyServiceInfo { private global::Gtk.Alignment alignment; private global::Gtk.Label loading; protected virtual void Build () { global::Stetic.Gui.Initialize (this); // Widget Mono.Upnp.GtkClient.LazyServiceInfo global::Stetic.BinContainer.Attach (this); this.Name = "Mono.Upnp.GtkClient.LazyServiceInfo"; // Container child Mono.Upnp.GtkClient.LazyServiceInfo.Gtk.Container+ContainerChild this.alignment = new global::Gtk.Alignment (0.5F, 0.5F, 1F, 1F); this.alignment.Name = "alignment"; // Container child alignment.Gtk.Container+ContainerChild this.loading = new global::Gtk.Label (); this.loading.Name = "loading"; this.loading.LabelProp = global::Mono.Unix.Catalog.GetString ("Loading"); this.alignment.Add (this.loading); this.Add (this.alignment); if ((this.Child != null)) { this.Child.ShowAll (); } this.Hide (); this.Mapped += new global::System.EventHandler (this.OnMapped); } } } Mono.Upnp.GtkClient.DeviceDescriptionInfo.cs0000664000175000017500000003455711715013277034647 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp.GtkClient/gtk-gui // This file has been generated by the GUI designer. Do not modify. namespace Mono.Upnp.GtkClient { public partial class DeviceDescriptionInfo { private global::Gtk.Table table1; private global::Gtk.Label deviceType; private global::Gtk.Label friendlyName; private global::Gtk.VBox iconBox; private global::Gtk.Label label1; private global::Gtk.Label label10; private global::Gtk.Label label11; private global::Gtk.Label label2; private global::Gtk.Label label3; private global::Gtk.Label label4; private global::Gtk.Label label5; private global::Gtk.Label label6; private global::Gtk.Label label7; private global::Gtk.Label label8; private global::Gtk.Label label9; private global::Gtk.Label manufacturer; private global::Gtk.Label manufacturerUrl; private global::Gtk.Label modelName; private global::Gtk.Label modelNumber; private global::Gtk.Label modelUrl; private global::Gtk.Label serialNumber; private global::Gtk.Label udn; private global::Gtk.Label upc; protected virtual void Build () { global::Stetic.Gui.Initialize (this); // Widget Mono.Upnp.GtkClient.DeviceDescriptionInfo global::Stetic.BinContainer.Attach (this); this.Name = "Mono.Upnp.GtkClient.DeviceDescriptionInfo"; // Container child Mono.Upnp.GtkClient.DeviceDescriptionInfo.Gtk.Container+ContainerChild this.table1 = new global::Gtk.Table (((uint)(11)), ((uint)(2)), false); this.table1.Name = "table1"; this.table1.RowSpacing = ((uint)(10)); this.table1.ColumnSpacing = ((uint)(10)); this.table1.BorderWidth = ((uint)(10)); // Container child table1.Gtk.Table+TableChild this.deviceType = new global::Gtk.Label (); this.deviceType.Name = "deviceType"; this.deviceType.Xalign = 0F; this.deviceType.LabelProp = "deviceType"; this.deviceType.Selectable = true; this.table1.Add (this.deviceType); global::Gtk.Table.TableChild w1 = ((global::Gtk.Table.TableChild)(this.table1 [this.deviceType])); w1.LeftAttach = ((uint)(1)); w1.RightAttach = ((uint)(2)); w1.XOptions = ((global::Gtk.AttachOptions)(4)); w1.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild this.friendlyName = new global::Gtk.Label (); this.friendlyName.Name = "friendlyName"; this.friendlyName.Xalign = 0F; this.friendlyName.LabelProp = "friendlyName"; this.friendlyName.Selectable = true; this.table1.Add (this.friendlyName); global::Gtk.Table.TableChild w2 = ((global::Gtk.Table.TableChild)(this.table1 [this.friendlyName])); w2.TopAttach = ((uint)(2)); w2.BottomAttach = ((uint)(3)); w2.LeftAttach = ((uint)(1)); w2.RightAttach = ((uint)(2)); w2.XOptions = ((global::Gtk.AttachOptions)(4)); w2.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild this.iconBox = new global::Gtk.VBox (); this.iconBox.Name = "iconBox"; this.iconBox.Spacing = 6; this.table1.Add (this.iconBox); global::Gtk.Table.TableChild w3 = ((global::Gtk.Table.TableChild)(this.table1 [this.iconBox])); w3.TopAttach = ((uint)(10)); w3.BottomAttach = ((uint)(11)); w3.LeftAttach = ((uint)(1)); w3.RightAttach = ((uint)(2)); w3.XOptions = ((global::Gtk.AttachOptions)(4)); w3.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild this.label1 = new global::Gtk.Label (); this.label1.Name = "label1"; this.label1.Xalign = 1F; this.label1.Yalign = 0F; this.label1.LabelProp = global::Mono.Unix.Catalog.GetString ("Icons"); this.label1.UseMarkup = true; this.table1.Add (this.label1); global::Gtk.Table.TableChild w4 = ((global::Gtk.Table.TableChild)(this.table1 [this.label1])); w4.TopAttach = ((uint)(10)); w4.BottomAttach = ((uint)(11)); w4.XOptions = ((global::Gtk.AttachOptions)(4)); w4.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild this.label10 = new global::Gtk.Label (); this.label10.Name = "label10"; this.label10.Xalign = 1F; this.label10.LabelProp = global::Mono.Unix.Catalog.GetString ("UPC"); this.label10.UseMarkup = true; this.table1.Add (this.label10); global::Gtk.Table.TableChild w5 = ((global::Gtk.Table.TableChild)(this.table1 [this.label10])); w5.TopAttach = ((uint)(9)); w5.BottomAttach = ((uint)(10)); w5.XOptions = ((global::Gtk.AttachOptions)(4)); w5.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild this.label11 = new global::Gtk.Label (); this.label11.Name = "label11"; this.label11.Xalign = 1F; this.label11.LabelProp = global::Mono.Unix.Catalog.GetString ("Device Type"); this.label11.UseMarkup = true; this.table1.Add (this.label11); global::Gtk.Table.TableChild w6 = ((global::Gtk.Table.TableChild)(this.table1 [this.label11])); w6.XOptions = ((global::Gtk.AttachOptions)(4)); w6.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild this.label2 = new global::Gtk.Label (); this.label2.Name = "label2"; this.label2.Xalign = 1F; this.label2.LabelProp = global::Mono.Unix.Catalog.GetString ("UDN"); this.label2.UseMarkup = true; this.table1.Add (this.label2); global::Gtk.Table.TableChild w7 = ((global::Gtk.Table.TableChild)(this.table1 [this.label2])); w7.TopAttach = ((uint)(1)); w7.BottomAttach = ((uint)(2)); w7.XOptions = ((global::Gtk.AttachOptions)(4)); w7.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild this.label3 = new global::Gtk.Label (); this.label3.Name = "label3"; this.label3.Xalign = 1F; this.label3.LabelProp = global::Mono.Unix.Catalog.GetString ("Friendly Name"); this.label3.UseMarkup = true; this.table1.Add (this.label3); global::Gtk.Table.TableChild w8 = ((global::Gtk.Table.TableChild)(this.table1 [this.label3])); w8.TopAttach = ((uint)(2)); w8.BottomAttach = ((uint)(3)); w8.XOptions = ((global::Gtk.AttachOptions)(4)); w8.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild this.label4 = new global::Gtk.Label (); this.label4.Name = "label4"; this.label4.Xalign = 1F; this.label4.LabelProp = global::Mono.Unix.Catalog.GetString ("Manufacturer"); this.label4.UseMarkup = true; this.table1.Add (this.label4); global::Gtk.Table.TableChild w9 = ((global::Gtk.Table.TableChild)(this.table1 [this.label4])); w9.TopAttach = ((uint)(3)); w9.BottomAttach = ((uint)(4)); w9.XOptions = ((global::Gtk.AttachOptions)(4)); w9.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild this.label5 = new global::Gtk.Label (); this.label5.Name = "label5"; this.label5.Xalign = 1F; this.label5.LabelProp = global::Mono.Unix.Catalog.GetString ("Manufacturer URL"); this.label5.UseMarkup = true; this.table1.Add (this.label5); global::Gtk.Table.TableChild w10 = ((global::Gtk.Table.TableChild)(this.table1 [this.label5])); w10.TopAttach = ((uint)(4)); w10.BottomAttach = ((uint)(5)); w10.XOptions = ((global::Gtk.AttachOptions)(4)); w10.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild this.label6 = new global::Gtk.Label (); this.label6.Name = "label6"; this.label6.Xalign = 1F; this.label6.LabelProp = global::Mono.Unix.Catalog.GetString ("Model Name"); this.label6.UseMarkup = true; this.table1.Add (this.label6); global::Gtk.Table.TableChild w11 = ((global::Gtk.Table.TableChild)(this.table1 [this.label6])); w11.TopAttach = ((uint)(5)); w11.BottomAttach = ((uint)(6)); w11.XOptions = ((global::Gtk.AttachOptions)(4)); w11.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild this.label7 = new global::Gtk.Label (); this.label7.Name = "label7"; this.label7.Xalign = 1F; this.label7.LabelProp = global::Mono.Unix.Catalog.GetString ("Model Number"); this.label7.UseMarkup = true; this.table1.Add (this.label7); global::Gtk.Table.TableChild w12 = ((global::Gtk.Table.TableChild)(this.table1 [this.label7])); w12.TopAttach = ((uint)(6)); w12.BottomAttach = ((uint)(7)); w12.XOptions = ((global::Gtk.AttachOptions)(4)); w12.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild this.label8 = new global::Gtk.Label (); this.label8.Name = "label8"; this.label8.Xalign = 1F; this.label8.LabelProp = global::Mono.Unix.Catalog.GetString ("Model URL"); this.label8.UseMarkup = true; this.table1.Add (this.label8); global::Gtk.Table.TableChild w13 = ((global::Gtk.Table.TableChild)(this.table1 [this.label8])); w13.TopAttach = ((uint)(7)); w13.BottomAttach = ((uint)(8)); w13.XOptions = ((global::Gtk.AttachOptions)(4)); w13.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild this.label9 = new global::Gtk.Label (); this.label9.Name = "label9"; this.label9.Xalign = 1F; this.label9.LabelProp = global::Mono.Unix.Catalog.GetString ("Serial Number"); this.label9.UseMarkup = true; this.table1.Add (this.label9); global::Gtk.Table.TableChild w14 = ((global::Gtk.Table.TableChild)(this.table1 [this.label9])); w14.TopAttach = ((uint)(8)); w14.BottomAttach = ((uint)(9)); w14.XOptions = ((global::Gtk.AttachOptions)(4)); w14.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild this.manufacturer = new global::Gtk.Label (); this.manufacturer.Name = "manufacturer"; this.manufacturer.Xalign = 0F; this.manufacturer.LabelProp = "manufacturer"; this.manufacturer.Selectable = true; this.table1.Add (this.manufacturer); global::Gtk.Table.TableChild w15 = ((global::Gtk.Table.TableChild)(this.table1 [this.manufacturer])); w15.TopAttach = ((uint)(3)); w15.BottomAttach = ((uint)(4)); w15.LeftAttach = ((uint)(1)); w15.RightAttach = ((uint)(2)); w15.XOptions = ((global::Gtk.AttachOptions)(4)); w15.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild this.manufacturerUrl = new global::Gtk.Label (); this.manufacturerUrl.Name = "manufacturerUrl"; this.manufacturerUrl.Xalign = 0F; this.manufacturerUrl.LabelProp = "manufacturerUrl"; this.manufacturerUrl.Selectable = true; this.table1.Add (this.manufacturerUrl); global::Gtk.Table.TableChild w16 = ((global::Gtk.Table.TableChild)(this.table1 [this.manufacturerUrl])); w16.TopAttach = ((uint)(4)); w16.BottomAttach = ((uint)(5)); w16.LeftAttach = ((uint)(1)); w16.RightAttach = ((uint)(2)); w16.XOptions = ((global::Gtk.AttachOptions)(4)); w16.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild this.modelName = new global::Gtk.Label (); this.modelName.Name = "modelName"; this.modelName.Xalign = 0F; this.modelName.LabelProp = "modelUrl"; this.modelName.Selectable = true; this.table1.Add (this.modelName); global::Gtk.Table.TableChild w17 = ((global::Gtk.Table.TableChild)(this.table1 [this.modelName])); w17.TopAttach = ((uint)(5)); w17.BottomAttach = ((uint)(6)); w17.LeftAttach = ((uint)(1)); w17.RightAttach = ((uint)(2)); w17.XOptions = ((global::Gtk.AttachOptions)(4)); w17.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild this.modelNumber = new global::Gtk.Label (); this.modelNumber.Name = "modelNumber"; this.modelNumber.Xalign = 0F; this.modelNumber.LabelProp = "modelNumber"; this.modelNumber.Selectable = true; this.table1.Add (this.modelNumber); global::Gtk.Table.TableChild w18 = ((global::Gtk.Table.TableChild)(this.table1 [this.modelNumber])); w18.TopAttach = ((uint)(6)); w18.BottomAttach = ((uint)(7)); w18.LeftAttach = ((uint)(1)); w18.RightAttach = ((uint)(2)); w18.XOptions = ((global::Gtk.AttachOptions)(4)); w18.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild this.modelUrl = new global::Gtk.Label (); this.modelUrl.Name = "modelUrl"; this.modelUrl.Xalign = 0F; this.modelUrl.LabelProp = "modelUrl"; this.modelUrl.Selectable = true; this.table1.Add (this.modelUrl); global::Gtk.Table.TableChild w19 = ((global::Gtk.Table.TableChild)(this.table1 [this.modelUrl])); w19.TopAttach = ((uint)(7)); w19.BottomAttach = ((uint)(8)); w19.LeftAttach = ((uint)(1)); w19.RightAttach = ((uint)(2)); w19.XOptions = ((global::Gtk.AttachOptions)(4)); w19.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild this.serialNumber = new global::Gtk.Label (); this.serialNumber.Name = "serialNumber"; this.serialNumber.Xalign = 0F; this.serialNumber.LabelProp = "serialNumber"; this.serialNumber.Selectable = true; this.table1.Add (this.serialNumber); global::Gtk.Table.TableChild w20 = ((global::Gtk.Table.TableChild)(this.table1 [this.serialNumber])); w20.TopAttach = ((uint)(8)); w20.BottomAttach = ((uint)(9)); w20.LeftAttach = ((uint)(1)); w20.RightAttach = ((uint)(2)); w20.XOptions = ((global::Gtk.AttachOptions)(4)); w20.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild this.udn = new global::Gtk.Label (); this.udn.Name = "udn"; this.udn.Xalign = 0F; this.udn.LabelProp = "udn"; this.udn.Selectable = true; this.table1.Add (this.udn); global::Gtk.Table.TableChild w21 = ((global::Gtk.Table.TableChild)(this.table1 [this.udn])); w21.TopAttach = ((uint)(1)); w21.BottomAttach = ((uint)(2)); w21.LeftAttach = ((uint)(1)); w21.RightAttach = ((uint)(2)); w21.XOptions = ((global::Gtk.AttachOptions)(4)); w21.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild this.upc = new global::Gtk.Label (); this.upc.Name = "upc"; this.upc.Xalign = 0F; this.upc.LabelProp = "upc"; this.upc.Selectable = true; this.table1.Add (this.upc); global::Gtk.Table.TableChild w22 = ((global::Gtk.Table.TableChild)(this.table1 [this.upc])); w22.TopAttach = ((uint)(9)); w22.BottomAttach = ((uint)(10)); w22.LeftAttach = ((uint)(1)); w22.RightAttach = ((uint)(2)); w22.XOptions = ((global::Gtk.AttachOptions)(4)); w22.YOptions = ((global::Gtk.AttachOptions)(4)); this.Add (this.table1); if ((this.Child != null)) { this.Child.ShowAll (); } this.Hide (); } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp.GtkClient/gtk-gui/generated.cs0000664000175000017500000001022111715013277026710 0ustar00lorentzlorentz00000000000000 // This file has been generated by the GUI designer. Do not modify. namespace Stetic { internal class Gui { private static bool initialized; internal static void Initialize (Gtk.Widget iconRenderer) { if ((Stetic.Gui.initialized == false)) { Stetic.Gui.initialized = true; global::Gtk.IconFactory w1 = new global::Gtk.IconFactory (); global::Gtk.IconSet w2 = new global::Gtk.IconSet (global::Stetic.IconLoader.LoadIcon (iconRenderer, "gtk-harddisk", global::Gtk.IconSize.Menu)); w1.Add ("Device", w2); global::Gtk.IconSet w3 = new global::Gtk.IconSet (global::Stetic.IconLoader.LoadIcon (iconRenderer, "gtk-execute", global::Gtk.IconSize.Menu)); w1.Add ("Service", w3); global::Gtk.IconSet w4 = new global::Gtk.IconSet (global::Stetic.IconLoader.LoadIcon (iconRenderer, "gtk-go-forward", global::Gtk.IconSize.Menu)); w1.Add ("Input", w4); global::Gtk.IconSet w5 = new global::Gtk.IconSet (global::Stetic.IconLoader.LoadIcon (iconRenderer, "gtk-go-back", global::Gtk.IconSize.Menu)); w1.Add ("Output", w5); global::Gtk.IconSet w6 = new global::Gtk.IconSet (global::Stetic.IconLoader.LoadIcon (iconRenderer, "gtk-go-up", global::Gtk.IconSize.Menu)); w1.Add ("Return", w6); w1.AddDefault (); } } } internal class IconLoader { public static Gdk.Pixbuf LoadIcon (Gtk.Widget widget, string name, Gtk.IconSize size) { Gdk.Pixbuf res = widget.RenderIcon (name, size, null); if ((res != null)) { return res; } else { int sz; int sy; global::Gtk.Icon.SizeLookup (size, out sz, out sy); try { return Gtk.IconTheme.Default.LoadIcon (name, sz, 0); } catch (System.Exception) { if ((name != "gtk-missing-image")) { return Stetic.IconLoader.LoadIcon (widget, "gtk-missing-image", size); } else { Gdk.Pixmap pmap = new Gdk.Pixmap (Gdk.Screen.Default.RootWindow, sz, sz); Gdk.GC gc = new Gdk.GC (pmap); gc.RgbFgColor = new Gdk.Color (255, 255, 255); pmap.DrawRectangle (gc, true, 0, 0, sz, sz); gc.RgbFgColor = new Gdk.Color (0, 0, 0); pmap.DrawRectangle (gc, false, 0, 0, (sz - 1), (sz - 1)); gc.SetLineAttributes (3, Gdk.LineStyle.Solid, Gdk.CapStyle.Round, Gdk.JoinStyle.Round); gc.RgbFgColor = new Gdk.Color (255, 0, 0); pmap.DrawLine (gc, (sz / 4), (sz / 4), ((sz - 1) - (sz / 4)), ((sz - 1) - (sz / 4))); pmap.DrawLine (gc, ((sz - 1) - (sz / 4)), (sz / 4), (sz / 4), ((sz - 1) - (sz / 4))); return Gdk.Pixbuf.FromDrawable (pmap, pmap.Colormap, 0, 0, 0, 0, sz, sz); } } } } } internal class BinContainer { private Gtk.Widget child; private Gtk.UIManager uimanager; public static BinContainer Attach (Gtk.Bin bin) { BinContainer bc = new BinContainer (); bin.SizeRequested += new Gtk.SizeRequestedHandler (bc.OnSizeRequested); bin.SizeAllocated += new Gtk.SizeAllocatedHandler (bc.OnSizeAllocated); bin.Added += new Gtk.AddedHandler (bc.OnAdded); return bc; } private void OnSizeRequested (object sender, Gtk.SizeRequestedArgs args) { if ((this.child != null)) { args.Requisition = this.child.SizeRequest (); } } private void OnSizeAllocated (object sender, Gtk.SizeAllocatedArgs args) { if ((this.child != null)) { this.child.Allocation = args.Allocation; } } private void OnAdded (object sender, Gtk.AddedArgs args) { this.child = args.Widget; } public void SetUiManager (Gtk.UIManager uim) { this.uimanager = uim; this.child.Realized += new System.EventHandler (this.OnRealized); } private void OnRealized (object sender, System.EventArgs args) { if ((this.uimanager != null)) { Gtk.Widget w; w = this.child.Toplevel; if (((w != null) && typeof(Gtk.Window).IsInstanceOfType (w))) { ((Gtk.Window)(w)).AddAccelGroup (this.uimanager.AccelGroup); this.uimanager = null; } } } } internal class ActionGroups { public static Gtk.ActionGroup GetActionGroup (System.Type type) { return Stetic.ActionGroups.GetActionGroup (type.FullName); } public static Gtk.ActionGroup GetActionGroup (string name) { return null; } } } Mono.Upnp.GtkClient.ServiceAnnouncementInfo.cs0000664000175000017500000001065011715013277035203 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp.GtkClient/gtk-gui // This file has been generated by the GUI designer. Do not modify. namespace Mono.Upnp.GtkClient { public partial class ServiceAnnouncementInfo { private global::Gtk.Table table1; private global::Gtk.Label deviceUdn; private global::Gtk.Label label1; private global::Gtk.Label label2; private global::Gtk.Label label3; private global::Gtk.VBox locationBox; private global::Gtk.Label serviceType; protected virtual void Build () { global::Stetic.Gui.Initialize (this); // Widget Mono.Upnp.GtkClient.ServiceAnnouncementInfo global::Stetic.BinContainer.Attach (this); this.Name = "Mono.Upnp.GtkClient.ServiceAnnouncementInfo"; // Container child Mono.Upnp.GtkClient.ServiceAnnouncementInfo.Gtk.Container+ContainerChild this.table1 = new global::Gtk.Table (((uint)(3)), ((uint)(2)), false); this.table1.Name = "table1"; this.table1.RowSpacing = ((uint)(10)); this.table1.ColumnSpacing = ((uint)(10)); this.table1.BorderWidth = ((uint)(10)); // Container child table1.Gtk.Table+TableChild this.deviceUdn = new global::Gtk.Label (); this.deviceUdn.Name = "deviceUdn"; this.deviceUdn.Xalign = 0F; this.deviceUdn.LabelProp = "deviceUdn"; this.deviceUdn.Selectable = true; this.table1.Add (this.deviceUdn); global::Gtk.Table.TableChild w1 = ((global::Gtk.Table.TableChild)(this.table1 [this.deviceUdn])); w1.TopAttach = ((uint)(1)); w1.BottomAttach = ((uint)(2)); w1.LeftAttach = ((uint)(1)); w1.RightAttach = ((uint)(2)); w1.XOptions = ((global::Gtk.AttachOptions)(4)); w1.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild this.label1 = new global::Gtk.Label (); this.label1.Name = "label1"; this.label1.Xalign = 1F; this.label1.LabelProp = global::Mono.Unix.Catalog.GetString ("Service Type"); this.label1.UseMarkup = true; this.table1.Add (this.label1); global::Gtk.Table.TableChild w2 = ((global::Gtk.Table.TableChild)(this.table1 [this.label1])); w2.XOptions = ((global::Gtk.AttachOptions)(4)); w2.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild this.label2 = new global::Gtk.Label (); this.label2.Name = "label2"; this.label2.Xalign = 1F; this.label2.LabelProp = global::Mono.Unix.Catalog.GetString ("Device UDN"); this.label2.UseMarkup = true; this.table1.Add (this.label2); global::Gtk.Table.TableChild w3 = ((global::Gtk.Table.TableChild)(this.table1 [this.label2])); w3.TopAttach = ((uint)(1)); w3.BottomAttach = ((uint)(2)); w3.XOptions = ((global::Gtk.AttachOptions)(4)); w3.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild this.label3 = new global::Gtk.Label (); this.label3.Name = "label3"; this.label3.Xalign = 1F; this.label3.Yalign = 0F; this.label3.LabelProp = global::Mono.Unix.Catalog.GetString ("Locations"); this.label3.UseMarkup = true; this.table1.Add (this.label3); global::Gtk.Table.TableChild w4 = ((global::Gtk.Table.TableChild)(this.table1 [this.label3])); w4.TopAttach = ((uint)(2)); w4.BottomAttach = ((uint)(3)); w4.XOptions = ((global::Gtk.AttachOptions)(4)); w4.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild this.locationBox = new global::Gtk.VBox (); this.locationBox.Name = "locationBox"; this.locationBox.Spacing = 6; this.table1.Add (this.locationBox); global::Gtk.Table.TableChild w5 = ((global::Gtk.Table.TableChild)(this.table1 [this.locationBox])); w5.TopAttach = ((uint)(2)); w5.BottomAttach = ((uint)(3)); w5.LeftAttach = ((uint)(1)); w5.RightAttach = ((uint)(2)); w5.XOptions = ((global::Gtk.AttachOptions)(4)); w5.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild this.serviceType = new global::Gtk.Label (); this.serviceType.Name = "serviceType"; this.serviceType.Xalign = 0F; this.serviceType.LabelProp = "serviceType"; this.serviceType.Selectable = true; this.table1.Add (this.serviceType); global::Gtk.Table.TableChild w6 = ((global::Gtk.Table.TableChild)(this.table1 [this.serviceType])); w6.LeftAttach = ((uint)(1)); w6.RightAttach = ((uint)(2)); w6.XOptions = ((global::Gtk.AttachOptions)(4)); w6.YOptions = ((global::Gtk.AttachOptions)(4)); this.Add (this.table1); if ((this.Child != null)) { this.Child.ShowAll (); } this.Hide (); } } } Mono.Upnp.GtkClient.DeviceAnnouncementInfo.cs0000664000175000017500000001052611715013277035004 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp.GtkClient/gtk-gui // This file has been generated by the GUI designer. Do not modify. namespace Mono.Upnp.GtkClient { public partial class DeviceAnnouncementInfo { private global::Gtk.Table table1; private global::Gtk.Label deviceType; private global::Gtk.Label label1; private global::Gtk.Label label2; private global::Gtk.Label label3; private global::Gtk.VBox locationBox; private global::Gtk.Label udn; protected virtual void Build () { global::Stetic.Gui.Initialize (this); // Widget Mono.Upnp.GtkClient.DeviceAnnouncementInfo global::Stetic.BinContainer.Attach (this); this.Name = "Mono.Upnp.GtkClient.DeviceAnnouncementInfo"; // Container child Mono.Upnp.GtkClient.DeviceAnnouncementInfo.Gtk.Container+ContainerChild this.table1 = new global::Gtk.Table (((uint)(3)), ((uint)(2)), false); this.table1.Name = "table1"; this.table1.RowSpacing = ((uint)(10)); this.table1.ColumnSpacing = ((uint)(10)); this.table1.BorderWidth = ((uint)(10)); // Container child table1.Gtk.Table+TableChild this.deviceType = new global::Gtk.Label (); this.deviceType.Name = "deviceType"; this.deviceType.Xalign = 0F; this.deviceType.LabelProp = "deviceType"; this.deviceType.Selectable = true; this.table1.Add (this.deviceType); global::Gtk.Table.TableChild w1 = ((global::Gtk.Table.TableChild)(this.table1 [this.deviceType])); w1.LeftAttach = ((uint)(1)); w1.RightAttach = ((uint)(2)); w1.XOptions = ((global::Gtk.AttachOptions)(4)); w1.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild this.label1 = new global::Gtk.Label (); this.label1.Name = "label1"; this.label1.Xalign = 1F; this.label1.LabelProp = global::Mono.Unix.Catalog.GetString ("Device Type"); this.label1.UseMarkup = true; this.table1.Add (this.label1); global::Gtk.Table.TableChild w2 = ((global::Gtk.Table.TableChild)(this.table1 [this.label1])); w2.XOptions = ((global::Gtk.AttachOptions)(4)); w2.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild this.label2 = new global::Gtk.Label (); this.label2.Name = "label2"; this.label2.Xalign = 1F; this.label2.LabelProp = global::Mono.Unix.Catalog.GetString ("UDN"); this.label2.UseMarkup = true; this.table1.Add (this.label2); global::Gtk.Table.TableChild w3 = ((global::Gtk.Table.TableChild)(this.table1 [this.label2])); w3.TopAttach = ((uint)(1)); w3.BottomAttach = ((uint)(2)); w3.XOptions = ((global::Gtk.AttachOptions)(4)); w3.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild this.label3 = new global::Gtk.Label (); this.label3.Name = "label3"; this.label3.Xalign = 1F; this.label3.Yalign = 0F; this.label3.LabelProp = global::Mono.Unix.Catalog.GetString ("Locations"); this.label3.UseMarkup = true; this.table1.Add (this.label3); global::Gtk.Table.TableChild w4 = ((global::Gtk.Table.TableChild)(this.table1 [this.label3])); w4.TopAttach = ((uint)(2)); w4.BottomAttach = ((uint)(3)); w4.XOptions = ((global::Gtk.AttachOptions)(4)); w4.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild this.locationBox = new global::Gtk.VBox (); this.locationBox.Name = "locationBox"; this.locationBox.Spacing = 6; this.table1.Add (this.locationBox); global::Gtk.Table.TableChild w5 = ((global::Gtk.Table.TableChild)(this.table1 [this.locationBox])); w5.TopAttach = ((uint)(2)); w5.BottomAttach = ((uint)(3)); w5.LeftAttach = ((uint)(1)); w5.RightAttach = ((uint)(2)); w5.XOptions = ((global::Gtk.AttachOptions)(4)); w5.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild this.udn = new global::Gtk.Label (); this.udn.Name = "udn"; this.udn.Xalign = 0F; this.udn.LabelProp = "udn"; this.udn.Selectable = true; this.table1.Add (this.udn); global::Gtk.Table.TableChild w6 = ((global::Gtk.Table.TableChild)(this.table1 [this.udn])); w6.TopAttach = ((uint)(1)); w6.BottomAttach = ((uint)(2)); w6.LeftAttach = ((uint)(1)); w6.RightAttach = ((uint)(2)); w6.XOptions = ((global::Gtk.AttachOptions)(4)); w6.YOptions = ((global::Gtk.AttachOptions)(4)); this.Add (this.table1); if ((this.Child != null)) { this.Child.ShowAll (); } this.Hide (); } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp.GtkClient/gtk-gui/Mono.Upnp.GtkClient.RawXmlInfo.cs0000664000175000017500000000312211715013277032515 0ustar00lorentzlorentz00000000000000 // This file has been generated by the GUI designer. Do not modify. namespace Mono.Upnp.GtkClient { public partial class RawXmlInfo { private global::Gtk.ScrolledWindow scrolledwindow1; private global::Gtk.VBox vbox1; private global::Gtk.TextView raw; protected virtual void Build () { global::Stetic.Gui.Initialize (this); // Widget Mono.Upnp.GtkClient.RawXmlInfo global::Stetic.BinContainer.Attach (this); this.Name = "Mono.Upnp.GtkClient.RawXmlInfo"; // Container child Mono.Upnp.GtkClient.RawXmlInfo.Gtk.Container+ContainerChild this.scrolledwindow1 = new global::Gtk.ScrolledWindow (); this.scrolledwindow1.CanFocus = true; this.scrolledwindow1.Name = "scrolledwindow1"; this.scrolledwindow1.ShadowType = ((global::Gtk.ShadowType)(1)); // Container child scrolledwindow1.Gtk.Container+ContainerChild global::Gtk.Viewport w1 = new global::Gtk.Viewport (); w1.ShadowType = ((global::Gtk.ShadowType)(0)); // Container child GtkViewport.Gtk.Container+ContainerChild this.vbox1 = new global::Gtk.VBox (); this.vbox1.Name = "vbox1"; this.vbox1.Spacing = 6; // Container child vbox1.Gtk.Box+BoxChild this.raw = new global::Gtk.TextView (); this.raw.CanFocus = true; this.raw.Name = "raw"; this.raw.Editable = false; this.vbox1.Add (this.raw); global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.raw])); w2.Position = 0; w1.Add (this.vbox1); this.scrolledwindow1.Add (w1); this.Add (this.scrolledwindow1); if ((this.Child != null)) { this.Child.ShowAll (); } this.Hide (); } } } Mono.Upnp.GtkClient.ServiceDescriptionInfo.cs0000664000175000017500000001564711715013277035047 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp.GtkClient/gtk-gui // This file has been generated by the GUI designer. Do not modify. namespace Mono.Upnp.GtkClient { public partial class ServiceDescriptionInfo { private global::Gtk.Table table2; private global::Gtk.Label controlUrl; private global::Gtk.Label eventUrl; private global::Gtk.Label label10; private global::Gtk.Label label11; private global::Gtk.Label label7; private global::Gtk.Label label8; private global::Gtk.Label label9; private global::Gtk.Label scpdUrl; private global::Gtk.Label serviceId; private global::Gtk.Label serviceType; protected virtual void Build () { global::Stetic.Gui.Initialize (this); // Widget Mono.Upnp.GtkClient.ServiceDescriptionInfo global::Stetic.BinContainer.Attach (this); this.Name = "Mono.Upnp.GtkClient.ServiceDescriptionInfo"; // Container child Mono.Upnp.GtkClient.ServiceDescriptionInfo.Gtk.Container+ContainerChild this.table2 = new global::Gtk.Table (((uint)(5)), ((uint)(2)), false); this.table2.Name = "table2"; this.table2.RowSpacing = ((uint)(10)); this.table2.ColumnSpacing = ((uint)(10)); this.table2.BorderWidth = ((uint)(10)); // Container child table2.Gtk.Table+TableChild this.controlUrl = new global::Gtk.Label (); this.controlUrl.Name = "controlUrl"; this.controlUrl.Xalign = 0F; this.controlUrl.LabelProp = "controlUrl"; this.controlUrl.Selectable = true; this.table2.Add (this.controlUrl); global::Gtk.Table.TableChild w1 = ((global::Gtk.Table.TableChild)(this.table2 [this.controlUrl])); w1.TopAttach = ((uint)(3)); w1.BottomAttach = ((uint)(4)); w1.LeftAttach = ((uint)(1)); w1.RightAttach = ((uint)(2)); w1.XOptions = ((global::Gtk.AttachOptions)(4)); w1.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table2.Gtk.Table+TableChild this.eventUrl = new global::Gtk.Label (); this.eventUrl.Name = "eventUrl"; this.eventUrl.Xalign = 0F; this.eventUrl.LabelProp = "eventUrl"; this.eventUrl.Selectable = true; this.table2.Add (this.eventUrl); global::Gtk.Table.TableChild w2 = ((global::Gtk.Table.TableChild)(this.table2 [this.eventUrl])); w2.TopAttach = ((uint)(4)); w2.BottomAttach = ((uint)(5)); w2.LeftAttach = ((uint)(1)); w2.RightAttach = ((uint)(2)); w2.XOptions = ((global::Gtk.AttachOptions)(4)); w2.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table2.Gtk.Table+TableChild this.label10 = new global::Gtk.Label (); this.label10.Name = "label10"; this.label10.Xalign = 1F; this.label10.LabelProp = global::Mono.Unix.Catalog.GetString ("Control URL"); this.label10.UseMarkup = true; this.table2.Add (this.label10); global::Gtk.Table.TableChild w3 = ((global::Gtk.Table.TableChild)(this.table2 [this.label10])); w3.TopAttach = ((uint)(3)); w3.BottomAttach = ((uint)(4)); w3.XOptions = ((global::Gtk.AttachOptions)(4)); w3.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table2.Gtk.Table+TableChild this.label11 = new global::Gtk.Label (); this.label11.Name = "label11"; this.label11.Xalign = 1F; this.label11.LabelProp = global::Mono.Unix.Catalog.GetString ("Event URL"); this.label11.UseMarkup = true; this.table2.Add (this.label11); global::Gtk.Table.TableChild w4 = ((global::Gtk.Table.TableChild)(this.table2 [this.label11])); w4.TopAttach = ((uint)(4)); w4.BottomAttach = ((uint)(5)); w4.XOptions = ((global::Gtk.AttachOptions)(4)); w4.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table2.Gtk.Table+TableChild this.label7 = new global::Gtk.Label (); this.label7.Name = "label7"; this.label7.Xalign = 1F; this.label7.LabelProp = global::Mono.Unix.Catalog.GetString ("ServiceType"); this.label7.UseMarkup = true; this.table2.Add (this.label7); global::Gtk.Table.TableChild w5 = ((global::Gtk.Table.TableChild)(this.table2 [this.label7])); w5.XOptions = ((global::Gtk.AttachOptions)(4)); w5.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table2.Gtk.Table+TableChild this.label8 = new global::Gtk.Label (); this.label8.Name = "label8"; this.label8.Xalign = 1F; this.label8.LabelProp = global::Mono.Unix.Catalog.GetString ("Service ID"); this.label8.UseMarkup = true; this.table2.Add (this.label8); global::Gtk.Table.TableChild w6 = ((global::Gtk.Table.TableChild)(this.table2 [this.label8])); w6.TopAttach = ((uint)(1)); w6.BottomAttach = ((uint)(2)); w6.XOptions = ((global::Gtk.AttachOptions)(4)); w6.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table2.Gtk.Table+TableChild this.label9 = new global::Gtk.Label (); this.label9.Name = "label9"; this.label9.Xalign = 1F; this.label9.LabelProp = global::Mono.Unix.Catalog.GetString ("SCPD URL"); this.label9.UseMarkup = true; this.table2.Add (this.label9); global::Gtk.Table.TableChild w7 = ((global::Gtk.Table.TableChild)(this.table2 [this.label9])); w7.TopAttach = ((uint)(2)); w7.BottomAttach = ((uint)(3)); w7.XOptions = ((global::Gtk.AttachOptions)(4)); w7.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table2.Gtk.Table+TableChild this.scpdUrl = new global::Gtk.Label (); this.scpdUrl.Name = "scpdUrl"; this.scpdUrl.Xalign = 0F; this.scpdUrl.LabelProp = "scpdUrl"; this.scpdUrl.Selectable = true; this.table2.Add (this.scpdUrl); global::Gtk.Table.TableChild w8 = ((global::Gtk.Table.TableChild)(this.table2 [this.scpdUrl])); w8.TopAttach = ((uint)(2)); w8.BottomAttach = ((uint)(3)); w8.LeftAttach = ((uint)(1)); w8.RightAttach = ((uint)(2)); w8.XOptions = ((global::Gtk.AttachOptions)(4)); w8.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table2.Gtk.Table+TableChild this.serviceId = new global::Gtk.Label (); this.serviceId.Name = "serviceId"; this.serviceId.Xalign = 0F; this.serviceId.LabelProp = "serviceId"; this.serviceId.Selectable = true; this.table2.Add (this.serviceId); global::Gtk.Table.TableChild w9 = ((global::Gtk.Table.TableChild)(this.table2 [this.serviceId])); w9.TopAttach = ((uint)(1)); w9.BottomAttach = ((uint)(2)); w9.LeftAttach = ((uint)(1)); w9.RightAttach = ((uint)(2)); w9.XOptions = ((global::Gtk.AttachOptions)(4)); w9.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table2.Gtk.Table+TableChild this.serviceType = new global::Gtk.Label (); this.serviceType.Name = "serviceType"; this.serviceType.Xalign = 0F; this.serviceType.LabelProp = "serviceType"; this.serviceType.Selectable = true; this.table2.Add (this.serviceType); global::Gtk.Table.TableChild w10 = ((global::Gtk.Table.TableChild)(this.table2 [this.serviceType])); w10.LeftAttach = ((uint)(1)); w10.RightAttach = ((uint)(2)); w10.XOptions = ((global::Gtk.AttachOptions)(4)); w10.YOptions = ((global::Gtk.AttachOptions)(4)); this.Add (this.table2); if ((this.Child != null)) { this.Child.ShowAll (); } this.Hide (); } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp.GtkClient/gtk-gui/Mono.Upnp.GtkClient.ServiceScpdInfo.cs0000664000175000017500000000440011715013277033515 0ustar00lorentzlorentz00000000000000 // This file has been generated by the GUI designer. Do not modify. namespace Mono.Upnp.GtkClient { public partial class ServiceScpdInfo { private global::Gtk.HBox hbox1; private global::Gtk.ScrolledWindow GtkScrolledWindow; private global::Gtk.TreeView actions; private global::Gtk.ScrolledWindow GtkScrolledWindow1; private global::Gtk.TreeView stateVariables; protected virtual void Build () { global::Stetic.Gui.Initialize (this); // Widget Mono.Upnp.GtkClient.ServiceScpdInfo global::Stetic.BinContainer.Attach (this); this.Name = "Mono.Upnp.GtkClient.ServiceScpdInfo"; // Container child Mono.Upnp.GtkClient.ServiceScpdInfo.Gtk.Container+ContainerChild this.hbox1 = new global::Gtk.HBox (); this.hbox1.Name = "hbox1"; this.hbox1.Spacing = 6; // Container child hbox1.Gtk.Box+BoxChild this.GtkScrolledWindow = new global::Gtk.ScrolledWindow (); this.GtkScrolledWindow.Name = "GtkScrolledWindow"; this.GtkScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1)); // Container child GtkScrolledWindow.Gtk.Container+ContainerChild this.actions = new global::Gtk.TreeView (); this.actions.CanFocus = true; this.actions.Name = "actions"; this.GtkScrolledWindow.Add (this.actions); this.hbox1.Add (this.GtkScrolledWindow); global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.GtkScrolledWindow])); w2.Position = 0; // Container child hbox1.Gtk.Box+BoxChild this.GtkScrolledWindow1 = new global::Gtk.ScrolledWindow (); this.GtkScrolledWindow1.Name = "GtkScrolledWindow1"; this.GtkScrolledWindow1.ShadowType = ((global::Gtk.ShadowType)(1)); // Container child GtkScrolledWindow1.Gtk.Container+ContainerChild this.stateVariables = new global::Gtk.TreeView (); this.stateVariables.CanFocus = true; this.stateVariables.Name = "stateVariables"; this.GtkScrolledWindow1.Add (this.stateVariables); this.hbox1.Add (this.GtkScrolledWindow1); global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.GtkScrolledWindow1])); w4.Position = 1; this.Add (this.hbox1); if ((this.Child != null)) { this.Child.ShowAll (); } this.Hide (); this.actions.RowActivated += new global::Gtk.RowActivatedHandler (this.OnActionsRowActivated); } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp.GtkClient/gtk-gui/Mono.Upnp.GtkClient.LazyIcon.cs0000664000175000017500000000205511715013277032223 0ustar00lorentzlorentz00000000000000 // This file has been generated by the GUI designer. Do not modify. namespace Mono.Upnp.GtkClient { public partial class LazyIcon { private global::Gtk.Alignment alignment; private global::Gtk.Label loading; protected virtual void Build () { global::Stetic.Gui.Initialize (this); // Widget Mono.Upnp.GtkClient.LazyIcon global::Stetic.BinContainer.Attach (this); this.Name = "Mono.Upnp.GtkClient.LazyIcon"; // Container child Mono.Upnp.GtkClient.LazyIcon.Gtk.Container+ContainerChild this.alignment = new global::Gtk.Alignment (0.5F, 0.5F, 1F, 1F); this.alignment.Name = "alignment"; // Container child alignment.Gtk.Container+ContainerChild this.loading = new global::Gtk.Label (); this.loading.Name = "loading"; this.loading.LabelProp = global::Mono.Unix.Catalog.GetString ("Loading Icon"); this.alignment.Add (this.loading); this.Add (this.alignment); if ((this.Child != null)) { this.Child.ShowAll (); } this.Hide (); this.Mapped += new global::System.EventHandler (this.OnMapped); } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp.GtkClient/Makefile.am0000664000175000017500000001046411715013277025121 0ustar00lorentzlorentz00000000000000 EXTRA_DIST = # Warning: This is an automatically generated file, do not edit! if ENABLE_DEBUG ASSEMBLY_COMPILER_COMMAND = gmcs ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug "-define:DEBUG" ASSEMBLY = ../../../bin/Mono.Upnp.GtkClient.exe ASSEMBLY_MDB = $(ASSEMBLY).mdb COMPILE_TARGET = winexe PROJECT_REFERENCES = \ ../../../bin/Mono.Upnp.dll BUILD_DIR = ../../../bin MONO_UPNP_GTKCLIENT_EXE_MDB_SOURCE=../../../bin/Mono.Upnp.GtkClient.exe.mdb MONO_UPNP_GTKCLIENT_EXE_MDB=$(BUILD_DIR)/Mono.Upnp.GtkClient.exe.mdb MONO_UPNP_DLL_SOURCE=../../../bin/Mono.Upnp.dll MONO_SSDP_DLL_SOURCE=../../../bin/Mono.Ssdp.dll MONO_SSDP_DLL_MDB_SOURCE=../../../bin/Mono.Ssdp.dll.mdb MONO_SSDP_DLL_MDB=$(BUILD_DIR)/Mono.Ssdp.dll.mdb MONO_UPNP_DLL_MDB_SOURCE=../../../bin/Mono.Upnp.dll.mdb MONO_UPNP_DLL_MDB=$(BUILD_DIR)/Mono.Upnp.dll.mdb endif if ENABLE_RELEASE ASSEMBLY_COMPILER_COMMAND = gmcs ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ ASSEMBLY = ../../../bin/Mono.Upnp.GtkClient.exe ASSEMBLY_MDB = COMPILE_TARGET = winexe PROJECT_REFERENCES = \ ../../../bin/Mono.Upnp.dll BUILD_DIR = ../../../bin MONO_UPNP_GTKCLIENT_EXE_MDB= MONO_UPNP_DLL_SOURCE=../../../bin/Mono.Upnp.dll MONO_SSDP_DLL_SOURCE=../../../bin/Mono.Ssdp.dll MONO_SSDP_DLL_MDB= MONO_UPNP_DLL_MDB= endif AL=al2 SATELLITE_ASSEMBLY_NAME=$(notdir $(basename $(ASSEMBLY))).resources.dll PROGRAMFILES = \ $(MONO_UPNP_GTKCLIENT_EXE_MDB) \ $(MONO_UPNP_DLL) \ $(MONO_SSDP_DLL) \ $(MONO_SSDP_DLL_MDB) \ $(MONO_UPNP_DLL_MDB) BINARIES = \ $(MONO_UPNP_GTK) RESGEN=resgen2 all: $(ASSEMBLY) $(PROGRAMFILES) $(BINARIES) FILES = \ AssemblyInfo.cs \ gtk-gui/generated.cs \ gtk-gui/Mono.Upnp.GtkClient.ActionInvocationWindow.cs \ gtk-gui/Mono.Upnp.GtkClient.DeviceAnnouncementInfo.cs \ gtk-gui/Mono.Upnp.GtkClient.DeviceDescriptionInfo.cs \ gtk-gui/Mono.Upnp.GtkClient.LazyDeviceInfo.cs \ gtk-gui/Mono.Upnp.GtkClient.LazyIcon.cs \ gtk-gui/Mono.Upnp.GtkClient.LazyServiceInfo.cs \ gtk-gui/Mono.Upnp.GtkClient.MainWindow.cs \ gtk-gui/Mono.Upnp.GtkClient.RawXmlInfo.cs \ gtk-gui/Mono.Upnp.GtkClient.ServiceAnnouncementInfo.cs \ gtk-gui/Mono.Upnp.GtkClient.ServiceDescriptionInfo.cs \ gtk-gui/Mono.Upnp.GtkClient.ServiceScpdInfo.cs \ Mono.Upnp.GtkClient/ActionInvocationWindow.cs \ Mono.Upnp.GtkClient/DeviceAnnouncementInfo.cs \ Mono.Upnp.GtkClient/DeviceAnnouncementInfoProvider.cs \ Mono.Upnp.GtkClient/DeviceDescriptionInfo.cs \ Mono.Upnp.GtkClient/DeviceDescriptionInfoProvider.cs \ Mono.Upnp.GtkClient/GtkClient.cs \ Mono.Upnp.GtkClient/IDeviceInfoProvider.cs \ Mono.Upnp.GtkClient/IServiceInfoProvider.cs \ Mono.Upnp.GtkClient/LazyDeviceInfo.cs \ Mono.Upnp.GtkClient/LazyIcon.cs \ Mono.Upnp.GtkClient/LazyServiceInfo.cs \ Mono.Upnp.GtkClient/MainWindow.cs \ Mono.Upnp.GtkClient/RawDeviceDescriptionInfoProvider.cs \ Mono.Upnp.GtkClient/RawServiceDescriptionInfoProvider.cs \ Mono.Upnp.GtkClient/RawServiceScdpInfoProvider.cs \ Mono.Upnp.GtkClient/RawXmlInfo.cs \ Mono.Upnp.GtkClient/ServiceAnnouncementInfo.cs \ Mono.Upnp.GtkClient/ServiceAnnouncementInfoProvider.cs \ Mono.Upnp.GtkClient/ServiceDescriptionInfo.cs \ Mono.Upnp.GtkClient/ServiceDescriptionInfoProvider.cs \ Mono.Upnp.GtkClient/ServiceScpdInfo.cs \ Mono.Upnp.GtkClient/ServiceScpdInfoProvider.cs DATA_FILES = RESOURCES = gtk-gui/gui.stetic EXTRAS = \ app.desktop \ Mono.Upnp.GtkClient \ mono-upnp-gtk.in REFERENCES = \ ../../../bin/Mono.Upnp.dll \ Mono.Posix \ -pkg:glade-sharp-2.0 \ -pkg:glib-sharp-2.0 \ -pkg:gtk-sharp-2.0 \ -pkg:mono-addins \ System \ System.Xml DLL_REFERENCES = CLEANFILES = $(PROGRAMFILES) $(BINARIES) include $(top_srcdir)/Makefile.include MONO_UPNP_DLL = $(BUILD_DIR)/Mono.Upnp.dll MONO_SSDP_DLL = $(BUILD_DIR)/Mono.Ssdp.dll MONO_UPNP_GTK = $(BUILD_DIR)/mono-upnp-gtk $(eval $(call emit-deploy-wrapper,MONO_UPNP_GTK,mono-upnp-gtk,x)) $(eval $(call emit_resgen_targets)) $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(ASSEMBLY_MDB): $(ASSEMBLY) $(ASSEMBLY): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(shell dirname $(ASSEMBLY)) $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp.GtkClient/Makefile.in0000664000175000017500000006515011761736756025153 0ustar00lorentzlorentz00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/mono-upnp-gtk.in $(top_srcdir)/Makefile.include subdir = src/Mono.Upnp/Mono.Upnp.GtkClient ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/expansions.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = mono-upnp-gtk CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(bindir)" \ "$(DESTDIR)$(assemblyfilesdir)" \ "$(DESTDIR)$(linuxpkgconfigdir)" \ "$(DESTDIR)$(programfilesdir)" SCRIPTS = $(bin_SCRIPTS) SOURCES = DIST_SOURCES = DATA = $(assemblyfiles_DATA) $(linuxpkgconfig_DATA) \ $(programfiles_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ GLADE_SHARP_20_CFLAGS = @GLADE_SHARP_20_CFLAGS@ GLADE_SHARP_20_LIBS = @GLADE_SHARP_20_LIBS@ GLIB_SHARP_20_CFLAGS = @GLIB_SHARP_20_CFLAGS@ GLIB_SHARP_20_LIBS = @GLIB_SHARP_20_LIBS@ GMCS = @GMCS@ GTK_SHARP_20_CFLAGS = @GTK_SHARP_20_CFLAGS@ GTK_SHARP_20_LIBS = @GTK_SHARP_20_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MONO_ADDINS_CFLAGS = @MONO_ADDINS_CFLAGS@ MONO_ADDINS_LIBS = @MONO_ADDINS_LIBS@ NUNIT_CFLAGS = @NUNIT_CFLAGS@ NUNIT_CMD = @NUNIT_CMD@ NUNIT_LIBS = @NUNIT_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TAGLIB_SHARP_CFLAGS = @TAGLIB_SHARP_CFLAGS@ TAGLIB_SHARP_LIBS = @TAGLIB_SHARP_LIBS@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_bindir = @expanded_bindir@ expanded_datadir = @expanded_datadir@ expanded_libdir = @expanded_libdir@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = $(build_sources) $(build_resx_files) \ $(build_others_files) $(ASSEMBLY_WRAPPER_IN) $(EXTRAS) \ $(DATA_FILES) $(build_culture_res_files) # Warning: This is an automatically generated file, do not edit! @ENABLE_DEBUG_TRUE@ASSEMBLY_COMPILER_COMMAND = gmcs @ENABLE_RELEASE_TRUE@ASSEMBLY_COMPILER_COMMAND = gmcs @ENABLE_DEBUG_TRUE@ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug "-define:DEBUG" @ENABLE_RELEASE_TRUE@ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ @ENABLE_DEBUG_TRUE@ASSEMBLY = ../../../bin/Mono.Upnp.GtkClient.exe @ENABLE_RELEASE_TRUE@ASSEMBLY = ../../../bin/Mono.Upnp.GtkClient.exe @ENABLE_DEBUG_TRUE@ASSEMBLY_MDB = $(ASSEMBLY).mdb @ENABLE_RELEASE_TRUE@ASSEMBLY_MDB = @ENABLE_DEBUG_TRUE@COMPILE_TARGET = winexe @ENABLE_RELEASE_TRUE@COMPILE_TARGET = winexe @ENABLE_DEBUG_TRUE@PROJECT_REFERENCES = \ @ENABLE_DEBUG_TRUE@ ../../../bin/Mono.Upnp.dll @ENABLE_RELEASE_TRUE@PROJECT_REFERENCES = \ @ENABLE_RELEASE_TRUE@ ../../../bin/Mono.Upnp.dll @ENABLE_DEBUG_TRUE@BUILD_DIR = ../../../bin @ENABLE_RELEASE_TRUE@BUILD_DIR = ../../../bin @ENABLE_DEBUG_TRUE@MONO_UPNP_GTKCLIENT_EXE_MDB_SOURCE = ../../../bin/Mono.Upnp.GtkClient.exe.mdb @ENABLE_DEBUG_TRUE@MONO_UPNP_GTKCLIENT_EXE_MDB = $(BUILD_DIR)/Mono.Upnp.GtkClient.exe.mdb @ENABLE_RELEASE_TRUE@MONO_UPNP_GTKCLIENT_EXE_MDB = @ENABLE_DEBUG_TRUE@MONO_UPNP_DLL_SOURCE = ../../../bin/Mono.Upnp.dll @ENABLE_RELEASE_TRUE@MONO_UPNP_DLL_SOURCE = ../../../bin/Mono.Upnp.dll @ENABLE_DEBUG_TRUE@MONO_SSDP_DLL_SOURCE = ../../../bin/Mono.Ssdp.dll @ENABLE_RELEASE_TRUE@MONO_SSDP_DLL_SOURCE = ../../../bin/Mono.Ssdp.dll @ENABLE_DEBUG_TRUE@MONO_SSDP_DLL_MDB_SOURCE = ../../../bin/Mono.Ssdp.dll.mdb @ENABLE_DEBUG_TRUE@MONO_SSDP_DLL_MDB = $(BUILD_DIR)/Mono.Ssdp.dll.mdb @ENABLE_RELEASE_TRUE@MONO_SSDP_DLL_MDB = @ENABLE_DEBUG_TRUE@MONO_UPNP_DLL_MDB_SOURCE = ../../../bin/Mono.Upnp.dll.mdb @ENABLE_DEBUG_TRUE@MONO_UPNP_DLL_MDB = $(BUILD_DIR)/Mono.Upnp.dll.mdb @ENABLE_RELEASE_TRUE@MONO_UPNP_DLL_MDB = AL = al2 SATELLITE_ASSEMBLY_NAME = $(notdir $(basename $(ASSEMBLY))).resources.dll PROGRAMFILES = \ $(MONO_UPNP_GTKCLIENT_EXE_MDB) \ $(MONO_UPNP_DLL) \ $(MONO_SSDP_DLL) \ $(MONO_SSDP_DLL_MDB) \ $(MONO_UPNP_DLL_MDB) BINARIES = \ $(MONO_UPNP_GTK) RESGEN = resgen2 FILES = \ AssemblyInfo.cs \ gtk-gui/generated.cs \ gtk-gui/Mono.Upnp.GtkClient.ActionInvocationWindow.cs \ gtk-gui/Mono.Upnp.GtkClient.DeviceAnnouncementInfo.cs \ gtk-gui/Mono.Upnp.GtkClient.DeviceDescriptionInfo.cs \ gtk-gui/Mono.Upnp.GtkClient.LazyDeviceInfo.cs \ gtk-gui/Mono.Upnp.GtkClient.LazyIcon.cs \ gtk-gui/Mono.Upnp.GtkClient.LazyServiceInfo.cs \ gtk-gui/Mono.Upnp.GtkClient.MainWindow.cs \ gtk-gui/Mono.Upnp.GtkClient.RawXmlInfo.cs \ gtk-gui/Mono.Upnp.GtkClient.ServiceAnnouncementInfo.cs \ gtk-gui/Mono.Upnp.GtkClient.ServiceDescriptionInfo.cs \ gtk-gui/Mono.Upnp.GtkClient.ServiceScpdInfo.cs \ Mono.Upnp.GtkClient/ActionInvocationWindow.cs \ Mono.Upnp.GtkClient/DeviceAnnouncementInfo.cs \ Mono.Upnp.GtkClient/DeviceAnnouncementInfoProvider.cs \ Mono.Upnp.GtkClient/DeviceDescriptionInfo.cs \ Mono.Upnp.GtkClient/DeviceDescriptionInfoProvider.cs \ Mono.Upnp.GtkClient/GtkClient.cs \ Mono.Upnp.GtkClient/IDeviceInfoProvider.cs \ Mono.Upnp.GtkClient/IServiceInfoProvider.cs \ Mono.Upnp.GtkClient/LazyDeviceInfo.cs \ Mono.Upnp.GtkClient/LazyIcon.cs \ Mono.Upnp.GtkClient/LazyServiceInfo.cs \ Mono.Upnp.GtkClient/MainWindow.cs \ Mono.Upnp.GtkClient/RawDeviceDescriptionInfoProvider.cs \ Mono.Upnp.GtkClient/RawServiceDescriptionInfoProvider.cs \ Mono.Upnp.GtkClient/RawServiceScdpInfoProvider.cs \ Mono.Upnp.GtkClient/RawXmlInfo.cs \ Mono.Upnp.GtkClient/ServiceAnnouncementInfo.cs \ Mono.Upnp.GtkClient/ServiceAnnouncementInfoProvider.cs \ Mono.Upnp.GtkClient/ServiceDescriptionInfo.cs \ Mono.Upnp.GtkClient/ServiceDescriptionInfoProvider.cs \ Mono.Upnp.GtkClient/ServiceScpdInfo.cs \ Mono.Upnp.GtkClient/ServiceScpdInfoProvider.cs DATA_FILES = RESOURCES = gtk-gui/gui.stetic EXTRAS = \ app.desktop \ Mono.Upnp.GtkClient \ mono-upnp-gtk.in REFERENCES = \ ../../../bin/Mono.Upnp.dll \ Mono.Posix \ -pkg:glade-sharp-2.0 \ -pkg:glib-sharp-2.0 \ -pkg:gtk-sharp-2.0 \ -pkg:mono-addins \ System \ System.Xml DLL_REFERENCES = CLEANFILES = $(PROGRAMFILES) $(BINARIES) $(ASSEMBLY) $(ASSEMBLY).mdb \ $(BINARIES) $(build_resx_resources) \ $(build_satellite_assembly_list) VALID_CULTURES = ar bg ca zh-CHS cs da de el en es fi fr he hu is it ja ko nl no pl pt ro ru hr sk sq sv th tr id uk be sl et lv lt fa vi hy eu mk af ka fo hi sw gu ta te kn mr gl kok ar-SA bg-BG ca-ES zh-TW cs-CZ da-DK de-DE el-GR en-US fi-FI fr-FR he-IL hu-HU is-IS it-IT ja-JP ko-KR nl-NL nb-NO pl-PL pt-BR ro-RO ru-RU hr-HR sk-SK sq-AL sv-SE th-TH tr-TR id-ID uk-UA be-BY sl-SI et-EE lv-LV lt-LT fa-IR vi-VN hy-AM eu-ES mk-MK af-ZA ka-GE fo-FO hi-IN sw-KE gu-IN ta-IN te-IN kn-IN mr-IN gl-ES kok-IN ar-IQ zh-CN de-CH en-GB es-MX fr-BE it-CH nl-BE nn-NO pt-PT sv-FI ar-EG zh-HK de-AT en-AU es-ES fr-CA ar-LY zh-SG de-LU en-CA es-GT fr-CH ar-DZ zh-MO en-NZ es-CR fr-LU ar-MA en-IE es-PA ar-TN en-ZA es-DO ar-OM es-VE ar-YE es-CO ar-SY es-PE ar-JO en-TT es-AR ar-LB en-ZW es-EC ar-KW en-PH es-CL ar-AE es-UY ar-BH es-PY ar-QA es-BO es-SV es-HN es-NI es-PR zh-CHT s2q = $(subst \ ,?,$1) q2s = $(subst ?,\ ,$1) # use this when result will be quoted unesc2 = $(subst ?, ,$1) build_sources = $(FILES) $(GENERATED_FILES) build_sources_esc = $(call s2q,$(build_sources)) # use unesc2, as build_sources_embed is quoted build_sources_embed = $(call unesc2,$(build_sources_esc:%='$(srcdir)/%')) comma__ = , get_resource_name = $(firstword $(subst $(comma__), ,$1)) get_culture = $(lastword $(subst ., ,$(basename $1))) is_cultured_resource = $(and $(word 3,$(subst ., ,$1)), $(filter $(VALID_CULTURES),$(lastword $(subst ., ,$(basename $1))))) RESOURCES_ESC = $(call s2q,$(RESOURCES)) build_resx_list = $(foreach res, $(RESOURCES_ESC), $(if $(filter %.resx, $(call get_resource_name,$(res))),$(res),)) build_non_culture_resx_list = $(foreach res, $(build_resx_list),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_non_culture_others_list = $(foreach res, $(filter-out $(build_resx_list),$(RESOURCES_ESC)),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_others_list = $(build_non_culture_others_list) build_xamlg_list = $(filter %.xaml.g.cs, $(FILES)) # resgen all .resx resources build_resx_files = $(foreach res, $(build_resx_list), $(call get_resource_name,$(res))) build_resx_resources_esc = $(build_resx_files:.resx=.resources) build_resx_resources = $(call q2s,$(build_resx_resources_esc)) # embed resources for the main assembly build_resx_resources_hack = $(subst .resx,.resources, $(build_non_culture_resx_list)) # use unesc2, as build_resx_resources_embed is quoted build_resx_resources_embed = $(call unesc2,$(build_resx_resources_hack:%='-resource:%')) build_others_files = $(call q2s,$(foreach res, $(build_others_list),$(call get_resource_name,$(res)))) build_others_resources = $(build_others_files) # use unesc2, as build_others_resources_embed is quoted build_others_resources_embed = $(call unesc2,$(build_others_list:%='-resource:$(srcdir)/%')) build_resources = $(build_resx_resources) $(build_others_resources) build_resources_embed = $(build_resx_resources_embed) $(build_others_resources_embed) # -usesourcepath is available only for resgen2 emit_resgen_target_1 = $(call q2s,$1) : $(call q2s,$(subst .resources,.resx,$1)); cd '$$(shell dirname '$$<')' && MONO_IOMAP=drive $$(RESGEN) '$$(shell basename '$$<')' '$$(shell basename '$$@')' emit_resgen_target_2 = $(call q2s,$1) : $(call q2s,$(subst .resources,.resx,$1)); MONO_IOMAP=drive $$(RESGEN) -usesourcepath '$$<' '$$@' emit_resgen_target = $(if $(filter resgen2,$(RESGEN)),$(emit_resgen_target_2),$(emit_resgen_target_1)) emit_resgen_targets = $(foreach res,$(build_resx_resources_esc),$(eval $(call emit_resgen_target,$(res)))) build_references_ref = $(call q2s,$(foreach ref, $(call \ s2q,$(REFERENCES)), $(if $(filter -pkg:%, $(ref)), $(ref), \ $(if $(filter -r:%, $(ref)), $(ref), -r:$(ref))))) $(call \ q2s,$(foreach ref, $(call s2q,$(DLL_REFERENCES)), -r:$(ref))) \ $(call q2s,$(foreach ref, $(call s2q,$(PROJECT_REFERENCES)), \ -r:$(ref))) s2q2s = $(call unesc2,$(call s2q,$1)) cp_actual = test -z $1 || cp $1 $2 cp = $(call cp_actual,'$(call s2q2s,$1)','$(call s2q2s,$2)') rm_actual = test -z '$1' || rm -f '$2' rm = $(call rm_actual,$(call s2q2s,$1),$(call s2q2s,$2)/$(shell basename '$(call s2q2s,$1)')) DISTCLEANFILES = $(GENERATED_FILES) $(pc_files) $(BUILD_DIR)/* assemblyfilesdir = $(pkglibdir) assemblyfiles_DATA = $(ASSEMBLY) bin_SCRIPTS = $(BINARIES) programfilesdir = @libdir@/@PACKAGE@ programfiles_DATA = $(PROGRAMFILES) linuxpkgconfigdir = @libdir@/pkgconfig linuxpkgconfig_DATA = $(LINUX_PKGCONFIG) # generating satellite assemblies culture_resources = $(foreach res, $(RESOURCES_ESC), $(if $(call is_cultured_resource,$(call get_resource_name, $(res))),$(res))) cultures = $(sort $(foreach res, $(culture_resources), $(call get_culture,$(call get_resource_name,$(res))))) culture_resource_dependencies = $(call q2s,$(BUILD_DIR)/$1/$(SATELLITE_ASSEMBLY_NAME): $(subst .resx,.resources,$2)) culture_resource_commandlines = $(call unesc2,cmd_line_satellite_$1 += '/embed:$(subst .resx,.resources,$2)') build_satellite_assembly_list = $(call q2s,$(cultures:%=$(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME))) build_culture_res_files = $(call q2s,$(foreach res, $(culture_resources),$(call get_resource_name,$(res)))) install_satellite_assembly_list = $(subst $(BUILD_DIR),$(DESTDIR)$(libdir)/$(PACKAGE),$(build_satellite_assembly_list)) MONO_UPNP_DLL = $(BUILD_DIR)/Mono.Upnp.dll MONO_SSDP_DLL = $(BUILD_DIR)/Mono.Ssdp.dll MONO_UPNP_GTK = $(BUILD_DIR)/mono-upnp-gtk all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.include $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Mono.Upnp/Mono.Upnp.GtkClient/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Mono.Upnp/Mono.Upnp.GtkClient/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/Makefile.include: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mono-upnp-gtk: $(top_builddir)/config.status $(srcdir)/mono-upnp-gtk.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) install-assemblyfilesDATA: $(assemblyfiles_DATA) @$(NORMAL_INSTALL) test -z "$(assemblyfilesdir)" || $(MKDIR_P) "$(DESTDIR)$(assemblyfilesdir)" @list='$(assemblyfiles_DATA)'; test -n "$(assemblyfilesdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(assemblyfilesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(assemblyfilesdir)" || exit $$?; \ done uninstall-assemblyfilesDATA: @$(NORMAL_UNINSTALL) @list='$(assemblyfiles_DATA)'; test -n "$(assemblyfilesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(assemblyfilesdir)'; $(am__uninstall_files_from_dir) install-linuxpkgconfigDATA: $(linuxpkgconfig_DATA) @$(NORMAL_INSTALL) test -z "$(linuxpkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(linuxpkgconfigdir)" @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(linuxpkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(linuxpkgconfigdir)" || exit $$?; \ done uninstall-linuxpkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(linuxpkgconfigdir)'; $(am__uninstall_files_from_dir) install-programfilesDATA: $(programfiles_DATA) @$(NORMAL_INSTALL) test -z "$(programfilesdir)" || $(MKDIR_P) "$(DESTDIR)$(programfilesdir)" @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(programfilesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(programfilesdir)" || exit $$?; \ done uninstall-programfilesDATA: @$(NORMAL_UNINSTALL) @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(programfilesdir)'; $(am__uninstall_files_from_dir) tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(assemblyfilesdir)" "$(DESTDIR)$(linuxpkgconfigdir)" "$(DESTDIR)$(programfilesdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-assemblyfilesDATA install-linuxpkgconfigDATA \ install-programfilesDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binSCRIPTS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-assemblyfilesDATA uninstall-binSCRIPTS \ uninstall-linuxpkgconfigDATA uninstall-programfilesDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-assemblyfilesDATA \ install-binSCRIPTS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-linuxpkgconfigDATA install-man install-pdf \ install-pdf-am install-programfilesDATA install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \ uninstall-am uninstall-assemblyfilesDATA uninstall-binSCRIPTS \ uninstall-linuxpkgconfigDATA uninstall-programfilesDATA all: $(ASSEMBLY) $(PROGRAMFILES) $(BINARIES) # macros # $(call emit-deploy-target,deploy-variable-name) define emit-deploy-target $($1): $($1_SOURCE) mkdir -p '$$(shell dirname '$$@')' cp '$$<' '$$@' endef # $(call emit-deploy-wrapper,wrapper-variable-name,wrapper-sourcefile,x) # assumes that for a wrapper foo.pc its source template is foo.pc.in # if $3 is non-empty then wrapper is marked exec define emit-deploy-wrapper $($1): $2 mkdir -p '$$(shell dirname '$$@')' cp '$$<' '$$@' $(if $3,chmod +x '$$@') endef $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_dependencies,$(call get_culture,$(call get_resource_name,$(res))),$(call get_resource_name,$(res)))))) $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_commandlines,$(call get_culture,$(call get_resource_name,$(res))),$(res))))) $(build_satellite_assembly_list): $(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME): mkdir -p '$(@D)' $(AL) -out:'$@' -culture:$* -t:lib $(cmd_line_satellite_$*) $(install_satellite_assembly_list): mkdir -p '$(@D)' cp $(subst $(DESTDIR)$(libdir)/$(PACKAGE), $(BUILD_DIR), $@) $@ install-satellite-assemblies: $(install_satellite_assembly_list) uninstall-satellite-assemblies: rm -rf $(install_satellite_assembly_list) $(eval $(call emit-deploy-wrapper,MONO_UPNP_GTK,mono-upnp-gtk,x)) $(eval $(call emit_resgen_targets)) $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(ASSEMBLY_MDB): $(ASSEMBLY) $(ASSEMBLY): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(shell dirname $(ASSEMBLY)) $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp.GtkClient/mono-upnp-gtk.in0000664000175000017500000000012011715002253026104 0ustar00lorentzlorentz00000000000000#!/bin/sh exec mono "@expanded_libdir@/@PACKAGE@/Mono.Upnp.GtkClient.exe" "$@" mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp.GtkClient/AssemblyInfo.cs0000664000175000017500000000445211714307244026006 0ustar00lorentzlorentz00000000000000// // AssemblyInfo.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System.Reflection; using System.Runtime.CompilerServices; using Mono.Addins; // Information about this assembly is defined by the following attributes. // Change them to the values specific to your project. [assembly: AssemblyTitle ("Mono.Upnp.GtkClient")] [assembly: AssemblyDescription ("A GTK interface for interacting with UPnP devices and services.")] [assembly: AssemblyConfiguration ("")] [assembly: AssemblyCompany ("")] [assembly: AssemblyProduct ("")] [assembly: AssemblyCopyright ("Scott Thomas")] [assembly: AssemblyTrademark ("")] [assembly: AssemblyCulture ("")] // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". // The form "{Major}.{Minor}.*" will automatically update the build and revision, // and "{Major}.{Minor}.{Build}.*" will update just the revision. [assembly: AssemblyVersion ("1.0.*")] // The following attributes are used to specify the signing key for the assembly, // if desired. See the Mono documentation for more information about signing. //[assembly: AssemblyDelaySign(false)] //[assembly: AssemblyKeyFile("")] [assembly: AddinRoot ("Mono.Upnp.GtkClient", "1.0")] mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp.GtkClient/app.desktop0000664000175000017500000000023011714307410025220 0ustar00lorentzlorentz00000000000000[Desktop Entry] Encoding=UTF-8 Type=Application Name=Mono.Upnp.Gtk Exec=mono-upnp-gtk Terminal=false Categories=Debugger;Development; OnlyShowIn=GNOME; mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp.GtkClient/Mono.Upnp.GtkClient/0000775000175000017500000000000011707010776026576 5ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp.GtkClient/Mono.Upnp.GtkClient/DeviceDescriptionInfo.cs0000664000175000017500000000453011707010776033346 0ustar00lorentzlorentz00000000000000// // DeviceDescriptionInfo.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using Gtk; namespace Mono.Upnp.GtkClient { [System.ComponentModel.ToolboxItem(true)] public partial class DeviceDescriptionInfo : Bin { public DeviceDescriptionInfo (Device device) { this.Build (); deviceType.Text = device.Type.ToString (); udn.Text = device.Udn; friendlyName.Text = device.FriendlyName; manufacturer.Text = device.Manufacturer; manufacturerUrl.Text = device.ManufacturerUrl != null ? device.ManufacturerUrl.ToString () : null; modelName.Text = device.ModelName; modelNumber.Text = device.ModelNumber; modelUrl.Text = device.ModelUrl != null ? device.ModelUrl.ToString () : null; serialNumber.Text = device.SerialNumber; upc.Text = device.Upc; foreach (var icon in device.Icons) { var expander = new Expander (string.Format ("{0}, {1}x{2}x{3}", icon.MimeType, icon.Width, icon.Height, icon.Depth)); expander.Add (new LazyIcon (icon)); iconBox.PackStart (expander, true, true, 0); } } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp.GtkClient/Mono.Upnp.GtkClient/RawXmlInfo.cs0000664000175000017500000000476411707010776031166 0ustar00lorentzlorentz00000000000000// // RawXmlInfo.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.IO; using System.Net; using System.Text; using System.Xml; namespace Mono.Upnp.GtkClient { [System.ComponentModel.ToolboxItem(true)] public partial class RawXmlInfo : Gtk.Bin { public RawXmlInfo (Uri location) { this.Build (); var request = WebRequest.Create (location); using (var response = request.GetResponse ()) { using (var stream = response.GetResponseStream ()) { using (var reader = new StreamReader (stream)) { raw.Buffer.Text = reader.ReadToEnd (); } } } try { using (var string_reader = new StringReader (raw.Buffer.Text)) { using (var xml_reader = XmlReader.Create (string_reader, new XmlReaderSettings { IgnoreWhitespace = true })) { var builder = new StringBuilder (); using (var writer = XmlWriter.Create (builder, new XmlWriterSettings { Indent = true })) { writer.WriteNode (xml_reader, true); } raw.Buffer.Text = builder.ToString (); } } } catch { } } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp.GtkClient/Mono.Upnp.GtkClient/ActionInvocationWindow.cs0000664000175000017500000001463611707010776033576 0ustar00lorentzlorentz00000000000000// // ActionInvocationWindow.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using System.Threading; using Gtk; using Mono.Upnp.Control; namespace Mono.Upnp.GtkClient { public partial class ActionInvocationWindow : Window { readonly ServiceAction action; readonly Table table; public ActionInvocationWindow (ServiceController service, ServiceAction action) : base (WindowType.Toplevel) { this.action = action; this.Build (); name.Markup = string.Format ("{0}", action.Name); var arguments = new List (); foreach (var argument in action.Arguments) { if (argument.Value.Direction == ArgumentDirection.In) { arguments.Add (argument.Value); } } table = new Table ((uint)2, (uint)arguments.Count, false); var row = (uint)0; foreach (var argument in arguments) { table.Attach (new Label (argument.Name), (uint)0, (uint)1, row, row + 1); Widget widget; var related_state_variable = service.StateVariables[argument.RelatedStateVariable]; if (related_state_variable.AllowedValues != null) { var combobox = ComboBox.NewText (); var i = 0; var index = i; foreach (var allowed_value in related_state_variable.AllowedValues) { combobox.AppendText (allowed_value); if (allowed_value == related_state_variable.DefaultValue) { index = i; } i++; } combobox.Active = index; widget = combobox; } else if (related_state_variable.AllowedValueRange != null) { widget = new SpinButton ( double.Parse (related_state_variable.AllowedValueRange.Minimum), double.Parse (related_state_variable.AllowedValueRange.Maximum), double.Parse (related_state_variable.AllowedValueRange.Step)); } else if (related_state_variable.DataType == "i4") { widget = new SpinButton (int.MinValue, int.MaxValue, 1.0) { Value = related_state_variable.DefaultValue != null ? double.Parse (related_state_variable.DefaultValue) : 0 }; } else if (related_state_variable.DataType == "ui4") { widget = new SpinButton (int.MinValue, int.MaxValue, 1.0) { Value = related_state_variable.DefaultValue != null ? double.Parse (related_state_variable.DefaultValue) : 0 }; } else { widget = new Entry { Text = related_state_variable.DefaultValue != null ? related_state_variable.DefaultValue : "" }; } table.Attach (widget, (uint)1, (uint)2, row, row + 1); row++; } inputsBox.PackStart (table, true, true, 0); inputsBox.ShowAll (); } protected virtual void OnInvokeClicked (object sender, System.EventArgs e) { foreach (var child in outputsBox.Children) { outputsBox.Remove (child); } var arguments = new Dictionary (); var children = table.Children; for (var i = children.Length - 1; i > 0; i -= 2) { string value; var child = children[i - 1]; var entry = child as Entry; if (entry != null) { value = entry.Text; } else { value = ((ComboBox)child).ActiveText; } arguments[((Label)children[i]).Text] = value; } inputsBox.Sensitive = false; invoke.Sensitive = false; ThreadPool.QueueUserWorkItem (state => { try { var results = action.Invoke (arguments); if (results == null) { return; } Application.Invoke ((o, a) => { foreach (var result in results) { var expander = new Expander (result.Key); expander.Add (new Label (result.Value) { LineWrap = true, Selectable = true }); outputsBox.PackStart (expander, false, false, 0); } outputsBox.ShowAll (); inputsBox.Sensitive = true; invoke.Sensitive = true; }); } catch (UpnpControlException exception) { // TODO report error to the UI Console.WriteLine ("Upnp error: " + exception.UpnpError); } }); } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp.GtkClient/Mono.Upnp.GtkClient/ServiceScpdInfo.cs0000664000175000017500000001473411707010776032164 0ustar00lorentzlorentz00000000000000// // ServiceScpdInfo.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using Gtk; using Mono.Unix; using Mono.Upnp.Control; namespace Mono.Upnp.GtkClient { [System.ComponentModel.ToolboxItem(true)] public partial class ServiceScpdInfo : Gtk.Bin { ServiceController service; TreeStore actionModel; TreeStore stateVariableModel; public ServiceScpdInfo (ServiceController service) { this.Build (); this.service = service; actionModel = new TreeStore (typeof (string)); stateVariableModel = new TreeStore (typeof (string)); foreach (var action in service.Actions) { var iter = actionModel.AppendValues (action.Key); foreach (var argument in action.Value.Arguments) { var argument_iter = actionModel.AppendValues (iter, argument.Key); actionModel.AppendValues (argument_iter, Catalog.GetString ("Direction: ") + (argument.Value.Direction == ArgumentDirection.In ? "In" : "Out")); actionModel.AppendValues (argument_iter, Catalog.GetString ("Is Return Value: ") + argument.Value.IsReturnValue); actionModel.AppendValues (argument_iter, Catalog.GetString ("Related State Variable: ") + argument.Value.RelatedStateVariable); } } foreach (var stateVariable in service.StateVariables) { var iter = stateVariableModel.AppendValues (stateVariable.Key); stateVariableModel.AppendValues (iter, Catalog.GetString ("Data Type: ") + stateVariable.Value.DataType); stateVariableModel.AppendValues (iter, Catalog.GetString ("Sends Events: ") + stateVariable.Value.SendsEvents); stateVariableModel.AppendValues (iter, Catalog.GetString ("Is Multicast: ") + stateVariable.Value.IsMulticast); if (stateVariable.Value.DefaultValue != null) { stateVariableModel.AppendValues (iter, Catalog.GetString ("Default Value: ") + stateVariable.Value.DefaultValue); } if (stateVariable.Value.AllowedValues != null) { var allowed_values_iter = stateVariableModel.AppendValues (iter, Catalog.GetString ("Allowed Values")); foreach (var value in stateVariable.Value.AllowedValues) { stateVariableModel.AppendValues (allowed_values_iter, value); } } if (stateVariable.Value.AllowedValueRange != null) { var allowed_value_range_iter = stateVariableModel.AppendValues (iter, Catalog.GetString ("Allowed Value Range")); stateVariableModel.AppendValues (allowed_value_range_iter, "Minimum: " + stateVariable.Value.AllowedValueRange.Minimum); stateVariableModel.AppendValues (allowed_value_range_iter, "Maximum: " + stateVariable.Value.AllowedValueRange.Maximum); if (stateVariable.Value.AllowedValueRange.Step != null) { stateVariableModel.AppendValues (allowed_value_range_iter, "Step: " + stateVariable.Value.AllowedValueRange.Step); } } } actions.AppendColumn (Catalog.GetString ("Actions"), new CellRendererText (), "text", 0); actions.Model = actionModel; actions.Selection.Changed += ActionsSelectionChanged; stateVariables.AppendColumn (Catalog.GetString ("State Variables"), new CellRendererText (), "text", 0); stateVariables.Model = stateVariableModel; } void ActionsSelectionChanged (object sender, EventArgs e) { TreeIter iter; if (!actions.Selection.GetSelected (out iter)) { return; } switch (actionModel.IterDepth (iter)) { case 1: actionModel.IterNthChild (out iter, iter, 2); break; case 2: actionModel.IterParent (out iter, iter); goto case 1; default: return; } var value = (string)actionModel.GetValue (iter, 0); var related_state_variable = value.Substring (24); if (!stateVariableModel.GetIterFirst (out iter)) { return; } while (related_state_variable != (string)stateVariableModel.GetValue (iter, 0) && stateVariableModel.IterNext (ref iter)) { } stateVariables.Selection.SelectIter (iter); } protected virtual void OnActionsRowActivated (object o, Gtk.RowActivatedArgs args) { TreeIter iter; if (!actionModel.GetIter (out iter, args.Path)) { return; } if (actionModel.IterDepth (iter) == 0) { var value = (string)actionModel.GetValue (iter, 0); var window = new ActionInvocationWindow (service, service.Actions[value]); window.ShowAll (); } } } } DeviceAnnouncementInfoProvider.cs0000664000175000017500000000323611707010776035153 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp.GtkClient/Mono.Upnp.GtkClient// // DeviceAnnouncementInfoProvider.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; namespace Mono.Upnp.GtkClient { public class DeviceAnnouncementInfoProvider : IDeviceInfoProvider { public string Name { get { return "Announcement"; } } public bool CanProvideInfo (DeviceType type) { return true; } public Gtk.Widget ProvideInfo (DeviceAnnouncement device) { return new DeviceAnnouncementInfo (device); } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp.GtkClient/Mono.Upnp.GtkClient/ServiceAnnouncementInfo.cs0000664000175000017500000000341411707010776033716 0ustar00lorentzlorentz00000000000000// // ServiceAnnouncementInfo.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; namespace Mono.Upnp.GtkClient { [System.ComponentModel.ToolboxItem(true)] public partial class ServiceAnnouncementInfo : Gtk.Bin { public ServiceAnnouncementInfo (ServiceAnnouncement service) { this.Build (); serviceType.Text = service.Type.ToString (); deviceUdn.Text = service.DeviceUdn; foreach (var location in service.Locations) { locationBox.PackStart (new Gtk.Label (location) { Selectable = true, Xalign = 0F }, true, true, 0); } } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp.GtkClient/Mono.Upnp.GtkClient/GtkClient.cs0000664000175000017500000000311111707010776031005 0ustar00lorentzlorentz00000000000000// // GtkClient.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using Gtk; using Mono.Addins; namespace Mono.Upnp.GtkClient { class GtkClient { public static void Main (string[] args) { Application.Init (); AddinManager.Initialize (); AddinManager.Registry.Update (null); MainWindow win = new MainWindow (); win.Show (); Application.Run (); } } } RawServiceDescriptionInfoProvider.cs0000664000175000017500000000343611707010776035661 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp.GtkClient/Mono.Upnp.GtkClient// // RawServiceDescriptionInfoProvider.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; namespace Mono.Upnp.GtkClient { public class RawServiceDescriptionInfoProvider : IServiceInfoProvider { public string Name { get { return "Raw Device Description"; } } public bool CanProvideInfo (ServiceType type) { return true; } public Gtk.Widget ProvideInfo (ServiceAnnouncement service) { var locations = service.Locations.GetEnumerator (); locations.MoveNext (); return new RawXmlInfo (new Uri (locations.Current)); } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp.GtkClient/Mono.Upnp.GtkClient/LazyDeviceInfo.cs0000664000175000017500000000554111707010776032005 0ustar00lorentzlorentz00000000000000// // LazyDeviceInfo.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Threading; using Gtk; using Mono.Unix; namespace Mono.Upnp.GtkClient { [System.ComponentModel.ToolboxItem(true)] public partial class LazyDeviceInfo : Gtk.Bin { readonly IDeviceInfoProvider provider; readonly DeviceAnnouncement device; bool mapped; public LazyDeviceInfo (IDeviceInfoProvider provider, DeviceAnnouncement device) { this.provider = provider; this.device = device; this.Build (); loading.Text = Catalog.GetString ("Loading " + provider.Name); } protected virtual void OnMapped (object sender, System.EventArgs e) { if (!mapped) { mapped = true; ThreadPool.QueueUserWorkItem (state => { Gtk.Widget widget; try { widget = provider.ProvideInfo (device); } catch (Exception exception) { var box = new VBox (); box.PackStart (new Gtk.Label ("Failed to Load " + provider.Name), true, true, 0); var expander = new Expander ("Error"); expander.Add (new Label (exception.ToString ())); box.PackStart (expander, true, true, 0); widget = box; } Gtk.Application.Invoke ((o, a) => { alignment.Remove (alignment.Child); alignment.Add (widget); ShowAll (); }); }); } } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp.GtkClient/Mono.Upnp.GtkClient/MainWindow.cs0000664000175000017500000001540311707010776031204 0ustar00lorentzlorentz00000000000000// // MainWindow.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using Gtk; using Mono.Addins; using Mono.Unix; namespace Mono.Upnp.GtkClient { public partial class MainWindow : Gtk.Window { readonly Client client; readonly ListStore model; public MainWindow () : base (Gtk.WindowType.Toplevel) { Build (); list.AppendColumn (Catalog.GetString ("Icon"), new CellRendererPixbuf (), "pixbuf", 0); list.AppendColumn (Catalog.GetString ("UPnP Devices and Services"), new CellRendererText (), RenderCell); model = new ListStore (typeof (Gdk.Pixbuf), typeof (DeviceAnnouncement)); list.Model = model; list.Selection.Changed += ListSelectionChanged; client = new Client (); client.DeviceAdded += ClientDeviceAdded; client.ServiceAdded += ClientServiceAdded; client.DeviceRemoved += ClientDeviceRemoved; client.ServiceRemoved += ClientServiceRemoved; client.BrowseAll (); } void ListSelectionChanged (object sender, EventArgs e) { infoBox.Remove (infoBox.Children[0]); TreeIter iter; if (!list.Selection.GetSelected (out iter)) { infoBox.Add (infoFiller); return; } var value = model.GetValue (iter, 1); var service = value as ServiceAnnouncement; if (service != null) { infoBox.Add (CreateNotebook (service)); } else { infoBox.Add (CreateNotebook ((DeviceAnnouncement)value)); } infoBox.ShowAll (); } void ClientDeviceAdded (object sender, DeviceEventArgs e) { model.AppendValues (Style.LookupIconSet ("Device").RenderIcon (Style, TextDirection.Ltr, StateType.Normal, IconSize.Menu, this, null), e.Device); } void ClientServiceAdded (object sender, ServiceEventArgs e) { model.AppendValues (Style.LookupIconSet ("Service").RenderIcon (Style, TextDirection.Ltr, StateType.Normal, IconSize.Menu, this, null), e.Service); } void ClientDeviceRemoved (object sender, DeviceEventArgs e) { Remove (e.Device); } void ClientServiceRemoved (object sender, ServiceEventArgs e) { Remove (e.Service); } void Remove (T item) where T : class { TreeIter iter; if (!model.GetIterFirst (out iter)) { return; } do { var value = model.GetValue (iter, 1) as T; if (item.Equals (value)) { model.Remove (ref iter); break; } } while (model.IterNext (ref iter)); } void RenderCell (TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter) { var value = model.GetValue (iter, 1); if (value == null) return; var service = value as ServiceAnnouncement; if (service != null) { ((CellRendererText)cell).Text = service.Type.ToString (); } else { ((CellRendererText)cell).Text = ((DeviceAnnouncement)value).Type.ToString (); } } protected void OnDeleteEvent (object sender, Gtk.DeleteEventArgs a) { Gtk.Application.Quit (); a.RetVal = true; } Widget CreateNotebook (DeviceAnnouncement device) { var notebook = new Notebook (); foreach (var provider in DeviceInfoProviders) { if (provider.CanProvideInfo (device.Type)) { notebook.AppendPage (new LazyDeviceInfo (provider, device), new Label (provider.Name)); } } return notebook; } Widget CreateNotebook (ServiceAnnouncement service) { var notebook = new Notebook (); foreach (var provider in ServiceInfoProviders) { if (provider.CanProvideInfo (service.Type)) { notebook.AppendPage (new LazyServiceInfo (provider, service), new Label (provider.Name)); } } return notebook; } static IEnumerable DeviceInfoProviders { get { yield return new DeviceAnnouncementInfoProvider (); yield return new DeviceDescriptionInfoProvider (); yield return new RawDeviceDescriptionInfoProvider (); //foreach (IDeviceInfoProvider extension in AddinManager.GetExtensionObjects (typeof (IDeviceInfoProvider))) { // yield return extension; //} } } static IEnumerable ServiceInfoProviders { get { yield return new ServiceAnnouncementInfoProvider (); yield return new ServiceDescriptionInfoProvider (); yield return new ServiceScpdInfoProvider (); yield return new RawServiceDescriptionInfoProvider (); yield return new RawServiceScdpInfoProvider (); foreach (IServiceInfoProvider extension in AddinManager.GetExtensionObjects (typeof (IServiceInfoProvider))) { yield return extension; } } } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp.GtkClient/Mono.Upnp.GtkClient/RawServiceScdpInfoProvider.cs0000664000175000017500000000326011707010776034341 0ustar00lorentzlorentz00000000000000// // RawServiceScdpInfoProvider.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; namespace Mono.Upnp.GtkClient { public class RawServiceScdpInfoProvider : IServiceInfoProvider { public string Name { get { return "Raw Service Description"; } } public bool CanProvideInfo (ServiceType type) { return true; } public Gtk.Widget ProvideInfo (ServiceAnnouncement service) { return new RawXmlInfo (service.GetService ().ScpdUrl); } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp.GtkClient/Mono.Upnp.GtkClient/LazyInfo.cs0000664000175000017500000000262311707010776030663 0ustar00lorentzlorentz00000000000000// // LazyInfo.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; namespace Mono.Upnp.GtkClient { [System.ComponentModel.ToolboxItem(true)] public partial class LazyInfo : Gtk.Bin { public LazyInfo () { this.Build (); } } } DeviceDescriptionInfoProvider.cs0000664000175000017500000000324711707010776035006 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp.GtkClient/Mono.Upnp.GtkClient// // DeviceDescriptionInfoProvider.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; namespace Mono.Upnp.GtkClient { public class DeviceDescriptionInfoProvider : IDeviceInfoProvider { public string Name { get { return "Description"; } } public bool CanProvideInfo (DeviceType type) { return true; } public Gtk.Widget ProvideInfo (DeviceAnnouncement device) { return new DeviceDescriptionInfo (device.GetDevice ()); } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp.GtkClient/Mono.Upnp.GtkClient/IServiceInfoProvider.cs0000664000175000017500000000273411707010776033173 0ustar00lorentzlorentz00000000000000// // IServiceInfoProvider.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using Mono.Addins; namespace Mono.Upnp.GtkClient { [TypeExtensionPoint] public interface IServiceInfoProvider { string Name { get; } bool CanProvideInfo (ServiceType type); Gtk.Widget ProvideInfo (ServiceAnnouncement service); } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp.GtkClient/Mono.Upnp.GtkClient/ServiceScpdInfoProvider.cs0000664000175000017500000000326411707010776033673 0ustar00lorentzlorentz00000000000000// // ServiceScpdInfoProvider.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; namespace Mono.Upnp.GtkClient { public class ServiceScpdInfoProvider : IServiceInfoProvider { public string Name { get { return "Service Description"; } } public bool CanProvideInfo (ServiceType type) { return true; } public Gtk.Widget ProvideInfo (ServiceAnnouncement service) { return new ServiceScpdInfo (service.GetService ().GetController ()); } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp.GtkClient/Mono.Upnp.GtkClient/IDeviceInfoProvider.cs0000664000175000017500000000272711707010776032774 0ustar00lorentzlorentz00000000000000// // IDeviceInfoProvider.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using Mono.Addins; namespace Mono.Upnp.GtkClient { [TypeExtensionPoint] public interface IDeviceInfoProvider { string Name { get; } bool CanProvideInfo (DeviceType type); Gtk.Widget ProvideInfo (DeviceAnnouncement device); } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp.GtkClient/Mono.Upnp.GtkClient/LazyServiceInfo.cs0000664000175000017500000000557111707010776032211 0ustar00lorentzlorentz00000000000000// // LazyServiceInfo.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Threading; using Gtk; using Mono.Unix; namespace Mono.Upnp.GtkClient { [System.ComponentModel.ToolboxItem (true)] public partial class LazyServiceInfo : Gtk.Bin { readonly IServiceInfoProvider provider; readonly ServiceAnnouncement service; bool mapped; public LazyServiceInfo (IServiceInfoProvider provider, ServiceAnnouncement service) { this.provider = provider; this.service = service; this.Build (); loading.Text = Catalog.GetString (string.Format ("Loading {0}", provider.Name)); } protected virtual void OnMapped (object sender, EventArgs e) { if (!mapped) { mapped = true; ThreadPool.QueueUserWorkItem (state => { Widget widget; try { widget = provider.ProvideInfo (service); } catch (Exception exception) { var vbox = new VBox (); vbox.PackStart (new Gtk.Label ("Failed to Load " + provider.Name), true, true, 0); var expander = new Expander ("Error"); expander.Add (new Label (exception.ToString ())); vbox.PackStart (expander, true, true, 0); widget = vbox; } Gtk.Application.Invoke ((o, a) => { alignment.Remove (alignment.Child); alignment.Add (widget); ShowAll (); }); }); } } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp.GtkClient/Mono.Upnp.GtkClient/ServiceDescriptionInfo.cs0000664000175000017500000000335211707010776033550 0ustar00lorentzlorentz00000000000000// // ServiceDescriptionInfo.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; namespace Mono.Upnp.GtkClient { [System.ComponentModel.ToolboxItem(true)] public partial class ServiceDescriptionInfo : Gtk.Bin { public ServiceDescriptionInfo (Service service) { this.Build (); serviceType.Text = service.Type.ToString (); serviceId.Text = service.Id; scpdUrl.Text = service.ScpdUrl.ToString (); controlUrl.Text = service.ControlUrl.ToString (); eventUrl.Text = service.EventUrl.ToString (); } } } ServiceDescriptionInfoProvider.cs0000664000175000017500000000326711707010776035211 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp.GtkClient/Mono.Upnp.GtkClient// // ServiceDescriptionInfoProvider.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; namespace Mono.Upnp.GtkClient { public class ServiceDescriptionInfoProvider : IServiceInfoProvider { public string Name { get { return "Device Description"; } } public bool CanProvideInfo (ServiceType type) { return true; } public Gtk.Widget ProvideInfo (ServiceAnnouncement service) { return new ServiceDescriptionInfo (service.GetService ()); } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp.GtkClient/Mono.Upnp.GtkClient/Browser.cs0000664000175000017500000000274011707010776030553 0ustar00lorentzlorentz00000000000000// // Browser.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using Gtk; using Mono.Addins; using Mono.Unix; namespace Mono.Upnp.GtkClient { public partial class Browser : Gtk.Window { public Browser () : base (Gtk.WindowType.Toplevel) { Build (); } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp.GtkClient/Mono.Upnp.GtkClient/LazyIcon.cs0000664000175000017500000000427411707010776030664 0ustar00lorentzlorentz00000000000000// // LazyIcon.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.IO; using System.Threading; namespace Mono.Upnp.GtkClient { [System.ComponentModel.ToolboxItem(true)] public partial class LazyIcon : Gtk.Bin { readonly Icon icon; bool mapped; public LazyIcon (Icon icon) { this.icon = icon; this.Build (); } protected virtual void OnMapped (object sender, System.EventArgs e) { if (!mapped) { mapped = true; ThreadPool.QueueUserWorkItem(state => { var stream = new MemoryStream (icon.GetData ()); var pixbuf = new Gdk.Pixbuf (stream); var image = new Gtk.Image (pixbuf); Gtk.Application.Invoke ((o, a) => { alignment.Remove (alignment.Child); alignment.Add (image); ShowAll (); }); }); } } } } ServiceAnnouncementInfoProvider.cs0000664000175000017500000000324611707010776035355 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp.GtkClient/Mono.Upnp.GtkClient// // ServiceAnnouncementInfoProvider.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; namespace Mono.Upnp.GtkClient { public class ServiceAnnouncementInfoProvider : IServiceInfoProvider { public string Name { get { return "Announcement"; } } public bool CanProvideInfo (ServiceType type) { return true; } public Gtk.Widget ProvideInfo (ServiceAnnouncement service) { return new ServiceAnnouncementInfo (service); } } } RawDeviceDescriptionInfoProvider.cs0000664000175000017500000000342711707010776035460 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp.GtkClient/Mono.Upnp.GtkClient// // RawDeviceDescriptionInfoProvider.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; namespace Mono.Upnp.GtkClient { public class RawDeviceDescriptionInfoProvider : IDeviceInfoProvider { public string Name { get { return "Raw Device Description"; } } public bool CanProvideInfo (DeviceType type) { return true; } public Gtk.Widget ProvideInfo (DeviceAnnouncement device) { var locations = device.Locations.GetEnumerator (); locations.MoveNext (); return new RawXmlInfo (new Uri (locations.Current)); } } } mono-upnp-0.1.2/src/Mono.Upnp/Mono.Upnp.GtkClient/Mono.Upnp.GtkClient/DeviceAnnouncementInfo.cs0000664000175000017500000000337011707010776033516 0ustar00lorentzlorentz00000000000000// // DeviceAnnouncementInfo.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; namespace Mono.Upnp.GtkClient { [System.ComponentModel.ToolboxItem(true)] public partial class DeviceAnnouncementInfo : Gtk.Bin { public DeviceAnnouncementInfo (DeviceAnnouncement device) { this.Build (); deviceType.Text = device.Type.ToString (); udn.Text = device.Udn; foreach (var location in device.Locations) { locationBox.PackStart (new Gtk.Label (location) { Selectable = true, Xalign = 0F }, true, true, 0); } } } } mono-upnp-0.1.2/src/Mono.Upnp.Dcp/0000775000175000017500000000000011761740036020052 5ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/0000775000175000017500000000000011761740036024676 5ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem/0000775000175000017500000000000011761740037033606 5ustar00lorentzlorentz00000000000000Mono.Upnp.Dcp.MediaServer1.FileSystem/0000775000175000017500000000000011707010776042436 5ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystemContainerOptionsInfo.cs0000664000175000017500000000350411707010776047101 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem/Mono.Upnp.Dcp.MediaServer1.FileSystem// // ContainerOptionsInfo.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using Mono.Upnp.Dcp.MediaServer1.ContentDirectory1; using UpnpObject = Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.Object; namespace Mono.Upnp.Dcp.MediaServer1.FileSystem { public class ContainerOptionsInfo { readonly string id; public ContainerOptionsInfo (string id, T options) { this.id = id; Options = options; Children = new List (); } public string Id { get { return id; } } public T Options { get; set; } public IList Children { get; private set; } } } ContainerInfo.cs0000664000175000017500000000370211707010776045525 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem/Mono.Upnp.Dcp.MediaServer1.FileSystem// // ContainerInfo.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using Mono.Upnp.Dcp.MediaServer1.ContentDirectory1; using UpnpObject = Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.Object; namespace Mono.Upnp.Dcp.MediaServer1.FileSystem { public class ContainerInfo { public ContainerInfo (Container container, IList children) { if (container == null) { throw new ArgumentNullException ("container"); } else if (children == null) { throw new ArgumentNullException ("children"); } Container = container; Children = children; } public Container Container { get; private set; } public IList Children { get; private set; } } } BuildableMusicArtistOptions.cs0000664000175000017500000000327011707010776050416 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem/Mono.Upnp.Dcp.MediaServer1.FileSystem// // BuildableMusicArtistOptions.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System.Collections.Generic; using Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV; namespace Mono.Upnp.Dcp.MediaServer1.FileSystem { public class BuildableMusicArtistOptions : MusicArtistOptions { Dictionary genres = new Dictionary (); public BuildableMusicArtistOptions () { Genres = genres.Keys; } public void OnGenre (string genre) { genres[genre] = genre; } } } ObjectInfo.cs0000664000175000017500000000363111707010776045012 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem/Mono.Upnp.Dcp.MediaServer1.FileSystem// // ObjectInfo.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using Object = Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.Object; namespace Mono.Upnp.Dcp.MediaServer1.FileSystem { public class ObjectInfo { readonly Object @object; readonly string path; public ObjectInfo (Object @object) : this (@object, null) { } public ObjectInfo (Object @object, string path) { if (@object == null) { throw new ArgumentNullException ("object"); } this.@object = @object; this.path = path; } public Object Object { get { return @object; } } public string Path { get { return path; } } } } ContainerBuilder.cs0000664000175000017500000001346411707010776046226 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem/Mono.Upnp.Dcp.MediaServer1.FileSystem// // ContainerBuilder.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using Mono.Upnp.Dcp.MediaServer1.ContentDirectory1; using Object = Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.Object; namespace Mono.Upnp.Dcp.MediaServer1.FileSystem { public class ContainerBuilder { readonly string id; readonly string title; public ContainerBuilder (string id, string title) { if (id == null) { throw new ArgumentNullException ("id"); } this.id = id; this.title = title; } public string Id { get { return id; } } public string Title { get { return title; } } public Container Build (Action consumer, string title, string id, string parentId, IList children) { if (consumer == null) { throw new ArgumentNullException ("consumer"); } else if (children == null) { throw new ArgumentNullException ("children"); } var container = new Container (id, parentId, new ContainerOptions { Title = title, ChildCount = children.Count }); consumer (new ContainerInfo (container, children)); return container; } } public class ContainerBuilder : ContainerBuilder where T : ContainerOptions { // Public inner types are almost always Bad News. BUT in the interest of avoiding a 3.5 dependency, I am // willing to do this because these type names should never be needed outside of this file due to inference. public delegate T OptionsProducer (T options); public delegate Container ContainerProducer (string id, T options); public delegate string IdProducer (); readonly IdProducer id_producer; readonly ContainerProducer container_producer; public ContainerBuilder (string id, string title, IdProducer idProducer, ContainerProducer containerProducer) : base (id, title) { if (idProducer == null) { throw new ArgumentNullException ("idProducer"); } else if (containerProducer == null) { throw new ArgumentNullException ("containerProducer"); } id_producer = idProducer; container_producer = containerProducer; } Dictionary> containers = new Dictionary> (); public void OnItem (string container, Item item, Action consumer, OptionsProducer optionsProducer) { // And have I mentioned how much I LOVE null checking! It's 2010: do you know where your type system is? if (container == null) { return; } else if (item == null) { throw new ArgumentNullException ("item"); } else if (consumer == null) { throw new ArgumentNullException ("consumer"); } else if (optionsProducer == null) { throw new ArgumentNullException ("optionsProducer"); } ContainerOptionsInfo container_options_info; if (containers.TryGetValue (container, out container_options_info)) { container_options_info.Options = optionsProducer (container_options_info.Options); } else { container_options_info = new ContainerOptionsInfo (id_producer (), optionsProducer (null)); containers[container] = container_options_info; } var reference = new Item (id_producer (), container_options_info.Id, new ItemOptions { RefId = item.Id }); container_options_info.Children.Add (reference); consumer (reference); } public Container Build (Action consumer, string parentId) { if (consumer == null) { throw new ArgumentNullException ("consumer"); } var children = new List (containers.Count); foreach (var container_info in containers.Values) { container_info.Options.ChildCount = container_info.Children.Count; var container = container_producer (Id, container_info.Options); consumer (new ContainerInfo (container, container_info.Children)); children.Add (container); } return Build (consumer, Title, Id, parentId, children); } } } File.cs0000664000175000017500000000272711707010776043654 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem/Mono.Upnp.Dcp.MediaServer1.FileSystem// // File.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using Mono.Upnp.Dcp.MediaServer1.ContentDirectory1; namespace Mono.Upnp.Dcp.MediaServer1.FileSystem { public class File : Item { public File (string id, string parentId, ItemOptions options) : base (id, parentId, options) { } } } FileSystemContentDirectory.cs0000664000175000017500000002463611707010776050304 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem/Mono.Upnp.Dcp.MediaServer1.FileSystem// // FileSystemContentDirectory.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using System.IO; using System.Net; using Mono.Upnp.Control; using Mono.Upnp.Dcp.MediaServer1.ContentDirectory1; using Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV; using Mono.Upnp.Internal; using Mono.Upnp.Xml; using Object = Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.Object; using Mono.Upnp.Dcp.MediaServer1.ConnectionManager1; namespace Mono.Upnp.Dcp.MediaServer1.FileSystem { public class FileSystemContentDirectory : ObjectBasedContentDirectory { const int file_buffer_size = 8192; readonly Uri url; HttpListener listener; IDictionary objects; IDictionary containers; public FileSystemContentDirectory (Uri url, IDictionary objects, IDictionary containers) { if (url == null) { throw new ArgumentNullException ("url"); } else if (objects == null) { throw new ArgumentNullException ("objects"); } else if (containers == null) { throw new ArgumentNullException ("containers"); } this.url = url; this.objects = objects; this.containers = containers; this.listener = new HttpListener (); listener.Prefixes.Add (url.ToString ()); Log.Information (string.Format ("FileSystemContentDirectory created at {0}.", url)); } public override void Start () { CheckDisposed (); if (IsStarted) { return; } listener.Start (); listener.BeginGetContext (OnGetContext, null); base.Start (); } public override void Stop () { CheckDisposed (); if (!IsStarted) { return; } base.Stop (); lock (listener) { listener.Stop (); } } protected override void Dispose (bool disposing) { if (IsDisposed) { return; } base.Dispose (disposing); if (disposing) { Stop (); listener.Close (); } listener = null; } public bool IsDisposed { get { return listener == null; } } void CheckDisposed () { if (IsDisposed) { throw new ObjectDisposedException (ToString ()); } } protected override Object GetObject (string objectId) { ObjectInfo @object; if (!objects.TryGetValue (objectId, out @object)) { throw new UpnpControlException ( Error.NoSuchObject (), string.Format (@"The object ""{0}"" does not exist.", objectId)); } return @object.Object; } protected override int VisitChildren (Action consumer, string objectId, int startIndex, int requestCount, string sortCriteria, out int totalMatches) { var children = GetChildren (objectId); totalMatches = children.Count; return VisitResults (consumer, children, startIndex, requestCount); } protected static int VisitResults (Action consumer, IList objects, int startIndex, int requestCount) { if (consumer == null) { throw new ArgumentNullException ("consumer"); } else if (objects == null) { throw new ArgumentNullException ("objects"); } var endIndex = requestCount > 0 ? System.Math.Min (startIndex + requestCount, objects.Count) : objects.Count; for (var i = startIndex; i < endIndex; i++) { consumer (objects[i]); } return endIndex - startIndex; } protected IList GetChildren (string containerId) { ContainerInfo container; if (!containers.TryGetValue (containerId, out container)) { throw new UpnpControlException ( Error.NoSuchContainer (), string.Format (@"The container ""{0}"" does not exist.", containerId)); } return container.Children; } void OnGetContext (IAsyncResult result) { lock (listener) { if (!listener.IsListening) { return; } var context = listener.EndGetContext (result); Log.Information (string.Format ("Got request from {0} for {1}.", context.Request.RemoteEndPoint, context.Request.Url)); var url = this.url.MakeRelativeUri (context.Request.Url); GetFile (context.Response, url.ToString ()); /*if (query.StartsWith ("?id=") && query.Length > 4) { GetFile (context.Response, query.Substring (4)); } else if (query.StartsWith ("?art=")) { //GetArtwork (context.Response, query); } else { context.Response.StatusCode = 404; }*/ listener.BeginGetContext (OnGetContext, null); } } void GetFile (HttpListenerResponse response, string id) { using (response) { ObjectInfo object_info; if (!objects.TryGetValue (id, out object_info) || object_info.Path == null) { Log.Error (string.Format ("The requested object {0} does not exist.", id)); response.StatusCode = 404; return; } Log.Information (string.Format ("Serving file {0}.", object_info.Path)); using (var reader = System.IO.File.OpenRead (object_info.Path)) { response.ContentType = object_info.Object.Resources[0].ProtocolInfo.ContentFormat; response.ContentLength64 = reader.Length; try { using (var writer = new BinaryWriter (response.OutputStream)) { var buffer = new byte[file_buffer_size]; int read; do { read = reader.Read (buffer, 0, buffer.Length); writer.Write (buffer, 0, read); } while (IsStarted && read > 0); } } catch (Exception e) { Log.Exception (string.Format ("Failed while serving file {0}.", object_info.Path), e); } } } } /*void GetArtwork (HttpListenerResponse response, string query) { using (response) { if (query.Length < 5) { response.StatusCode = 404; return; } int id; if (!int.TryParse (query.Substring (4), out id)) { response.StatusCode = 404; return; } Console.WriteLine ("Serving artwork for: {0}", object_cache[id].Path); if (id >= object_cache.Count) { response.StatusCode = 404; return; } var picture = GetAlbumArt (object_cache[id].Path); if (picture == null) { response.StatusCode = 404; return; } try { using (var reader = new BinaryReader (new MemoryStream (picture.Data.Data))) { response.ContentType = picture.MimeType; response.ContentLength64 = picture.Data.Data.Length; using (var stream = response.OutputStream) { using (var writer = new BinaryWriter (stream)) { var buffer = new byte[8192]; int read; do { read = reader.Read (buffer, 0, buffer.Length); writer.Write (buffer, 0, read); } while (started && read > 0); } } } } catch { } } }*/ protected override string SearchCapabilities { get { return string.Empty; } } protected override string SortCapabilities { get { return string.Empty; } } } } Mono.Upnp.Dcp.MediaServer1.FileSystem.Wmp11/0000775000175000017500000000000011707010776043342 5ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystemWmp11Ids.cs0000664000175000017500000000720411707010776045241 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem/Mono.Upnp.Dcp.MediaServer1.FileSystem.Wmp11// // Wmp11Ids.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. namespace Mono.Upnp.Dcp.MediaServer1.FileSystem.Wmp11 { // See NetCompat_WMP11.docx public static class Wmp11Ids { public const string Root = "0"; public const string Music = "1"; public const string AllMusic = "4"; public const string MusicGenre = "5"; public const string MusicArtist = "6"; public const string MusicAlbum = "7"; public const string MusicPlaylists = "F"; public const string MusicFolders = "14"; public const string MusicContributingArtists = "100"; public const string MusicAlbumArtist = "107"; public const string MusicComposer = "108"; public const string MusicRating = "101"; public const string MusicRating1Star = "102"; public const string MusicRating2Star = "103"; public const string MusicRating3Star = "104"; public const string MusicRating4Star = "105"; public const string MusicRating5Star = "106"; public const string Video = "2"; public const string AllVideo = "8"; public const string VideoGenre = "9"; public const string VideoActor = "A"; public const string VideoSeries = "E"; public const string VidePlaylist = "10"; public const string VideoFolders = "15"; public const string VideoRating = "200"; public const string VideoRating1Star = "201"; public const string VideoRating2Star = "202"; public const string VideoRating3Star = "203"; public const string VideoRating4Star = "204"; public const string VideoRating5Star = "205"; public const string Pictures = "3"; public const string AllPictures = "B"; public const string PicturesDateTaken = "C"; public const string PicturesAlbums = "D"; public const string PicturesKeywords = "D2"; public const string PicturesPlaylist = "11"; public const string PicturesFolders = "16"; public const string PicturesRating = "300"; public const string PicturesRating1Star = "301"; public const string PicturesRating2Star = "302"; public const string PicturesRating3Star = "303"; public const string PicturesRating4Star = "304"; public const string PicturesRating5Star = "305"; public const string PicturesUnrated = "306"; public const string Playlists = "12"; public const string AllPlaylists = "13"; public const string PlaylistsFolders = "17"; } } Wmp11MusicBuilder.cs0000664000175000017500000002134211707010776047110 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem/Mono.Upnp.Dcp.MediaServer1.FileSystem.Wmp11// // Wmp11MusicBuilder.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using TagLib; using Mono.Upnp.Dcp.MediaServer1.ConnectionManager1; using Mono.Upnp.Dcp.MediaServer1.ContentDirectory1; using Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV; using Object = Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.Object; namespace Mono.Upnp.Dcp.MediaServer1.FileSystem.Wmp11 { public class Wmp11MusicBuilder : Wmp11ContainerBuilder { int ids; List audio_items = new List (); ContainerBuilder genre_builder; ContainerBuilder artist_builder; ContainerBuilder album_builder; ContainerBuilder playlists_builder; ContainerBuilder folders_builder; ContainerBuilder contributing_artists_builder; ContainerBuilder album_artist_builder; ContainerBuilder composer_builder; ContainerBuilder one_star_builder; ContainerBuilder two_star_builder; ContainerBuilder three_star_builder; ContainerBuilder four_star_builder; ContainerBuilder five_star_builder; public Wmp11MusicBuilder () : base (Wmp11Ids.Music, "Music") { genre_builder = new ContainerBuilder ( Wmp11Ids.MusicGenre, "Genre", GetId, (id, options) => new MusicGenre (GetId (), id, options)); artist_builder = new ContainerBuilder ( Wmp11Ids.MusicArtist, "Artist", GetId, ArtistProvider); album_builder = new ContainerBuilder ( Wmp11Ids.MusicAlbum, "Album", GetId, (id, options) => new MusicAlbum (GetId (), id, options)); playlists_builder = new ContainerBuilder ( Wmp11Ids.MusicPlaylists, "Playlists", GetId, (id, options) => new PlaylistContainer (GetId (), id, options)); folders_builder = new ContainerBuilder ( Wmp11Ids.MusicFolders, "Folders", GetId, (id, options) => new StorageFolder (GetId (), id, options)); contributing_artists_builder = new ContainerBuilder ( Wmp11Ids.MusicContributingArtists, "Contributing Artists", GetId, ArtistProvider); album_artist_builder = new ContainerBuilder ( Wmp11Ids.MusicAlbumArtist, "Album Artist", GetId, ArtistProvider); composer_builder = new ContainerBuilder ( Wmp11Ids.MusicComposer, "Composer", GetId, ArtistProvider); one_star_builder = new ContainerBuilder ( Wmp11Ids.MusicRating1Star, "1+ stars", GetId, RatingProvider); two_star_builder = new ContainerBuilder ( Wmp11Ids.MusicRating2Star, "2+ stars", GetId, RatingProvider); three_star_builder = new ContainerBuilder ( Wmp11Ids.MusicRating3Star, "3+ stars", GetId, RatingProvider); four_star_builder = new ContainerBuilder ( Wmp11Ids.MusicRating4Star, "4+ stars", GetId, RatingProvider); five_star_builder = new ContainerBuilder ( Wmp11Ids.MusicRating5Star, "5+ stars", GetId, RatingProvider); } public void OnTag (string id, IEnumerable resources, Tag tag, Action consumer) { var genres = tag.Genres; var artists = tag.Performers; var album_artists = tag.AlbumArtists; var composers = tag.Composers; var music_track = new MusicTrack (id, Wmp11Ids.AllMusic, new MusicTrackOptions { Title = tag.Title, OriginalTrackNumber = (int)tag.Track, Genres = genres, Artists = GetArtists (artists), Resources = resources }); audio_items.Add (music_track); consumer (music_track); foreach (var genre in genres) { genre_builder.OnItem (genre, music_track, consumer, options => options != null ? options : new GenreOptions { Title = genre }); } foreach (var artist in artists) { artist_builder.OnItem (artist, music_track, consumer, options => ArtistWithGenres (artist, genres, options)); } album_builder.OnItem (tag.Album, music_track, consumer, options => options != null ? options : new MusicAlbumOptions { Title = tag.Album, Contributors = album_artists }); foreach (var album_artist in album_artists) { album_artist_builder.OnItem (album_artist, music_track, consumer, options => ArtistWithGenres (album_artist, genres, options)); } foreach (var composer in composers) { composer_builder.OnItem (composer, music_track, consumer, options => ArtistWithGenres (composer, genres, options)); } } static BuildableMusicArtistOptions ArtistWithGenres (string artist, IEnumerable genres, BuildableMusicArtistOptions options) { if (options == null) { options = new BuildableMusicArtistOptions { Title = artist }; } foreach (var genre in genres) { options.OnGenre (genre); } return options; } public Container Build (Action consumer) { return Build (consumer, new Object[] { Build (consumer, "All Music", Wmp11Ids.AllMusic, audio_items), Build (consumer, genre_builder), Build (consumer, artist_builder), Build (consumer, album_builder), Build (consumer, playlists_builder), Build (consumer, folders_builder), Build (consumer, contributing_artists_builder), Build (consumer, album_artist_builder), Build (consumer, composer_builder), Build (consumer, "Rating", Wmp11Ids.MusicRating, new Object[] { Build (consumer, one_star_builder), Build (consumer, two_star_builder), Build (consumer, three_star_builder), Build (consumer, four_star_builder), Build (consumer, five_star_builder), }) }); } MusicArtist ArtistProvider (string parentId, MusicArtistOptions options) { return new MusicArtist (GetId (), parentId, options); } Container RatingProvider (string parentId, ContainerOptions options) { return new Container (GetId (), parentId, options); } string GetId () { return string.Concat ("music", (ids++).ToString ()); } static IEnumerable GetArtists (IEnumerable artists) { foreach (var artist in artists) { yield return new PersonWithRole (artist, "performer"); } } } } Wmp11ContentDirectory.cs0000664000175000017500000001115511707010776050021 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem/Mono.Upnp.Dcp.MediaServer1.FileSystem.Wmp11// // Wmp11ContentDirectory.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using Mono.Upnp.Dcp.MediaServer1.ContentDirectory1; using Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV; using Object = Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.Object; namespace Mono.Upnp.Dcp.MediaServer1.FileSystem.Wmp11 { public class Wmp11ContentDirectory : FileSystemContentDirectory { public Wmp11ContentDirectory (Uri url, IDictionary objects, IDictionary containers) : base (url, objects, containers) { } protected override void Search (Action consumer, string containerId, Action query, int startingIndex, int requestCount, string sortCriteria, out int numberReturned, out int totalMatches) { if (query == null) { throw new ArgumentNullException ("query"); } var visitor = new Wmp11QueryVisitor (this, containerId); query (visitor); if (visitor.Results != null) { totalMatches = visitor.Results.Count; numberReturned = VisitResults (consumer, visitor.Results, startingIndex, requestCount); } else { base.Search (consumer, containerId, query, startingIndex, requestCount, sortCriteria, out numberReturned, out totalMatches); } } protected override string SearchCapabilities { get { return string.Empty; } } protected override string SortCapabilities { get { return string.Empty; } } class Wmp11QueryVisitor : QueryVisitor { readonly Wmp11ContentDirectory content_directory; readonly string container_id; public Wmp11QueryVisitor (Wmp11ContentDirectory contentDirectory, string container_id) { this.content_directory = contentDirectory; this.container_id = container_id; } public override void VisitEquals (string property, string value) { VisitClassCheck (property, value); } public override void VisitDerivedFrom (string property, string value) { VisitClassCheck (property, value); } void VisitClassCheck (string property, string value) { if (property != "upnp:class") { return; } switch (value) { case "object.item.audioItem": if (container_id == Wmp11Ids.AllMusic) { Results = content_directory.GetChildren (Wmp11Ids.AllMusic); } break; case "object.container.album.musicAlbum": if (container_id == Wmp11Ids.MusicAlbum) { Results = content_directory.GetChildren (Wmp11Ids.MusicAlbum); } break; } } public IList Results { get; private set; } } } } Wmp11ContainerBuilder.cs0000664000175000017500000000455111707010776047755 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem/Mono.Upnp.Dcp.MediaServer1.FileSystem.Wmp11// // Wmp11ContainerBuilder.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using Mono.Upnp.Dcp.MediaServer1.ContentDirectory1; using Object = Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.Object; namespace Mono.Upnp.Dcp.MediaServer1.FileSystem.Wmp11 { public class Wmp11ContainerBuilder : ContainerBuilder { public Wmp11ContainerBuilder (string id, string title) : base (id, title) { } protected Container Build (Action consumer, ContainerBuilder containerBuilder) where T : ContainerOptions { if (containerBuilder == null) { throw new ArgumentNullException ("containerBuilder"); } return containerBuilder.Build (consumer, Id); } protected Container Build (Action consumer, IList children) { return Build (consumer, Title, Id, Wmp11Ids.Root, children); } protected Container Build (Action consumer, string title, string id, IList children) { return Build (consumer, title, id, this.Id, children); } } } Wmp11ContentDirectoryBuilder.cs0000664000175000017500000000741011707010776051327 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem/Mono.Upnp.Dcp.MediaServer1.FileSystem.Wmp11// // Wmp11ContentDirectoryBuilder.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using System.IO; using Mono.Upnp.Dcp.MediaServer1.ConnectionManager1; using Mono.Upnp.Dcp.MediaServer1.ContentDirectory1; using Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV; using Object = Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.Object; namespace Mono.Upnp.Dcp.MediaServer1.FileSystem.Wmp11 { public class Wmp11ContentDirectoryBuilder { readonly Uri url; Dictionary objects = new Dictionary (); Dictionary containers = new Dictionary (); Wmp11MusicBuilder music_builder; int id; public Wmp11ContentDirectoryBuilder (Uri url) { if (url == null) { throw new ArgumentNullException ("url"); } this.url = url; this.music_builder = new Wmp11MusicBuilder (); } public void OnFile (string path) { switch (Path.GetExtension (path)) { case ".wma": case ".wav": case ".mp3": var id = GetId (); var resources = new[] { new Resource (new Uri (url, id), new ResourceOptions { ProtocolInfo = new ProtocolInfo ("http-get", "audio/mpeg") }) }; music_builder.OnTag (id, resources, TagLib.File.Create (path).Tag, @object => objects.Add (@object.Id, new ObjectInfo (@object, path))); break; } } string GetId () { return string.Concat ("object", (id++).ToString ()); } void ContainerInfoConsumer (ContainerInfo containerInfo) { objects.Add (containerInfo.Container.Id, new ObjectInfo (containerInfo.Container)); containers.Add (containerInfo.Container.Id, containerInfo); } public Wmp11ContentDirectory Build () { var containers = new List (4); containers.Add (music_builder.Build (ContainerInfoConsumer)); ContainerInfoConsumer (new ContainerInfo (new Container (Wmp11Ids.Root, "-1", new ContainerOptions { Title = "Root", ChildCount = 4 }), containers)); var content_directory = new Wmp11ContentDirectory (url, this.objects, this.containers); this.objects = new Dictionary (); this.containers = new Dictionary (); return content_directory; } } } Makefile.am0000664000175000017500000001113211715013277035557 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem EXTRA_DIST = # Warning: This is an automatically generated file, do not edit! if ENABLE_DEBUG ASSEMBLY_COMPILER_COMMAND = gmcs ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug "-define:DEBUG" "-keyfile:$(srcdir)/mono-upnp-dcp-mediaserver1-filesystem.snk" ASSEMBLY = ../../../../bin/Mono.Upnp.Dcp.MediaServer1.FileSystem.dll ASSEMBLY_MDB = $(ASSEMBLY).mdb COMPILE_TARGET = library PROJECT_REFERENCES = \ ../../../../bin/Mono.Upnp.Dcp.MediaServer1.dll \ ../../../../bin/Mono.Upnp.dll BUILD_DIR = ../../../../bin MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_DLL_MDB_SOURCE=../../../../bin/Mono.Upnp.Dcp.MediaServer1.FileSystem.dll.mdb MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_DLL_MDB=$(BUILD_DIR)/Mono.Upnp.Dcp.MediaServer1.FileSystem.dll.mdb MONO_UPNP_DCP_MEDIASERVER1_DLL_SOURCE=../../../../bin/Mono.Upnp.Dcp.MediaServer1.dll MONO_UPNP_DLL_SOURCE=../../../../bin/Mono.Upnp.dll MONO_SSDP_DLL_SOURCE=../../../../bin/Mono.Ssdp.dll MONO_SSDP_DLL_MDB_SOURCE=../../../../bin/Mono.Ssdp.dll.mdb MONO_SSDP_DLL_MDB=$(BUILD_DIR)/Mono.Ssdp.dll.mdb MONO_UPNP_DLL_MDB_SOURCE=../../../../bin/Mono.Upnp.dll.mdb MONO_UPNP_DLL_MDB=$(BUILD_DIR)/Mono.Upnp.dll.mdb MONO_UPNP_DCP_MEDIASERVER1_DLL_MDB_SOURCE=../../../../bin/Mono.Upnp.Dcp.MediaServer1.dll.mdb MONO_UPNP_DCP_MEDIASERVER1_DLL_MDB=$(BUILD_DIR)/Mono.Upnp.Dcp.MediaServer1.dll.mdb endif if ENABLE_RELEASE ASSEMBLY_COMPILER_COMMAND = gmcs ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ "-keyfile:$(srcdir)/mono-upnp-dcp-mediaserver1-filesystem.snk" ASSEMBLY = ../../../../bin/Mono.Upnp.Dcp.MediaServer1.FileSystem.dll ASSEMBLY_MDB = COMPILE_TARGET = library PROJECT_REFERENCES = \ ../../../../bin/Mono.Upnp.Dcp.MediaServer1.dll \ ../../../../bin/Mono.Upnp.dll BUILD_DIR = ../../../../bin MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_DLL_MDB= MONO_UPNP_DCP_MEDIASERVER1_DLL_SOURCE=../../../../bin/Mono.Upnp.Dcp.MediaServer1.dll MONO_UPNP_DLL_SOURCE=../../../../bin/Mono.Upnp.dll MONO_SSDP_DLL_SOURCE=../../../../bin/Mono.Ssdp.dll MONO_SSDP_DLL_MDB= MONO_UPNP_DLL_MDB= MONO_UPNP_DCP_MEDIASERVER1_DLL_MDB= endif AL=al2 SATELLITE_ASSEMBLY_NAME=$(notdir $(basename $(ASSEMBLY))).resources.dll PROGRAMFILES = \ $(MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_DLL_MDB) \ $(MONO_UPNP_DCP_MEDIASERVER1_DLL) \ $(MONO_UPNP_DLL) \ $(MONO_SSDP_DLL) \ $(MONO_SSDP_DLL_MDB) \ $(MONO_UPNP_DLL_MDB) \ $(MONO_UPNP_DCP_MEDIASERVER1_DLL_MDB) LINUX_PKGCONFIG = \ $(MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_PC) RESGEN=resgen2 all: $(ASSEMBLY) $(PROGRAMFILES) $(LINUX_PKGCONFIG) FILES = \ AssemblyInfo.cs \ Mono.Upnp.Dcp.MediaServer1.FileSystem.Wmp11/Wmp11ContainerBuilder.cs \ Mono.Upnp.Dcp.MediaServer1.FileSystem.Wmp11/Wmp11ContentDirectory.cs \ Mono.Upnp.Dcp.MediaServer1.FileSystem.Wmp11/Wmp11ContentDirectoryBuilder.cs \ Mono.Upnp.Dcp.MediaServer1.FileSystem.Wmp11/Wmp11Ids.cs \ Mono.Upnp.Dcp.MediaServer1.FileSystem.Wmp11/Wmp11MusicBuilder.cs \ Mono.Upnp.Dcp.MediaServer1.FileSystem/BuildableMusicArtistOptions.cs \ Mono.Upnp.Dcp.MediaServer1.FileSystem/ContainerBuilder.cs \ Mono.Upnp.Dcp.MediaServer1.FileSystem/ContainerInfo.cs \ Mono.Upnp.Dcp.MediaServer1.FileSystem/ContainerOptionsInfo.cs \ Mono.Upnp.Dcp.MediaServer1.FileSystem/File.cs \ Mono.Upnp.Dcp.MediaServer1.FileSystem/FileSystemContentDirectory.cs \ Mono.Upnp.Dcp.MediaServer1.FileSystem/ObjectInfo.cs DATA_FILES = RESOURCES = EXTRAS = \ Mono.Upnp.Dcp.MediaServer1.FileSystem \ Mono.Upnp.Dcp.MediaServer1.FileSystem.Wmp11 \ mono-upnp-dcp-mediaserver1-filesystem.snk \ mono.upnp.dcp.mediaserver1.filesystem.pc.in REFERENCES = \ ../../../../bin/Mono.Upnp.Dcp.MediaServer1.dll \ ../../../../bin/Mono.Upnp.dll \ -pkg:taglib-sharp \ System DLL_REFERENCES = CLEANFILES = $(PROGRAMFILES) $(LINUX_PKGCONFIG) include $(top_srcdir)/Makefile.include MONO_UPNP_DCP_MEDIASERVER1_DLL = $(BUILD_DIR)/Mono.Upnp.Dcp.MediaServer1.dll MONO_UPNP_DLL = $(BUILD_DIR)/Mono.Upnp.dll MONO_SSDP_DLL = $(BUILD_DIR)/Mono.Ssdp.dll MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_PC = $(BUILD_DIR)/mono.upnp.dcp.mediaserver1.filesystem.pc $(eval $(call emit-deploy-wrapper,MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_PC,mono.upnp.dcp.mediaserver1.filesystem.pc)) $(eval $(call emit_resgen_targets)) $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(ASSEMBLY_MDB): $(ASSEMBLY) $(ASSEMBLY): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(shell dirname $(ASSEMBLY)) $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) Makefile.in0000664000175000017500000006644511761736755035627 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/mono.upnp.dcp.mediaserver1.filesystem.pc.in \ $(top_srcdir)/Makefile.include subdir = src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/expansions.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = mono.upnp.dcp.mediaserver1.filesystem.pc CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(bindir)" \ "$(DESTDIR)$(assemblyfilesdir)" \ "$(DESTDIR)$(linuxpkgconfigdir)" \ "$(DESTDIR)$(programfilesdir)" SCRIPTS = $(bin_SCRIPTS) SOURCES = DIST_SOURCES = DATA = $(assemblyfiles_DATA) $(linuxpkgconfig_DATA) \ $(programfiles_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ GLADE_SHARP_20_CFLAGS = @GLADE_SHARP_20_CFLAGS@ GLADE_SHARP_20_LIBS = @GLADE_SHARP_20_LIBS@ GLIB_SHARP_20_CFLAGS = @GLIB_SHARP_20_CFLAGS@ GLIB_SHARP_20_LIBS = @GLIB_SHARP_20_LIBS@ GMCS = @GMCS@ GTK_SHARP_20_CFLAGS = @GTK_SHARP_20_CFLAGS@ GTK_SHARP_20_LIBS = @GTK_SHARP_20_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MONO_ADDINS_CFLAGS = @MONO_ADDINS_CFLAGS@ MONO_ADDINS_LIBS = @MONO_ADDINS_LIBS@ NUNIT_CFLAGS = @NUNIT_CFLAGS@ NUNIT_CMD = @NUNIT_CMD@ NUNIT_LIBS = @NUNIT_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TAGLIB_SHARP_CFLAGS = @TAGLIB_SHARP_CFLAGS@ TAGLIB_SHARP_LIBS = @TAGLIB_SHARP_LIBS@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_bindir = @expanded_bindir@ expanded_datadir = @expanded_datadir@ expanded_libdir = @expanded_libdir@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = $(build_sources) $(build_resx_files) \ $(build_others_files) $(ASSEMBLY_WRAPPER_IN) $(EXTRAS) \ $(DATA_FILES) $(build_culture_res_files) # Warning: This is an automatically generated file, do not edit! @ENABLE_DEBUG_TRUE@ASSEMBLY_COMPILER_COMMAND = gmcs @ENABLE_RELEASE_TRUE@ASSEMBLY_COMPILER_COMMAND = gmcs @ENABLE_DEBUG_TRUE@ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug "-define:DEBUG" "-keyfile:$(srcdir)/mono-upnp-dcp-mediaserver1-filesystem.snk" @ENABLE_RELEASE_TRUE@ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ "-keyfile:$(srcdir)/mono-upnp-dcp-mediaserver1-filesystem.snk" @ENABLE_DEBUG_TRUE@ASSEMBLY = ../../../../bin/Mono.Upnp.Dcp.MediaServer1.FileSystem.dll @ENABLE_RELEASE_TRUE@ASSEMBLY = ../../../../bin/Mono.Upnp.Dcp.MediaServer1.FileSystem.dll @ENABLE_DEBUG_TRUE@ASSEMBLY_MDB = $(ASSEMBLY).mdb @ENABLE_RELEASE_TRUE@ASSEMBLY_MDB = @ENABLE_DEBUG_TRUE@COMPILE_TARGET = library @ENABLE_RELEASE_TRUE@COMPILE_TARGET = library @ENABLE_DEBUG_TRUE@PROJECT_REFERENCES = \ @ENABLE_DEBUG_TRUE@ ../../../../bin/Mono.Upnp.Dcp.MediaServer1.dll \ @ENABLE_DEBUG_TRUE@ ../../../../bin/Mono.Upnp.dll @ENABLE_RELEASE_TRUE@PROJECT_REFERENCES = \ @ENABLE_RELEASE_TRUE@ ../../../../bin/Mono.Upnp.Dcp.MediaServer1.dll \ @ENABLE_RELEASE_TRUE@ ../../../../bin/Mono.Upnp.dll @ENABLE_DEBUG_TRUE@BUILD_DIR = ../../../../bin @ENABLE_RELEASE_TRUE@BUILD_DIR = ../../../../bin @ENABLE_DEBUG_TRUE@MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_DLL_MDB_SOURCE = ../../../../bin/Mono.Upnp.Dcp.MediaServer1.FileSystem.dll.mdb @ENABLE_DEBUG_TRUE@MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_DLL_MDB = $(BUILD_DIR)/Mono.Upnp.Dcp.MediaServer1.FileSystem.dll.mdb @ENABLE_RELEASE_TRUE@MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_DLL_MDB = @ENABLE_DEBUG_TRUE@MONO_UPNP_DCP_MEDIASERVER1_DLL_SOURCE = ../../../../bin/Mono.Upnp.Dcp.MediaServer1.dll @ENABLE_RELEASE_TRUE@MONO_UPNP_DCP_MEDIASERVER1_DLL_SOURCE = ../../../../bin/Mono.Upnp.Dcp.MediaServer1.dll @ENABLE_DEBUG_TRUE@MONO_UPNP_DLL_SOURCE = ../../../../bin/Mono.Upnp.dll @ENABLE_RELEASE_TRUE@MONO_UPNP_DLL_SOURCE = ../../../../bin/Mono.Upnp.dll @ENABLE_DEBUG_TRUE@MONO_SSDP_DLL_SOURCE = ../../../../bin/Mono.Ssdp.dll @ENABLE_RELEASE_TRUE@MONO_SSDP_DLL_SOURCE = ../../../../bin/Mono.Ssdp.dll @ENABLE_DEBUG_TRUE@MONO_SSDP_DLL_MDB_SOURCE = ../../../../bin/Mono.Ssdp.dll.mdb @ENABLE_DEBUG_TRUE@MONO_SSDP_DLL_MDB = $(BUILD_DIR)/Mono.Ssdp.dll.mdb @ENABLE_RELEASE_TRUE@MONO_SSDP_DLL_MDB = @ENABLE_DEBUG_TRUE@MONO_UPNP_DLL_MDB_SOURCE = ../../../../bin/Mono.Upnp.dll.mdb @ENABLE_DEBUG_TRUE@MONO_UPNP_DLL_MDB = $(BUILD_DIR)/Mono.Upnp.dll.mdb @ENABLE_RELEASE_TRUE@MONO_UPNP_DLL_MDB = @ENABLE_DEBUG_TRUE@MONO_UPNP_DCP_MEDIASERVER1_DLL_MDB_SOURCE = ../../../../bin/Mono.Upnp.Dcp.MediaServer1.dll.mdb @ENABLE_DEBUG_TRUE@MONO_UPNP_DCP_MEDIASERVER1_DLL_MDB = $(BUILD_DIR)/Mono.Upnp.Dcp.MediaServer1.dll.mdb @ENABLE_RELEASE_TRUE@MONO_UPNP_DCP_MEDIASERVER1_DLL_MDB = AL = al2 SATELLITE_ASSEMBLY_NAME = $(notdir $(basename $(ASSEMBLY))).resources.dll PROGRAMFILES = \ $(MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_DLL_MDB) \ $(MONO_UPNP_DCP_MEDIASERVER1_DLL) \ $(MONO_UPNP_DLL) \ $(MONO_SSDP_DLL) \ $(MONO_SSDP_DLL_MDB) \ $(MONO_UPNP_DLL_MDB) \ $(MONO_UPNP_DCP_MEDIASERVER1_DLL_MDB) LINUX_PKGCONFIG = \ $(MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_PC) RESGEN = resgen2 FILES = \ AssemblyInfo.cs \ Mono.Upnp.Dcp.MediaServer1.FileSystem.Wmp11/Wmp11ContainerBuilder.cs \ Mono.Upnp.Dcp.MediaServer1.FileSystem.Wmp11/Wmp11ContentDirectory.cs \ Mono.Upnp.Dcp.MediaServer1.FileSystem.Wmp11/Wmp11ContentDirectoryBuilder.cs \ Mono.Upnp.Dcp.MediaServer1.FileSystem.Wmp11/Wmp11Ids.cs \ Mono.Upnp.Dcp.MediaServer1.FileSystem.Wmp11/Wmp11MusicBuilder.cs \ Mono.Upnp.Dcp.MediaServer1.FileSystem/BuildableMusicArtistOptions.cs \ Mono.Upnp.Dcp.MediaServer1.FileSystem/ContainerBuilder.cs \ Mono.Upnp.Dcp.MediaServer1.FileSystem/ContainerInfo.cs \ Mono.Upnp.Dcp.MediaServer1.FileSystem/ContainerOptionsInfo.cs \ Mono.Upnp.Dcp.MediaServer1.FileSystem/File.cs \ Mono.Upnp.Dcp.MediaServer1.FileSystem/FileSystemContentDirectory.cs \ Mono.Upnp.Dcp.MediaServer1.FileSystem/ObjectInfo.cs DATA_FILES = RESOURCES = EXTRAS = \ Mono.Upnp.Dcp.MediaServer1.FileSystem \ Mono.Upnp.Dcp.MediaServer1.FileSystem.Wmp11 \ mono-upnp-dcp-mediaserver1-filesystem.snk \ mono.upnp.dcp.mediaserver1.filesystem.pc.in REFERENCES = \ ../../../../bin/Mono.Upnp.Dcp.MediaServer1.dll \ ../../../../bin/Mono.Upnp.dll \ -pkg:taglib-sharp \ System DLL_REFERENCES = CLEANFILES = $(PROGRAMFILES) $(LINUX_PKGCONFIG) $(ASSEMBLY) \ $(ASSEMBLY).mdb $(BINARIES) $(build_resx_resources) \ $(build_satellite_assembly_list) VALID_CULTURES = ar bg ca zh-CHS cs da de el en es fi fr he hu is it ja ko nl no pl pt ro ru hr sk sq sv th tr id uk be sl et lv lt fa vi hy eu mk af ka fo hi sw gu ta te kn mr gl kok ar-SA bg-BG ca-ES zh-TW cs-CZ da-DK de-DE el-GR en-US fi-FI fr-FR he-IL hu-HU is-IS it-IT ja-JP ko-KR nl-NL nb-NO pl-PL pt-BR ro-RO ru-RU hr-HR sk-SK sq-AL sv-SE th-TH tr-TR id-ID uk-UA be-BY sl-SI et-EE lv-LV lt-LT fa-IR vi-VN hy-AM eu-ES mk-MK af-ZA ka-GE fo-FO hi-IN sw-KE gu-IN ta-IN te-IN kn-IN mr-IN gl-ES kok-IN ar-IQ zh-CN de-CH en-GB es-MX fr-BE it-CH nl-BE nn-NO pt-PT sv-FI ar-EG zh-HK de-AT en-AU es-ES fr-CA ar-LY zh-SG de-LU en-CA es-GT fr-CH ar-DZ zh-MO en-NZ es-CR fr-LU ar-MA en-IE es-PA ar-TN en-ZA es-DO ar-OM es-VE ar-YE es-CO ar-SY es-PE ar-JO en-TT es-AR ar-LB en-ZW es-EC ar-KW en-PH es-CL ar-AE es-UY ar-BH es-PY ar-QA es-BO es-SV es-HN es-NI es-PR zh-CHT s2q = $(subst \ ,?,$1) q2s = $(subst ?,\ ,$1) # use this when result will be quoted unesc2 = $(subst ?, ,$1) build_sources = $(FILES) $(GENERATED_FILES) build_sources_esc = $(call s2q,$(build_sources)) # use unesc2, as build_sources_embed is quoted build_sources_embed = $(call unesc2,$(build_sources_esc:%='$(srcdir)/%')) comma__ = , get_resource_name = $(firstword $(subst $(comma__), ,$1)) get_culture = $(lastword $(subst ., ,$(basename $1))) is_cultured_resource = $(and $(word 3,$(subst ., ,$1)), $(filter $(VALID_CULTURES),$(lastword $(subst ., ,$(basename $1))))) RESOURCES_ESC = $(call s2q,$(RESOURCES)) build_resx_list = $(foreach res, $(RESOURCES_ESC), $(if $(filter %.resx, $(call get_resource_name,$(res))),$(res),)) build_non_culture_resx_list = $(foreach res, $(build_resx_list),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_non_culture_others_list = $(foreach res, $(filter-out $(build_resx_list),$(RESOURCES_ESC)),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_others_list = $(build_non_culture_others_list) build_xamlg_list = $(filter %.xaml.g.cs, $(FILES)) # resgen all .resx resources build_resx_files = $(foreach res, $(build_resx_list), $(call get_resource_name,$(res))) build_resx_resources_esc = $(build_resx_files:.resx=.resources) build_resx_resources = $(call q2s,$(build_resx_resources_esc)) # embed resources for the main assembly build_resx_resources_hack = $(subst .resx,.resources, $(build_non_culture_resx_list)) # use unesc2, as build_resx_resources_embed is quoted build_resx_resources_embed = $(call unesc2,$(build_resx_resources_hack:%='-resource:%')) build_others_files = $(call q2s,$(foreach res, $(build_others_list),$(call get_resource_name,$(res)))) build_others_resources = $(build_others_files) # use unesc2, as build_others_resources_embed is quoted build_others_resources_embed = $(call unesc2,$(build_others_list:%='-resource:$(srcdir)/%')) build_resources = $(build_resx_resources) $(build_others_resources) build_resources_embed = $(build_resx_resources_embed) $(build_others_resources_embed) # -usesourcepath is available only for resgen2 emit_resgen_target_1 = $(call q2s,$1) : $(call q2s,$(subst .resources,.resx,$1)); cd '$$(shell dirname '$$<')' && MONO_IOMAP=drive $$(RESGEN) '$$(shell basename '$$<')' '$$(shell basename '$$@')' emit_resgen_target_2 = $(call q2s,$1) : $(call q2s,$(subst .resources,.resx,$1)); MONO_IOMAP=drive $$(RESGEN) -usesourcepath '$$<' '$$@' emit_resgen_target = $(if $(filter resgen2,$(RESGEN)),$(emit_resgen_target_2),$(emit_resgen_target_1)) emit_resgen_targets = $(foreach res,$(build_resx_resources_esc),$(eval $(call emit_resgen_target,$(res)))) build_references_ref = $(call q2s,$(foreach ref, $(call \ s2q,$(REFERENCES)), $(if $(filter -pkg:%, $(ref)), $(ref), \ $(if $(filter -r:%, $(ref)), $(ref), -r:$(ref))))) $(call \ q2s,$(foreach ref, $(call s2q,$(DLL_REFERENCES)), -r:$(ref))) \ $(call q2s,$(foreach ref, $(call s2q,$(PROJECT_REFERENCES)), \ -r:$(ref))) s2q2s = $(call unesc2,$(call s2q,$1)) cp_actual = test -z $1 || cp $1 $2 cp = $(call cp_actual,'$(call s2q2s,$1)','$(call s2q2s,$2)') rm_actual = test -z '$1' || rm -f '$2' rm = $(call rm_actual,$(call s2q2s,$1),$(call s2q2s,$2)/$(shell basename '$(call s2q2s,$1)')) DISTCLEANFILES = $(GENERATED_FILES) $(pc_files) $(BUILD_DIR)/* assemblyfilesdir = $(pkglibdir) assemblyfiles_DATA = $(ASSEMBLY) bin_SCRIPTS = $(BINARIES) programfilesdir = @libdir@/@PACKAGE@ programfiles_DATA = $(PROGRAMFILES) linuxpkgconfigdir = @libdir@/pkgconfig linuxpkgconfig_DATA = $(LINUX_PKGCONFIG) # generating satellite assemblies culture_resources = $(foreach res, $(RESOURCES_ESC), $(if $(call is_cultured_resource,$(call get_resource_name, $(res))),$(res))) cultures = $(sort $(foreach res, $(culture_resources), $(call get_culture,$(call get_resource_name,$(res))))) culture_resource_dependencies = $(call q2s,$(BUILD_DIR)/$1/$(SATELLITE_ASSEMBLY_NAME): $(subst .resx,.resources,$2)) culture_resource_commandlines = $(call unesc2,cmd_line_satellite_$1 += '/embed:$(subst .resx,.resources,$2)') build_satellite_assembly_list = $(call q2s,$(cultures:%=$(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME))) build_culture_res_files = $(call q2s,$(foreach res, $(culture_resources),$(call get_resource_name,$(res)))) install_satellite_assembly_list = $(subst $(BUILD_DIR),$(DESTDIR)$(libdir)/$(PACKAGE),$(build_satellite_assembly_list)) MONO_UPNP_DCP_MEDIASERVER1_DLL = $(BUILD_DIR)/Mono.Upnp.Dcp.MediaServer1.dll MONO_UPNP_DLL = $(BUILD_DIR)/Mono.Upnp.dll MONO_SSDP_DLL = $(BUILD_DIR)/Mono.Ssdp.dll MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_PC = $(BUILD_DIR)/mono.upnp.dcp.mediaserver1.filesystem.pc all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.include $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/Makefile.include: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mono.upnp.dcp.mediaserver1.filesystem.pc: $(top_builddir)/config.status $(srcdir)/mono.upnp.dcp.mediaserver1.filesystem.pc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) install-assemblyfilesDATA: $(assemblyfiles_DATA) @$(NORMAL_INSTALL) test -z "$(assemblyfilesdir)" || $(MKDIR_P) "$(DESTDIR)$(assemblyfilesdir)" @list='$(assemblyfiles_DATA)'; test -n "$(assemblyfilesdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(assemblyfilesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(assemblyfilesdir)" || exit $$?; \ done uninstall-assemblyfilesDATA: @$(NORMAL_UNINSTALL) @list='$(assemblyfiles_DATA)'; test -n "$(assemblyfilesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(assemblyfilesdir)'; $(am__uninstall_files_from_dir) install-linuxpkgconfigDATA: $(linuxpkgconfig_DATA) @$(NORMAL_INSTALL) test -z "$(linuxpkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(linuxpkgconfigdir)" @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(linuxpkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(linuxpkgconfigdir)" || exit $$?; \ done uninstall-linuxpkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(linuxpkgconfigdir)'; $(am__uninstall_files_from_dir) install-programfilesDATA: $(programfiles_DATA) @$(NORMAL_INSTALL) test -z "$(programfilesdir)" || $(MKDIR_P) "$(DESTDIR)$(programfilesdir)" @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(programfilesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(programfilesdir)" || exit $$?; \ done uninstall-programfilesDATA: @$(NORMAL_UNINSTALL) @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(programfilesdir)'; $(am__uninstall_files_from_dir) tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(assemblyfilesdir)" "$(DESTDIR)$(linuxpkgconfigdir)" "$(DESTDIR)$(programfilesdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-assemblyfilesDATA install-linuxpkgconfigDATA \ install-programfilesDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binSCRIPTS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-assemblyfilesDATA uninstall-binSCRIPTS \ uninstall-linuxpkgconfigDATA uninstall-programfilesDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-assemblyfilesDATA \ install-binSCRIPTS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-linuxpkgconfigDATA install-man install-pdf \ install-pdf-am install-programfilesDATA install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \ uninstall-am uninstall-assemblyfilesDATA uninstall-binSCRIPTS \ uninstall-linuxpkgconfigDATA uninstall-programfilesDATA all: $(ASSEMBLY) $(PROGRAMFILES) $(LINUX_PKGCONFIG) # macros # $(call emit-deploy-target,deploy-variable-name) define emit-deploy-target $($1): $($1_SOURCE) mkdir -p '$$(shell dirname '$$@')' cp '$$<' '$$@' endef # $(call emit-deploy-wrapper,wrapper-variable-name,wrapper-sourcefile,x) # assumes that for a wrapper foo.pc its source template is foo.pc.in # if $3 is non-empty then wrapper is marked exec define emit-deploy-wrapper $($1): $2 mkdir -p '$$(shell dirname '$$@')' cp '$$<' '$$@' $(if $3,chmod +x '$$@') endef $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_dependencies,$(call get_culture,$(call get_resource_name,$(res))),$(call get_resource_name,$(res)))))) $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_commandlines,$(call get_culture,$(call get_resource_name,$(res))),$(res))))) $(build_satellite_assembly_list): $(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME): mkdir -p '$(@D)' $(AL) -out:'$@' -culture:$* -t:lib $(cmd_line_satellite_$*) $(install_satellite_assembly_list): mkdir -p '$(@D)' cp $(subst $(DESTDIR)$(libdir)/$(PACKAGE), $(BUILD_DIR), $@) $@ install-satellite-assemblies: $(install_satellite_assembly_list) uninstall-satellite-assemblies: rm -rf $(install_satellite_assembly_list) $(eval $(call emit-deploy-wrapper,MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_PC,mono.upnp.dcp.mediaserver1.filesystem.pc)) $(eval $(call emit_resgen_targets)) $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(ASSEMBLY_MDB): $(ASSEMBLY) $(ASSEMBLY): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(shell dirname $(ASSEMBLY)) $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: mono.upnp.dcp.mediaserver1.filesystem.pc.in0000664000175000017500000000046511761736707043745 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystemassemblies_dir=@expanded_libdir@/@PACKAGE@ Libraries=${assemblies_dir}/Mono.Upnp.Dcp.MediaServer1.FileSystem.dll Name: Mono.Upnp.Dcp.MediaServer1.FileSystem Description: Mono.Upnp.Dcp.MediaServer1.FileSystem Version: @VERSION@ Requires: Libs: -r:${assemblies_dir}/Mono.Upnp.Dcp.MediaServer1.FileSystem.dll AssemblyInfo.cs0000664000175000017500000000430511714307244036450 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem// // AssemblyInfo.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System.Reflection; using System.Runtime.CompilerServices; // Information about this assembly is defined by the following attributes. // Change them to the values specific to your project. [assembly: AssemblyTitle ("Mono.Upnp.Dcp.MediaServer1.FileSystem")] [assembly: AssemblyDescription ("An implementation of the MediaServer1 API based on the filesystem.")] [assembly: AssemblyConfiguration ("")] [assembly: AssemblyCompany ("")] [assembly: AssemblyProduct ("")] [assembly: AssemblyCopyright ("")] [assembly: AssemblyTrademark ("")] [assembly: AssemblyCulture ("")] // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". // The form "{Major}.{Minor}.*" will automatically update the build and revision, // and "{Major}.{Minor}.{Build}.*" will update just the revision. [assembly: AssemblyVersion ("1.0.*")] // The following attributes are used to specify the signing key for the assembly, // if desired. See the Mono documentation for more information about signing. [assembly: AssemblyDelaySign(false)] mono-upnp-dcp-mediaserver1-filesystem.snk0000664000175000017500000000112411714307467043511 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem$RSA2ÐÔð1WÞæW8#¹g¼÷¢w}ö ŽÀkê;âÉÎÆs\ðiSᔘ‚°ûoíC§$e½¦ë=§”Ù9!¯ÒI–âÿâüø{+q]¨òc1BYÈò€çtg„nsÕL8=Ã+Œ1“”\¾’кœ²x›1¢ƒ‘ÿTE,L*±M±¬J=›5ØN'¯¸³ZÇüxˆ!Dõ'r-] v9­Çvçeýîm§âÚpCä›Âçé‡Í­„{—7ûØz~~×°úͧ2ÚŤ^)íÀZ–iÿêA2-˜¿x™;*T®ow–A¦êν ò‘îO­±ÿ;|ãñb¥sà^ÆÓRÞ”m¼¶F£{ B|É ûrŠ*²nz"ºpqŠd˜ŠŒI¢vl Gv1Oäd\^‰½ZMªJ!z:åpæ ÕV“Aª7ñ®Ó÷boq¨rÛë„{TBñ-ªñZ!W\´ˆb¯GÍ ‚ÈÉÑp]G÷ÎF‘·ùýC³ph¨’gª\§QÍÿÑM3ÆáýV’yߊֶ§ù%Ц„©¬["†N2*býó샨•á™OÔô`:¨û ™q z(§˜Ð{mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Makefile.am0000664000175000017500000000103311715002253026716 0ustar00lorentzlorentz00000000000000 EXTRA_DIST = #Warning: This is an automatically generated file, do not edit! if ENABLE_DEBUG SUBDIRS = Mono.Upnp.Dcp.MediaServer1 Mono.Upnp.Dcp.MSMediaReceiverRegistrar1 Mono.Upnp.Dcp.MediaServer1.FileSystem Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer Mono.Upnp.Dcp.MediaServer1.GtkClient endif if ENABLE_RELEASE SUBDIRS = Mono.Upnp.Dcp.MediaServer1 Mono.Upnp.Dcp.MSMediaReceiverRegistrar1 Mono.Upnp.Dcp.MediaServer1.FileSystem Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer Mono.Upnp.Dcp.MediaServer1.GtkClient endif mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Makefile.in0000664000175000017500000004200311761736755026757 0ustar00lorentzlorentz00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/expansions.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = Mono.Upnp.Dcp.MediaServer1 \ Mono.Upnp.Dcp.MSMediaReceiverRegistrar1 \ Mono.Upnp.Dcp.MediaServer1.FileSystem \ Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer \ Mono.Upnp.Dcp.MediaServer1.GtkClient DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ GLADE_SHARP_20_CFLAGS = @GLADE_SHARP_20_CFLAGS@ GLADE_SHARP_20_LIBS = @GLADE_SHARP_20_LIBS@ GLIB_SHARP_20_CFLAGS = @GLIB_SHARP_20_CFLAGS@ GLIB_SHARP_20_LIBS = @GLIB_SHARP_20_LIBS@ GMCS = @GMCS@ GTK_SHARP_20_CFLAGS = @GTK_SHARP_20_CFLAGS@ GTK_SHARP_20_LIBS = @GTK_SHARP_20_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MONO_ADDINS_CFLAGS = @MONO_ADDINS_CFLAGS@ MONO_ADDINS_LIBS = @MONO_ADDINS_LIBS@ NUNIT_CFLAGS = @NUNIT_CFLAGS@ NUNIT_CMD = @NUNIT_CMD@ NUNIT_LIBS = @NUNIT_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TAGLIB_SHARP_CFLAGS = @TAGLIB_SHARP_CFLAGS@ TAGLIB_SHARP_LIBS = @TAGLIB_SHARP_LIBS@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_bindir = @expanded_bindir@ expanded_datadir = @expanded_datadir@ expanded_libdir = @expanded_libdir@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = #Warning: This is an automatically generated file, do not edit! @ENABLE_DEBUG_TRUE@SUBDIRS = Mono.Upnp.Dcp.MediaServer1 Mono.Upnp.Dcp.MSMediaReceiverRegistrar1 Mono.Upnp.Dcp.MediaServer1.FileSystem Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer Mono.Upnp.Dcp.MediaServer1.GtkClient @ENABLE_RELEASE_TRUE@SUBDIRS = Mono.Upnp.Dcp.MediaServer1 Mono.Upnp.Dcp.MSMediaReceiverRegistrar1 Mono.Upnp.Dcp.MediaServer1.FileSystem Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer Mono.Upnp.Dcp.MediaServer1.GtkClient all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic ctags \ ctags-recursive distclean distclean-generic distclean-tags \ distdir dvi dvi-am html html-am info info-am install \ install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \ tags-recursive uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/0000775000175000017500000000000011761740037031523 5ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Makefile.am0000664000175000017500000002322611715013277033562 0ustar00lorentzlorentz00000000000000 EXTRA_DIST = # Warning: This is an automatically generated file, do not edit! if ENABLE_DEBUG ASSEMBLY_COMPILER_COMMAND = gmcs ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug -define:DEBUG "-define:DEBUG,TRACE" "-keyfile:$(srcdir)/mono-upnp-dcp-mediaserver1.snk" ASSEMBLY = ../../../../bin/Mono.Upnp.Dcp.MediaServer1.dll ASSEMBLY_MDB = $(ASSEMBLY).mdb COMPILE_TARGET = library PROJECT_REFERENCES = \ ../../../../bin/Mono.Upnp.dll BUILD_DIR = ../../../../bin MONO_UPNP_DCP_MEDIASERVER1_DLL_MDB_SOURCE=../../../../bin/Mono.Upnp.Dcp.MediaServer1.dll.mdb MONO_UPNP_DCP_MEDIASERVER1_DLL_MDB=$(BUILD_DIR)/Mono.Upnp.Dcp.MediaServer1.dll.mdb MONO_UPNP_DLL_SOURCE=../../../../bin/Mono.Upnp.dll MONO_SSDP_DLL_SOURCE=../../../../bin/Mono.Ssdp.dll MONO_SSDP_DLL_MDB_SOURCE=../../../../bin/Mono.Ssdp.dll.mdb MONO_SSDP_DLL_MDB=$(BUILD_DIR)/Mono.Ssdp.dll.mdb MONO_UPNP_DLL_MDB_SOURCE=../../../../bin/Mono.Upnp.dll.mdb MONO_UPNP_DLL_MDB=$(BUILD_DIR)/Mono.Upnp.dll.mdb endif if ENABLE_RELEASE ASSEMBLY_COMPILER_COMMAND = gmcs ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ "-keyfile:$(srcdir)/mono-upnp-dcp-mediaserver1.snk" ASSEMBLY = ../../../../bin/Mono.Upnp.Dcp.MediaServer1.dll ASSEMBLY_MDB = COMPILE_TARGET = library PROJECT_REFERENCES = \ ../../../../bin/Mono.Upnp.dll BUILD_DIR = ../../../../bin MONO_UPNP_DCP_MEDIASERVER1_DLL_MDB= MONO_UPNP_DLL_SOURCE=../../../../bin/Mono.Upnp.dll MONO_SSDP_DLL_SOURCE=../../../../bin/Mono.Ssdp.dll MONO_SSDP_DLL_MDB= MONO_UPNP_DLL_MDB= endif AL=al2 SATELLITE_ASSEMBLY_NAME=$(notdir $(basename $(ASSEMBLY))).resources.dll PROGRAMFILES = \ $(MONO_UPNP_DCP_MEDIASERVER1_DLL_MDB) \ $(MONO_UPNP_DLL) \ $(MONO_SSDP_DLL) \ $(MONO_SSDP_DLL_MDB) \ $(MONO_UPNP_DLL_MDB) LINUX_PKGCONFIG = \ $(MONO_UPNP_DCP_MEDIASERVER1_PC) RESGEN=resgen2 all: $(ASSEMBLY) $(PROGRAMFILES) $(LINUX_PKGCONFIG) FILES = \ AssemblyInfo.cs \ Mono.Upnp.Dcp.MediaServer1/DiscoveryEventArgs.cs \ Mono.Upnp.Dcp.MediaServer1/TransferStatus.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/BrowseFlag.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/Class.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/ClassManager.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/ClassNameAttribute.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/ClassReference.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/Container.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/ContentDirectoryClient.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/ContentDirectoryController.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/DeserializationException.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/Item.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/Object.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/Resolution.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/Resource.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/Results.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/ResultsSettings.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/Schemas.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/WriteStatus.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/ObjectBasedContentDirectory.cs \ Mono.Upnp.Dcp.MediaServer1/MediaServer.cs \ Mono.Upnp.Dcp.MediaServer1.ConnectionManager1/ConnectionManagerController.cs \ Mono.Upnp.Dcp.MediaServer1.ConnectionManager1/ConnectionManagerClient.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/Album.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/AudioBook.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/AudioBroadcast.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/AudioItem.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/Genre.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/ImageItem.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/Movie.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/MovieGenre.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/MusicAlbum.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/MusicArtist.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/MusicGenre.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/MusicTrack.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/MusicVideoClip.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/Person.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/PersonWithRole.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/Photo.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/PhotoAlbum.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/PlaylistContainer.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/PlaylistItem.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/StorageFolder.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/StorageSystem.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/StorageVolume.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/TextItem.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/VideoBroadcast.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/VideoItem.cs \ Mono.Upnp.Dcp.MediaServer1.ConnectionManager1/ConnectionManager.cs \ Mono.Upnp.Dcp.MediaServer1.ConnectionManager1/ConnectionStatus.cs \ Mono.Upnp.Dcp.MediaServer1.ConnectionManager1/Direction.cs \ Mono.Upnp.Dcp.MediaServer1.Internal/Arguments.cs \ Mono.Upnp.Dcp.MediaServer1.Internal/StripedCollection.cs \ Mono.Upnp.Dcp.MediaServer1.Xml/UpdateDelegateSerializationCompiler.cs \ Mono.Upnp.Dcp.MediaServer1.Xml/UpdateContext.cs \ Mono.Upnp.Dcp.MediaServer1.Xml/UpdateTextWriter.cs \ Mono.Upnp.Dcp.MediaServer1.Xml/UpdateXmlSerializer.cs \ Mono.Upnp.Dcp.MediaServer1.Xml/FilteringDelegateSerializationCompiler.cs \ Mono.Upnp.Dcp.MediaServer1.Xml/FilteringContext.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/QueryVisitor.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/Query.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/QueryParser.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/QueryParsingException.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/ObjectQueryVisitor.cs \ Mono.Upnp.Dcp.MediaServer1.Xml/PropertyName.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/ObjectQueryContext.cs \ Mono.Upnp.Dcp.MediaServer1.ConnectionManager1/ProtocolInfo.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/StorageVolumeOptions.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/StorageSystemOptions.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/StorageFolderOptions.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/AlbumOptions.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/AudioBookOptions.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/AudioBroadcastOptions.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/AudioItemOptions.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/GenreOptions.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/ImageItemOptions.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/MovieOptions.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/MusicAlbumOptions.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/MusicArtistOptions.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/MusicTrackOptions.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/MusicVideoClipOptions.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/PersonOptions.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/PhotoOptions.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/PlaylistContainerOptions.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/PlaylistItemOptions.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/TextItemOptions.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/VideoBroadcastOptions.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/VideoItemOptions.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/ContainerOptions.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/ItemOptions.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/ObjectOptions.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/ResourceOptions.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/Error.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/LocalContentDirectory.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/RemoteContentDirectory.cs \ Mono.Upnp.Dcp.MediaServer1.Internal/SearchResults.cs \ Mono.Upnp.Dcp.MediaServer1.Internal/BrowseResults.cs \ Mono.Upnp.Dcp.MediaServer1.Internal/QueryStringifier.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/ContentDirectory.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/Reference.cs \ Mono.Upnp.Dcp.MediaServer1.Xml/VirtualDelegateSerializationCompiler.cs \ Mono.Upnp.Dcp.MediaServer1.Xml/VirtualContext.cs \ Mono.Upnp.Dcp.MediaServer1.Xml/Override.cs DATA_FILES = RESOURCES = EXTRAS = \ Mono.Upnp.Dcp.MediaServer1.ConnectionManager1 \ Mono.Upnp.Dcp.MediaServer1.Internal \ Mono.Upnp.Dcp.MediaServer1.Xml \ Mono.Upnp.Dcp.MediaServer1 \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1 \ mono-upnp-dcp-mediaserver1.snk \ mono.upnp.dcp.mediaserver1.pc.in REFERENCES = \ System \ System.Xml DLL_REFERENCES = CLEANFILES = $(PROGRAMFILES) $(LINUX_PKGCONFIG) include $(top_srcdir)/Makefile.include MONO_UPNP_DLL = $(BUILD_DIR)/Mono.Upnp.dll MONO_SSDP_DLL = $(BUILD_DIR)/Mono.Ssdp.dll MONO_UPNP_DCP_MEDIASERVER1_PC = $(BUILD_DIR)/mono.upnp.dcp.mediaserver1.pc $(eval $(call emit-deploy-wrapper,MONO_UPNP_DCP_MEDIASERVER1_PC,mono.upnp.dcp.mediaserver1.pc)) $(eval $(call emit_resgen_targets)) $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(ASSEMBLY_MDB): $(ASSEMBLY) $(ASSEMBLY): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(shell dirname $(ASSEMBLY)) $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Makefile.in0000664000175000017500000010020011761736756033576 0ustar00lorentzlorentz00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/mono.upnp.dcp.mediaserver1.pc.in \ $(top_srcdir)/Makefile.include subdir = src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/expansions.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = mono.upnp.dcp.mediaserver1.pc CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(bindir)" \ "$(DESTDIR)$(assemblyfilesdir)" \ "$(DESTDIR)$(linuxpkgconfigdir)" \ "$(DESTDIR)$(programfilesdir)" SCRIPTS = $(bin_SCRIPTS) SOURCES = DIST_SOURCES = DATA = $(assemblyfiles_DATA) $(linuxpkgconfig_DATA) \ $(programfiles_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ GLADE_SHARP_20_CFLAGS = @GLADE_SHARP_20_CFLAGS@ GLADE_SHARP_20_LIBS = @GLADE_SHARP_20_LIBS@ GLIB_SHARP_20_CFLAGS = @GLIB_SHARP_20_CFLAGS@ GLIB_SHARP_20_LIBS = @GLIB_SHARP_20_LIBS@ GMCS = @GMCS@ GTK_SHARP_20_CFLAGS = @GTK_SHARP_20_CFLAGS@ GTK_SHARP_20_LIBS = @GTK_SHARP_20_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MONO_ADDINS_CFLAGS = @MONO_ADDINS_CFLAGS@ MONO_ADDINS_LIBS = @MONO_ADDINS_LIBS@ NUNIT_CFLAGS = @NUNIT_CFLAGS@ NUNIT_CMD = @NUNIT_CMD@ NUNIT_LIBS = @NUNIT_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TAGLIB_SHARP_CFLAGS = @TAGLIB_SHARP_CFLAGS@ TAGLIB_SHARP_LIBS = @TAGLIB_SHARP_LIBS@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_bindir = @expanded_bindir@ expanded_datadir = @expanded_datadir@ expanded_libdir = @expanded_libdir@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = $(build_sources) $(build_resx_files) \ $(build_others_files) $(ASSEMBLY_WRAPPER_IN) $(EXTRAS) \ $(DATA_FILES) $(build_culture_res_files) # Warning: This is an automatically generated file, do not edit! @ENABLE_DEBUG_TRUE@ASSEMBLY_COMPILER_COMMAND = gmcs @ENABLE_RELEASE_TRUE@ASSEMBLY_COMPILER_COMMAND = gmcs @ENABLE_DEBUG_TRUE@ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug -define:DEBUG "-define:DEBUG,TRACE" "-keyfile:$(srcdir)/mono-upnp-dcp-mediaserver1.snk" @ENABLE_RELEASE_TRUE@ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ "-keyfile:$(srcdir)/mono-upnp-dcp-mediaserver1.snk" @ENABLE_DEBUG_TRUE@ASSEMBLY = ../../../../bin/Mono.Upnp.Dcp.MediaServer1.dll @ENABLE_RELEASE_TRUE@ASSEMBLY = ../../../../bin/Mono.Upnp.Dcp.MediaServer1.dll @ENABLE_DEBUG_TRUE@ASSEMBLY_MDB = $(ASSEMBLY).mdb @ENABLE_RELEASE_TRUE@ASSEMBLY_MDB = @ENABLE_DEBUG_TRUE@COMPILE_TARGET = library @ENABLE_RELEASE_TRUE@COMPILE_TARGET = library @ENABLE_DEBUG_TRUE@PROJECT_REFERENCES = \ @ENABLE_DEBUG_TRUE@ ../../../../bin/Mono.Upnp.dll @ENABLE_RELEASE_TRUE@PROJECT_REFERENCES = \ @ENABLE_RELEASE_TRUE@ ../../../../bin/Mono.Upnp.dll @ENABLE_DEBUG_TRUE@BUILD_DIR = ../../../../bin @ENABLE_RELEASE_TRUE@BUILD_DIR = ../../../../bin @ENABLE_DEBUG_TRUE@MONO_UPNP_DCP_MEDIASERVER1_DLL_MDB_SOURCE = ../../../../bin/Mono.Upnp.Dcp.MediaServer1.dll.mdb @ENABLE_DEBUG_TRUE@MONO_UPNP_DCP_MEDIASERVER1_DLL_MDB = $(BUILD_DIR)/Mono.Upnp.Dcp.MediaServer1.dll.mdb @ENABLE_RELEASE_TRUE@MONO_UPNP_DCP_MEDIASERVER1_DLL_MDB = @ENABLE_DEBUG_TRUE@MONO_UPNP_DLL_SOURCE = ../../../../bin/Mono.Upnp.dll @ENABLE_RELEASE_TRUE@MONO_UPNP_DLL_SOURCE = ../../../../bin/Mono.Upnp.dll @ENABLE_DEBUG_TRUE@MONO_SSDP_DLL_SOURCE = ../../../../bin/Mono.Ssdp.dll @ENABLE_RELEASE_TRUE@MONO_SSDP_DLL_SOURCE = ../../../../bin/Mono.Ssdp.dll @ENABLE_DEBUG_TRUE@MONO_SSDP_DLL_MDB_SOURCE = ../../../../bin/Mono.Ssdp.dll.mdb @ENABLE_DEBUG_TRUE@MONO_SSDP_DLL_MDB = $(BUILD_DIR)/Mono.Ssdp.dll.mdb @ENABLE_RELEASE_TRUE@MONO_SSDP_DLL_MDB = @ENABLE_DEBUG_TRUE@MONO_UPNP_DLL_MDB_SOURCE = ../../../../bin/Mono.Upnp.dll.mdb @ENABLE_DEBUG_TRUE@MONO_UPNP_DLL_MDB = $(BUILD_DIR)/Mono.Upnp.dll.mdb @ENABLE_RELEASE_TRUE@MONO_UPNP_DLL_MDB = AL = al2 SATELLITE_ASSEMBLY_NAME = $(notdir $(basename $(ASSEMBLY))).resources.dll PROGRAMFILES = \ $(MONO_UPNP_DCP_MEDIASERVER1_DLL_MDB) \ $(MONO_UPNP_DLL) \ $(MONO_SSDP_DLL) \ $(MONO_SSDP_DLL_MDB) \ $(MONO_UPNP_DLL_MDB) LINUX_PKGCONFIG = \ $(MONO_UPNP_DCP_MEDIASERVER1_PC) RESGEN = resgen2 FILES = \ AssemblyInfo.cs \ Mono.Upnp.Dcp.MediaServer1/DiscoveryEventArgs.cs \ Mono.Upnp.Dcp.MediaServer1/TransferStatus.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/BrowseFlag.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/Class.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/ClassManager.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/ClassNameAttribute.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/ClassReference.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/Container.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/ContentDirectoryClient.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/ContentDirectoryController.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/DeserializationException.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/Item.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/Object.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/Resolution.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/Resource.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/Results.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/ResultsSettings.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/Schemas.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/WriteStatus.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/ObjectBasedContentDirectory.cs \ Mono.Upnp.Dcp.MediaServer1/MediaServer.cs \ Mono.Upnp.Dcp.MediaServer1.ConnectionManager1/ConnectionManagerController.cs \ Mono.Upnp.Dcp.MediaServer1.ConnectionManager1/ConnectionManagerClient.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/Album.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/AudioBook.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/AudioBroadcast.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/AudioItem.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/Genre.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/ImageItem.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/Movie.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/MovieGenre.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/MusicAlbum.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/MusicArtist.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/MusicGenre.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/MusicTrack.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/MusicVideoClip.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/Person.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/PersonWithRole.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/Photo.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/PhotoAlbum.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/PlaylistContainer.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/PlaylistItem.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/StorageFolder.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/StorageSystem.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/StorageVolume.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/TextItem.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/VideoBroadcast.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/VideoItem.cs \ Mono.Upnp.Dcp.MediaServer1.ConnectionManager1/ConnectionManager.cs \ Mono.Upnp.Dcp.MediaServer1.ConnectionManager1/ConnectionStatus.cs \ Mono.Upnp.Dcp.MediaServer1.ConnectionManager1/Direction.cs \ Mono.Upnp.Dcp.MediaServer1.Internal/Arguments.cs \ Mono.Upnp.Dcp.MediaServer1.Internal/StripedCollection.cs \ Mono.Upnp.Dcp.MediaServer1.Xml/UpdateDelegateSerializationCompiler.cs \ Mono.Upnp.Dcp.MediaServer1.Xml/UpdateContext.cs \ Mono.Upnp.Dcp.MediaServer1.Xml/UpdateTextWriter.cs \ Mono.Upnp.Dcp.MediaServer1.Xml/UpdateXmlSerializer.cs \ Mono.Upnp.Dcp.MediaServer1.Xml/FilteringDelegateSerializationCompiler.cs \ Mono.Upnp.Dcp.MediaServer1.Xml/FilteringContext.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/QueryVisitor.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/Query.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/QueryParser.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/QueryParsingException.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/ObjectQueryVisitor.cs \ Mono.Upnp.Dcp.MediaServer1.Xml/PropertyName.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/ObjectQueryContext.cs \ Mono.Upnp.Dcp.MediaServer1.ConnectionManager1/ProtocolInfo.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/StorageVolumeOptions.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/StorageSystemOptions.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/StorageFolderOptions.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/AlbumOptions.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/AudioBookOptions.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/AudioBroadcastOptions.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/AudioItemOptions.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/GenreOptions.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/ImageItemOptions.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/MovieOptions.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/MusicAlbumOptions.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/MusicArtistOptions.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/MusicTrackOptions.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/MusicVideoClipOptions.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/PersonOptions.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/PhotoOptions.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/PlaylistContainerOptions.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/PlaylistItemOptions.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/TextItemOptions.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/VideoBroadcastOptions.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/VideoItemOptions.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/ContainerOptions.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/ItemOptions.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/ObjectOptions.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/ResourceOptions.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/Error.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/LocalContentDirectory.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/RemoteContentDirectory.cs \ Mono.Upnp.Dcp.MediaServer1.Internal/SearchResults.cs \ Mono.Upnp.Dcp.MediaServer1.Internal/BrowseResults.cs \ Mono.Upnp.Dcp.MediaServer1.Internal/QueryStringifier.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/ContentDirectory.cs \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/Reference.cs \ Mono.Upnp.Dcp.MediaServer1.Xml/VirtualDelegateSerializationCompiler.cs \ Mono.Upnp.Dcp.MediaServer1.Xml/VirtualContext.cs \ Mono.Upnp.Dcp.MediaServer1.Xml/Override.cs DATA_FILES = RESOURCES = EXTRAS = \ Mono.Upnp.Dcp.MediaServer1.ConnectionManager1 \ Mono.Upnp.Dcp.MediaServer1.Internal \ Mono.Upnp.Dcp.MediaServer1.Xml \ Mono.Upnp.Dcp.MediaServer1 \ Mono.Upnp.Dcp.MediaServer1.ContentDirectory1 \ mono-upnp-dcp-mediaserver1.snk \ mono.upnp.dcp.mediaserver1.pc.in REFERENCES = \ System \ System.Xml DLL_REFERENCES = CLEANFILES = $(PROGRAMFILES) $(LINUX_PKGCONFIG) $(ASSEMBLY) \ $(ASSEMBLY).mdb $(BINARIES) $(build_resx_resources) \ $(build_satellite_assembly_list) VALID_CULTURES = ar bg ca zh-CHS cs da de el en es fi fr he hu is it ja ko nl no pl pt ro ru hr sk sq sv th tr id uk be sl et lv lt fa vi hy eu mk af ka fo hi sw gu ta te kn mr gl kok ar-SA bg-BG ca-ES zh-TW cs-CZ da-DK de-DE el-GR en-US fi-FI fr-FR he-IL hu-HU is-IS it-IT ja-JP ko-KR nl-NL nb-NO pl-PL pt-BR ro-RO ru-RU hr-HR sk-SK sq-AL sv-SE th-TH tr-TR id-ID uk-UA be-BY sl-SI et-EE lv-LV lt-LT fa-IR vi-VN hy-AM eu-ES mk-MK af-ZA ka-GE fo-FO hi-IN sw-KE gu-IN ta-IN te-IN kn-IN mr-IN gl-ES kok-IN ar-IQ zh-CN de-CH en-GB es-MX fr-BE it-CH nl-BE nn-NO pt-PT sv-FI ar-EG zh-HK de-AT en-AU es-ES fr-CA ar-LY zh-SG de-LU en-CA es-GT fr-CH ar-DZ zh-MO en-NZ es-CR fr-LU ar-MA en-IE es-PA ar-TN en-ZA es-DO ar-OM es-VE ar-YE es-CO ar-SY es-PE ar-JO en-TT es-AR ar-LB en-ZW es-EC ar-KW en-PH es-CL ar-AE es-UY ar-BH es-PY ar-QA es-BO es-SV es-HN es-NI es-PR zh-CHT s2q = $(subst \ ,?,$1) q2s = $(subst ?,\ ,$1) # use this when result will be quoted unesc2 = $(subst ?, ,$1) build_sources = $(FILES) $(GENERATED_FILES) build_sources_esc = $(call s2q,$(build_sources)) # use unesc2, as build_sources_embed is quoted build_sources_embed = $(call unesc2,$(build_sources_esc:%='$(srcdir)/%')) comma__ = , get_resource_name = $(firstword $(subst $(comma__), ,$1)) get_culture = $(lastword $(subst ., ,$(basename $1))) is_cultured_resource = $(and $(word 3,$(subst ., ,$1)), $(filter $(VALID_CULTURES),$(lastword $(subst ., ,$(basename $1))))) RESOURCES_ESC = $(call s2q,$(RESOURCES)) build_resx_list = $(foreach res, $(RESOURCES_ESC), $(if $(filter %.resx, $(call get_resource_name,$(res))),$(res),)) build_non_culture_resx_list = $(foreach res, $(build_resx_list),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_non_culture_others_list = $(foreach res, $(filter-out $(build_resx_list),$(RESOURCES_ESC)),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_others_list = $(build_non_culture_others_list) build_xamlg_list = $(filter %.xaml.g.cs, $(FILES)) # resgen all .resx resources build_resx_files = $(foreach res, $(build_resx_list), $(call get_resource_name,$(res))) build_resx_resources_esc = $(build_resx_files:.resx=.resources) build_resx_resources = $(call q2s,$(build_resx_resources_esc)) # embed resources for the main assembly build_resx_resources_hack = $(subst .resx,.resources, $(build_non_culture_resx_list)) # use unesc2, as build_resx_resources_embed is quoted build_resx_resources_embed = $(call unesc2,$(build_resx_resources_hack:%='-resource:%')) build_others_files = $(call q2s,$(foreach res, $(build_others_list),$(call get_resource_name,$(res)))) build_others_resources = $(build_others_files) # use unesc2, as build_others_resources_embed is quoted build_others_resources_embed = $(call unesc2,$(build_others_list:%='-resource:$(srcdir)/%')) build_resources = $(build_resx_resources) $(build_others_resources) build_resources_embed = $(build_resx_resources_embed) $(build_others_resources_embed) # -usesourcepath is available only for resgen2 emit_resgen_target_1 = $(call q2s,$1) : $(call q2s,$(subst .resources,.resx,$1)); cd '$$(shell dirname '$$<')' && MONO_IOMAP=drive $$(RESGEN) '$$(shell basename '$$<')' '$$(shell basename '$$@')' emit_resgen_target_2 = $(call q2s,$1) : $(call q2s,$(subst .resources,.resx,$1)); MONO_IOMAP=drive $$(RESGEN) -usesourcepath '$$<' '$$@' emit_resgen_target = $(if $(filter resgen2,$(RESGEN)),$(emit_resgen_target_2),$(emit_resgen_target_1)) emit_resgen_targets = $(foreach res,$(build_resx_resources_esc),$(eval $(call emit_resgen_target,$(res)))) build_references_ref = $(call q2s,$(foreach ref, $(call \ s2q,$(REFERENCES)), $(if $(filter -pkg:%, $(ref)), $(ref), \ $(if $(filter -r:%, $(ref)), $(ref), -r:$(ref))))) $(call \ q2s,$(foreach ref, $(call s2q,$(DLL_REFERENCES)), -r:$(ref))) \ $(call q2s,$(foreach ref, $(call s2q,$(PROJECT_REFERENCES)), \ -r:$(ref))) s2q2s = $(call unesc2,$(call s2q,$1)) cp_actual = test -z $1 || cp $1 $2 cp = $(call cp_actual,'$(call s2q2s,$1)','$(call s2q2s,$2)') rm_actual = test -z '$1' || rm -f '$2' rm = $(call rm_actual,$(call s2q2s,$1),$(call s2q2s,$2)/$(shell basename '$(call s2q2s,$1)')) DISTCLEANFILES = $(GENERATED_FILES) $(pc_files) $(BUILD_DIR)/* assemblyfilesdir = $(pkglibdir) assemblyfiles_DATA = $(ASSEMBLY) bin_SCRIPTS = $(BINARIES) programfilesdir = @libdir@/@PACKAGE@ programfiles_DATA = $(PROGRAMFILES) linuxpkgconfigdir = @libdir@/pkgconfig linuxpkgconfig_DATA = $(LINUX_PKGCONFIG) # generating satellite assemblies culture_resources = $(foreach res, $(RESOURCES_ESC), $(if $(call is_cultured_resource,$(call get_resource_name, $(res))),$(res))) cultures = $(sort $(foreach res, $(culture_resources), $(call get_culture,$(call get_resource_name,$(res))))) culture_resource_dependencies = $(call q2s,$(BUILD_DIR)/$1/$(SATELLITE_ASSEMBLY_NAME): $(subst .resx,.resources,$2)) culture_resource_commandlines = $(call unesc2,cmd_line_satellite_$1 += '/embed:$(subst .resx,.resources,$2)') build_satellite_assembly_list = $(call q2s,$(cultures:%=$(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME))) build_culture_res_files = $(call q2s,$(foreach res, $(culture_resources),$(call get_resource_name,$(res)))) install_satellite_assembly_list = $(subst $(BUILD_DIR),$(DESTDIR)$(libdir)/$(PACKAGE),$(build_satellite_assembly_list)) MONO_UPNP_DLL = $(BUILD_DIR)/Mono.Upnp.dll MONO_SSDP_DLL = $(BUILD_DIR)/Mono.Ssdp.dll MONO_UPNP_DCP_MEDIASERVER1_PC = $(BUILD_DIR)/mono.upnp.dcp.mediaserver1.pc all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.include $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/Makefile.include: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mono.upnp.dcp.mediaserver1.pc: $(top_builddir)/config.status $(srcdir)/mono.upnp.dcp.mediaserver1.pc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) install-assemblyfilesDATA: $(assemblyfiles_DATA) @$(NORMAL_INSTALL) test -z "$(assemblyfilesdir)" || $(MKDIR_P) "$(DESTDIR)$(assemblyfilesdir)" @list='$(assemblyfiles_DATA)'; test -n "$(assemblyfilesdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(assemblyfilesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(assemblyfilesdir)" || exit $$?; \ done uninstall-assemblyfilesDATA: @$(NORMAL_UNINSTALL) @list='$(assemblyfiles_DATA)'; test -n "$(assemblyfilesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(assemblyfilesdir)'; $(am__uninstall_files_from_dir) install-linuxpkgconfigDATA: $(linuxpkgconfig_DATA) @$(NORMAL_INSTALL) test -z "$(linuxpkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(linuxpkgconfigdir)" @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(linuxpkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(linuxpkgconfigdir)" || exit $$?; \ done uninstall-linuxpkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(linuxpkgconfigdir)'; $(am__uninstall_files_from_dir) install-programfilesDATA: $(programfiles_DATA) @$(NORMAL_INSTALL) test -z "$(programfilesdir)" || $(MKDIR_P) "$(DESTDIR)$(programfilesdir)" @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(programfilesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(programfilesdir)" || exit $$?; \ done uninstall-programfilesDATA: @$(NORMAL_UNINSTALL) @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(programfilesdir)'; $(am__uninstall_files_from_dir) tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(assemblyfilesdir)" "$(DESTDIR)$(linuxpkgconfigdir)" "$(DESTDIR)$(programfilesdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-assemblyfilesDATA install-linuxpkgconfigDATA \ install-programfilesDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binSCRIPTS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-assemblyfilesDATA uninstall-binSCRIPTS \ uninstall-linuxpkgconfigDATA uninstall-programfilesDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-assemblyfilesDATA \ install-binSCRIPTS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-linuxpkgconfigDATA install-man install-pdf \ install-pdf-am install-programfilesDATA install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \ uninstall-am uninstall-assemblyfilesDATA uninstall-binSCRIPTS \ uninstall-linuxpkgconfigDATA uninstall-programfilesDATA all: $(ASSEMBLY) $(PROGRAMFILES) $(LINUX_PKGCONFIG) # macros # $(call emit-deploy-target,deploy-variable-name) define emit-deploy-target $($1): $($1_SOURCE) mkdir -p '$$(shell dirname '$$@')' cp '$$<' '$$@' endef # $(call emit-deploy-wrapper,wrapper-variable-name,wrapper-sourcefile,x) # assumes that for a wrapper foo.pc its source template is foo.pc.in # if $3 is non-empty then wrapper is marked exec define emit-deploy-wrapper $($1): $2 mkdir -p '$$(shell dirname '$$@')' cp '$$<' '$$@' $(if $3,chmod +x '$$@') endef $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_dependencies,$(call get_culture,$(call get_resource_name,$(res))),$(call get_resource_name,$(res)))))) $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_commandlines,$(call get_culture,$(call get_resource_name,$(res))),$(res))))) $(build_satellite_assembly_list): $(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME): mkdir -p '$(@D)' $(AL) -out:'$@' -culture:$* -t:lib $(cmd_line_satellite_$*) $(install_satellite_assembly_list): mkdir -p '$(@D)' cp $(subst $(DESTDIR)$(libdir)/$(PACKAGE), $(BUILD_DIR), $@) $@ install-satellite-assemblies: $(install_satellite_assembly_list) uninstall-satellite-assemblies: rm -rf $(install_satellite_assembly_list) $(eval $(call emit-deploy-wrapper,MONO_UPNP_DCP_MEDIASERVER1_PC,mono.upnp.dcp.mediaserver1.pc)) $(eval $(call emit_resgen_targets)) $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(ASSEMBLY_MDB): $(ASSEMBLY) $(ASSEMBLY): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(shell dirname $(ASSEMBLY)) $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV/0000775000175000017500000000000011761740037042154 5ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1TextItemOptions.cs0000664000175000017500000000524511707010776045630 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV// // TextItemOptions.cs // // Author: // Yavor Georgiev // // Copyright (c) 2010 Yavor Georgiev // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV { public class TextItemOptions : ItemOptions { IEnumerable authors; IEnumerable publishers; IEnumerable contributors; IEnumerable relations; IEnumerable rights; public IEnumerable Authors { get { return GetEnumerable (authors); } set { authors = value; } } public IEnumerable Publishers { get { return GetEnumerable (publishers); } set { publishers = value; } } public IEnumerable Contributors { get { return GetEnumerable (contributors); } set { contributors = value; } } public IEnumerable Relations { get { return GetEnumerable (relations); } set { relations = value; } } public IEnumerable Rights { get { return GetEnumerable (rights); } set { rights = value; } } public virtual string Protection { get; set; } public virtual string LongDescription { get; set; } public virtual string StorageMedium { get; set; } public virtual string Rating { get; set; } public virtual string Description { get; set; } public virtual string Date { get; set; } public virtual string Language { get; set; } } } PersonOptions.cs0000664000175000017500000000254111707010776045327 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV// // PersonOptions.cs // // Author: // Yavor Georgiev // // Copyright (c) 2010 Yavor Georgiev // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV { public class PersonOptions : ContainerOptions { public string Language { get; set; } } } Person.cs0000664000175000017500000000454011707010776043754 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV// // Person.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using Mono.Upnp.Xml; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV { public class Person : Container { protected Person () { } public Person (string id, string parentId, PersonOptions options) : base (id, parentId, options) { Language = options.Language; } protected void CopyToOptions (PersonOptions options) { base.CopyToOptions (options); options.Language = Language; } public new PersonOptions GetOptions () { var options = new PersonOptions (); CopyToOptions (options); return options; } [XmlElement ("language", Schemas.DublinCoreSchema, OmitIfNull = true)] public virtual string Language { get; protected set; } protected override void DeserializeElement (XmlDeserializationContext context) { context.AutoDeserializeElement (this); } protected override void SerializeMembers (XmlSerializationContext context) { AutoSerializeMembers (this, context); } } } MusicAlbumOptions.cs0000664000175000017500000000423211707010776046121 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV// // MusicAlbumOptions.cs // // Author: // Yavor Georgiev // // Copyright (c) 2010 Yavor Georgiev // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV { public class MusicAlbumOptions : AlbumOptions { IEnumerable artists; IEnumerable genres; IEnumerable producers; IEnumerable album_art_uris; public IEnumerable Artists { get { return GetEnumerable (artists); } set { artists = value; } } public IEnumerable Genres { get { return GetEnumerable (genres); } set { genres = value; } } public IEnumerable Producers { get { return GetEnumerable (producers); } set { producers = value; } } public IEnumerable AlbumArtUris { get { return GetEnumerable (album_art_uris); } set { album_art_uris = value; } } public virtual string Toc { get; set; } } } ImageItemOptions.cs0000664000175000017500000000374411707010776045730 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV// // ImageItemOptions.cs // // Author: // Yavor Georgiev // // Copyright (c) 2010 Yavor Georgiev // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System.Collections.Generic; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV { public class ImageItemOptions : ItemOptions { IEnumerable publishers; IEnumerable rights; public IEnumerable Publishers { get { return GetEnumerable (publishers); } set { publishers = value; } } public IEnumerable Rights { get { return GetEnumerable (rights); } set { rights = value; } } public virtual string LongDescription { get; set; } public virtual string StorageMedium { get; set; } public virtual string Rating { get; set; } public virtual string Description { get; set; } public virtual string Date { get; set; } } } Movie.cs0000664000175000017500000000777211707010776043577 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV// // Movie.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using System.Collections.ObjectModel; using Mono.Upnp.Internal; using Mono.Upnp.Xml; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV { public class Movie : VideoItem { protected Movie () { ScheduledStartTimes = new List (); ScheduledEndTimes = new List (); } public Movie (string id, string parentId, MovieOptions options) : base (id, parentId, options) { StorageMedium = options.StorageMedium; DvdRegionCode = options.DvdRegionCode; ChannelName = options.ChannelName; ScheduledStartTimes = Helper.MakeReadOnlyCopy (options.ScheduledStartTimes); ScheduledEndTimes = Helper.MakeReadOnlyCopy (options.ScheduledEndTimes); } protected void CopyToOptions (MovieOptions options) { base.CopyToOptions (options); options.StorageMedium = StorageMedium; options.DvdRegionCode = DvdRegionCode; options.ChannelName = ChannelName; options.ScheduledStartTimes = new List (ScheduledStartTimes); options.ScheduledEndTimes = new List (ScheduledEndTimes); } public new MovieOptions GetOptions () { var options = new MovieOptions (); CopyToOptions (options); return options; } [XmlElement ("storageMedium", Schemas.UpnpSchema, OmitIfNull = true)] public virtual string StorageMedium { get; protected set; } [XmlElement ("DVDRegionCode", Schemas.UpnpSchema, OmitIfNull = true)] public virtual int? DvdRegionCode { get; protected set; } [XmlElement ("channelName", Schemas.UpnpSchema, OmitIfNull = true)] public virtual string ChannelName { get; protected set; } [XmlArrayItem ("scheduledStartTime", Schemas.UpnpSchema)] public virtual IList ScheduledStartTimes { get; private set; } [XmlArrayItem ("scheduledEndTime", Schemas.UpnpSchema)] public virtual IList ScheduledEndTimes { get; private set; } protected override void Deserialize (XmlDeserializationContext context) { base.Deserialize (context); ScheduledStartTimes = new ReadOnlyCollection (ScheduledStartTimes); ScheduledEndTimes = new ReadOnlyCollection (ScheduledEndTimes); } protected override void DeserializeElement (XmlDeserializationContext context) { context.AutoDeserializeElement (this); } protected override void SerializeMembers (XmlSerializationContext context) { AutoSerializeMembers (this, context); } } } MusicArtist.cs0000664000175000017500000000602311707010776044753 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV// // MusicArtist.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using System.Collections.ObjectModel; using Mono.Upnp.Internal; using Mono.Upnp.Xml; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV { public class MusicArtist : Person { protected MusicArtist () { Genres = new List (); } public MusicArtist (string id, string parentId, MusicArtistOptions options) : base (id, parentId, options) { ArtistDiscographyUri = options.ArtistDiscographyUri; Genres = Helper.MakeReadOnlyCopy (options.Genres); } protected void CopyToOptions (MusicArtistOptions options) { base.CopyToOptions (options); options.ArtistDiscographyUri = ArtistDiscographyUri; options.Genres = new List (Genres); } public new MusicArtistOptions GetOptions () { var options = new MusicArtistOptions (); CopyToOptions (options); return options; } [XmlArrayItem ("genre", Schemas.UpnpSchema)] public virtual IList Genres { get; private set; } [XmlElement ("artistDiscographyURI", Schemas.UpnpSchema, OmitIfNull = true)] public virtual Uri ArtistDiscographyUri { get; protected set; } protected override void Deserialize (XmlDeserializationContext context) { base.Deserialize (context); Genres = new ReadOnlyCollection (Genres); } protected override void DeserializeElement (XmlDeserializationContext context) { context.AutoDeserializeElement (this); } protected override void SerializeMembers (XmlSerializationContext context) { AutoSerializeMembers (this, context); } } } VideoBroadcast.cs0000664000175000017500000000547511707010776045407 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV// // VideoBroadcast.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using Mono.Upnp.Xml; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV { public class VideoBroadcast : VideoItem { protected VideoBroadcast () { } public VideoBroadcast (string id, string parentId, VideoBroadcastOptions options) : base (id, parentId, options) { Icon = options.Icon; Region = options.Region; ChannelNr = options.ChannelNr; } protected void CopyToOptions (VideoBroadcastOptions options) { base.CopyToOptions (options); options.Icon = Icon; options.Region = Region; options.ChannelNr = ChannelNr; } public new VideoBroadcastOptions GetOptions () { var options = new VideoBroadcastOptions (); CopyToOptions (options); return options; } [XmlElement ("icon", Schemas.UpnpSchema, OmitIfNull = true)] public virtual Uri Icon { get; protected set; } [XmlElement ("region", Schemas.UpnpSchema, OmitIfNull = true)] public virtual string Region { get; protected set; } [XmlElement ("channelNr", Schemas.UpnpSchema, OmitIfNull = true)] public virtual int? ChannelNr { get; protected set; } protected override void DeserializeElement (XmlDeserializationContext context) { context.AutoDeserializeElement (this); } protected override void SerializeMembers (XmlSerializationContext context) { AutoSerializeMembers (this, context); } } } MusicTrackOptions.cs0000664000175000017500000000452111707010776046126 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV// // MusicTrackOptions.cs // // Author: // Yavor Georgiev // // Copyright (c) 2010 Yavor Georgiev // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV { public class MusicTrackOptions : AudioItemOptions { IEnumerable artists; IEnumerable albums; IEnumerable playlists; IEnumerable contributors; public IEnumerable Artists { get { return GetEnumerable (artists); } set { artists = value; } } public IEnumerable Albums { get { return GetEnumerable (albums); } set { albums = value; } } public IEnumerable Playlists { get { return GetEnumerable (playlists); } set { playlists = value; } } public IEnumerable Contributors { get { return GetEnumerable (contributors); } set { contributors = value; } } public virtual Uri AlbumArtUri { get; set; } public virtual int? OriginalTrackNumber { get; set; } public virtual string StorageMedium { get; set; } public virtual string Date { get; set; } } } PhotoOptions.cs0000664000175000017500000000300711707010776045150 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV// // PhotoOptions.cs // // Author: // Yavor Georgiev // // Copyright (c) 2010 Yavor Georgiev // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System.Collections.Generic; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV { public class PhotoOptions : ImageItemOptions { IEnumerable albums; public IEnumerable Albums { get { return GetEnumerable (albums); } set { albums = value; } } } } AudioItemOptions.cs0000664000175000017500000000433011707010776045737 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV// // AudioItemOptions.cs // // Author: // Yavor Georgiev // // Copyright (c) 2010 Yavor Georgiev // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV { public class AudioItemOptions : ItemOptions { IEnumerable genres; IEnumerable publishers; IEnumerable relations; IEnumerable rights; public IEnumerable Genres { get { return GetEnumerable (genres); } set { genres = value; } } public IEnumerable Publishers { get { return GetEnumerable (publishers); } set { publishers = value; } } public IEnumerable Relations { get { return GetEnumerable (relations); } set { relations = value; } } public IEnumerable Rights { get { return GetEnumerable (rights); } set { rights = value; } } public string Description { get; set; } public string LongDescription { get; set; } public string Language { get; set; } } } AudioBroadcast.cs0000664000175000017500000000657711707010776045406 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV// // AudioBroadcast.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using Mono.Upnp.Xml; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV { public class AudioBroadcast : AudioItem { protected AudioBroadcast () { } public AudioBroadcast (string id, string parentId, AudioBroadcastOptions options) : base (id, parentId, options) { Region = options.Region; RadioCallSign = options.RadioCallSign; RadioStationId = options.RadioStationId; RadioBand = options.RadioBand; ChannelNr = options.ChannelNr; } protected void CopyToOptions (AudioBroadcastOptions options) { base.CopyToOptions (options); options.Region = Region; options.RadioCallSign = RadioCallSign; options.RadioStationId = RadioStationId; options.RadioBand = RadioBand; options.ChannelNr = ChannelNr; } public new AudioBroadcastOptions GetOptions () { var options = new AudioBroadcastOptions (); CopyToOptions (options); return options; } [XmlElement ("region", Schemas.UpnpSchema, OmitIfNull = true)] public virtual string Region { get; protected set; } [XmlElement ("radioCallSign", Schemas.UpnpSchema, OmitIfNull = true)] public virtual string RadioCallSign { get; protected set; } [XmlElement ("radioStationID", Schemas.UpnpSchema, OmitIfNull = true)] public virtual string RadioStationId { get; protected set; } [XmlElement ("radioBand", Schemas.UpnpSchema, OmitIfNull = true)] public virtual string RadioBand { get; protected set; } [XmlElement ("channelNr", Schemas.UpnpSchema, OmitIfNull = true)] public virtual int? ChannelNr { get; protected set; } // FIXME is this right? protected override void DeserializeElement (XmlDeserializationContext context) { context.AutoDeserializeElement (this); } protected override void SerializeMembers (XmlSerializationContext context) { AutoSerializeMembers (this, context); } } } Genre.cs0000664000175000017500000000516711707010776043554 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV// // Genre.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using Mono.Upnp.Xml; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV { public class Genre : Container { protected Genre () { } public Genre (string id, string parentId, GenreOptions options) : base (id, parentId, options) { Description = options.Description; LongDescription = options.LongDescription; } protected void CopyToOptions (GenreOptions options) { base.CopyToOptions (options); options.Description = Description; options.LongDescription = LongDescription; } public new GenreOptions GetOptions () { var options = new GenreOptions (); CopyToOptions (options); return options; } [XmlElement ("longDescription", Schemas.UpnpSchema, OmitIfNull = true)] public virtual string LongDescription { get; protected set; } [XmlElement ("description", Schemas.DublinCoreSchema, OmitIfNull = true)] public virtual string Description { get; protected set; } protected override void DeserializeElement (XmlDeserializationContext context) { context.AutoDeserializeElement (this); } protected override void SerializeMembers (XmlSerializationContext context) { AutoSerializeMembers (this, context); } } } GenreOptions.cs0000664000175000017500000000262711707010776045126 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV// // GenreOptions.cs // // Author: // Yavor Georgiev // // Copyright (c) 2010 Yavor Georgiev // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV { public class GenreOptions : ContainerOptions { public string LongDescription { get; set; } public string Description { get; set; } } } ImageItem.cs0000664000175000017500000001040711707010776044346 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV// // ImageItem.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using System.Collections.ObjectModel; using Mono.Upnp.Internal; using Mono.Upnp.Xml; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV { public class ImageItem : Item { protected ImageItem () { Publishers = new List (); Rights = new List (); } public ImageItem (string id, string parentId, ImageItemOptions options) : base (id, parentId, options) { LongDescription = options.LongDescription; StorageMedium = options.StorageMedium; Rating = options.Rating; Description = options.Description; Date = options.Date; Publishers = Helper.MakeReadOnlyCopy (options.Publishers); Rights = Helper.MakeReadOnlyCopy (options.Rights); } protected void CopyToOptions (ImageItemOptions options) { base.CopyToOptions (options); options.LongDescription = LongDescription; options.StorageMedium = StorageMedium; options.Rating = Rating; options.Description = Description; options.Date = Date; options.Publishers = new List (Publishers); options.Rights = new List (Rights); } public new ImageItemOptions GetOptions () { var options = new ImageItemOptions (); CopyToOptions (options); return options; } [XmlElement ("longDescription", Schemas.UpnpSchema, OmitIfNull = true)] public virtual string LongDescription { get; protected set; } [XmlElement ("storageMedium", Schemas.UpnpSchema, OmitIfNull = true)] public virtual string StorageMedium { get; protected set; } [XmlElement ("rating", Schemas.UpnpSchema, OmitIfNull = true)] public virtual string Rating { get; protected set; } [XmlElement ("description", Schemas.DublinCoreSchema, OmitIfNull = true)] public virtual string Description { get; protected set; } [XmlArrayItem ("publisher", Schemas.DublinCoreSchema)] public virtual IList Publishers { get; private set; } [XmlElement ("date", Schemas.DublinCoreSchema)] public virtual string Date { get; protected set; } [XmlArrayItem ("rights", Schemas.DublinCoreSchema)] public virtual IList Rights { get; private set; } protected override void Deserialize (XmlDeserializationContext context) { base.Deserialize (context); Publishers = new ReadOnlyCollection (Publishers); Rights = new ReadOnlyCollection (Rights); } protected override void DeserializeElement (XmlDeserializationContext context) { context.AutoDeserializeElement (this); } protected override void SerializeMembers (XmlSerializationContext context) { AutoSerializeMembers (this, context); } } } VideoItem.cs0000664000175000017500000001303211707010776044367 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV// // VideoItem.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using System.Collections.ObjectModel; using Mono.Upnp.Internal; using Mono.Upnp.Xml; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV { public class VideoItem : Item { protected VideoItem () { Genres = new List (); Actors = new List (); Directors = new List (); Producers = new List (); Publishers = new List (); Relations = new List (); } public VideoItem (string id, string parentId, VideoItemOptions options) : base (id, parentId, options) { Description = options.Description; LongDescription = options.LongDescription; Rating = options.Rating; Language = options.Language; Genres = Helper.MakeReadOnlyCopy (options.Genres); Actors = Helper.MakeReadOnlyCopy (options.Actors); Directors = Helper.MakeReadOnlyCopy (options.Directors); Producers = Helper.MakeReadOnlyCopy (options.Producers); Publishers = Helper.MakeReadOnlyCopy (options.Publishers); Relations = Helper.MakeReadOnlyCopy (options.Relations); } protected void CopyToOptions (VideoItemOptions options) { base.CopyToOptions (options); options.Description = Description; options.LongDescription = LongDescription; options.Rating = Rating; options.Language = Language; options.Genres = new List (Genres); options.Actors = new List (Actors); options.Directors = new List (Directors); options.Producers = new List (Producers); options.Publishers = new List (Publishers); options.Relations = new List (Relations); } public new VideoItemOptions GetOptions () { var options = new VideoItemOptions (); CopyToOptions (options); return options; } [XmlArrayItemAttribute ("genre", Schemas.UpnpSchema)] public virtual IList Genres { get; private set; } [XmlElement ("longDescription", Schemas.UpnpSchema, OmitIfNull = true)] public virtual string LongDescription { get; protected set; } [XmlArrayItem ("producer", Schemas.UpnpSchema)] public virtual IList Producers { get; private set; } [XmlElement ("rating", Schemas.UpnpSchema, OmitIfNull = true)] public virtual string Rating { get; protected set; } [XmlArrayItem ("actor", Schemas.UpnpSchema)] public virtual IList Actors { get; private set; } [XmlArrayItem ("director", Schemas.UpnpSchema)] public virtual IList Directors { get; private set; } [XmlElement ("description", Schemas.DublinCoreSchema, OmitIfNull = true)] public virtual string Description { get; protected set; } [XmlArrayItem ("publisher", Schemas.DublinCoreSchema)] public virtual IList Publishers { get; private set; } [XmlElement ("language", Schemas.DublinCoreSchema, OmitIfNull = true)] public virtual string Language { get; protected set; } [XmlArrayItem ("relation", Schemas.DublinCoreSchema)] public virtual IList Relations { get; private set; } protected override void Deserialize (XmlDeserializationContext context) { base.Deserialize (context); Genres = new ReadOnlyCollection (Genres); Actors = new ReadOnlyCollection (Actors); Directors = new ReadOnlyCollection (Directors); Producers = new ReadOnlyCollection (Producers); Publishers = new ReadOnlyCollection (Publishers); Relations = new ReadOnlyCollection (Relations); } protected override void DeserializeElement (XmlDeserializationContext context) { context.AutoDeserializeElement (this); } protected override void SerializeMembers (XmlSerializationContext context) { AutoSerializeMembers (this, context); } } } StorageVolumeOptions.cs0000664000175000017500000000272511707010776046661 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV// // StorageVolumeOptions.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV { public class StorageVolumeOptions : StorageFolderOptions { public long StorageTotal { get; set; } public long StorageFree { get; set; } public string StorageMedium { get; set; } } } PersonWithRole.cs0000664000175000017500000000443511707010776045435 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV// // PersonWithRole.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using Mono.Upnp.Xml; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV { public class PersonWithRole { protected PersonWithRole () { } public PersonWithRole (string name, string role) { if (name == null) { throw new ArgumentNullException ("name"); } else if (role == null) { throw new ArgumentNullException ("role"); } Name = name; Role = role; } [XmlValue] public string Name { get; protected set; } [XmlAttribute ("role", Namespace = Schemas.UpnpSchema)] public string Role { get; protected set; } public override bool Equals (object obj) { var person_with_role = obj as PersonWithRole; return person_with_role != null && person_with_role.Name == Name && person_with_role.Role == Role; } public override int GetHashCode () { return Name.GetHashCode () ^ Role.GetHashCode (); } } } AlbumOptions.cs0000664000175000017500000000443411707010776045124 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV// // AlbumOptions.cs // // Author: // Yavor Georgiev // // Copyright (c) 2010 Yavor Georgiev // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV { public class AlbumOptions : ContainerOptions { IEnumerable publishers; IEnumerable contributors; IEnumerable relations; IEnumerable rights; public IEnumerable Publishers { get { return GetEnumerable (publishers); } set { publishers = value; } } public IEnumerable Contributors { get { return GetEnumerable (contributors); } set { contributors = value; } } public IEnumerable Relations { get { return GetEnumerable (relations); } set { relations = value; } } public IEnumerable Rights { get { return GetEnumerable (rights); } set { rights = value; } } public string StorageMedium { get; set; } public string LongDescription { get; set; } public string Description { get; set; } public string Date { get; set; } } } AudioBook.cs0000664000175000017500000000714611707010776044367 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV// // AudioBook.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using System.Collections.ObjectModel; using Mono.Upnp.Internal; using Mono.Upnp.Xml; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV { public class AudioBook : AudioItem { protected AudioBook () { Producers = new List (); Contributors = new List (); } public AudioBook (string id, string parentId, AudioBookOptions options) : base (id, parentId, options) { StorageMedium = options.StorageMedium; Date = options.Date; Producers = Helper.MakeReadOnlyCopy (options.Producers); Contributors = Helper.MakeReadOnlyCopy (options.Contributors); } protected void CopyToOptions (AudioBookOptions options) { base.CopyToOptions (options); options.StorageMedium = StorageMedium; options.Date = Date; options.Producers = new List (Producers); options.Contributors = new List (Contributors); } public new AudioBookOptions GetOptions () { var options = new AudioBookOptions (); CopyToOptions (options); return options; } [XmlElement ("storageMedium", Schemas.UpnpSchema, OmitIfNull = true)] public virtual string StorageMedium { get; protected set; } [XmlArrayItem ("producer", Schemas.UpnpSchema)] public virtual IList Producers { get; private set; } [XmlArrayItem ("contributor", Schemas.DublinCoreSchema)] public virtual IList Contributors { get; private set; } [XmlElement ("date", Schemas.DublinCoreSchema, OmitIfNull = true)] public virtual string Date { get; protected set; } protected override void Deserialize (XmlDeserializationContext context) { base.Deserialize (context); Producers = new ReadOnlyCollection (Producers); Contributors = new ReadOnlyCollection (Contributors); } protected override void DeserializeElement (XmlDeserializationContext context) { context.AutoDeserializeElement (this); } protected override void SerializeMembers (XmlSerializationContext context) { AutoSerializeMembers (this, context); } } } MovieOptions.cs0000664000175000017500000000372011707010776045140 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV// // MovieOptions.cs // // Author: // Yavor Georgiev // // Copyright (c) 2010 Yavor Georgiev // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV { public class MovieOptions : VideoItemOptions { IEnumerable scheduled_start_times; IEnumerable scheduled_end_times; public IEnumerable ScheduledStartTimes { get { return GetEnumerable (scheduled_start_times); } set { scheduled_start_times = value; } } public IEnumerable ScheduledEndTimes { get { return GetEnumerable (scheduled_end_times); } set { scheduled_end_times = value; } } public string StorageMedium { get; set; } public int? DvdRegionCode { get; set; } public string ChannelName { get; set; } } } MusicTrack.cs0000664000175000017500000001173111707010776044553 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV// // MusicTrack.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using System.Collections.ObjectModel; using Mono.Upnp.Internal; using Mono.Upnp.Xml; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV { public class MusicTrack : AudioItem { protected MusicTrack () { Artists = new List (); Albums = new List (); Playlists = new List (); Contributors = new List (); } public MusicTrack (string id, string parentId, MusicTrackOptions options) : base (id, parentId, options) { AlbumArtUri = options.AlbumArtUri; Date = options.Date; OriginalTrackNumber = options.OriginalTrackNumber; StorageMedium = options.StorageMedium; Artists = Helper.MakeReadOnlyCopy (options.Artists); Albums = Helper.MakeReadOnlyCopy (options.Albums); Playlists = Helper.MakeReadOnlyCopy (options.Playlists); Contributors = Helper.MakeReadOnlyCopy (options.Contributors); } protected void CopyToOptions (MusicTrackOptions options) { base.CopyToOptions (options); options.AlbumArtUri = AlbumArtUri; options.Date = Date; options.OriginalTrackNumber = OriginalTrackNumber; options.StorageMedium = StorageMedium; options.Artists = new List (Artists); options.Albums = new List (Albums); options.Playlists = new List (Playlists); options.Contributors = new List (Contributors); } public new MusicTrackOptions GetOptions () { var options = new MusicTrackOptions (); CopyToOptions (options); return options; } [XmlElement ("albumArtURI", Schemas.UpnpSchema, OmitIfNull = true)] public virtual Uri AlbumArtUri { get; protected set; } [XmlArrayItem ("artist", Schemas.UpnpSchema)] public virtual IList Artists { get; private set; } [XmlArrayItem ("album", Schemas.UpnpSchema)] public virtual IList Albums { get; private set; } [XmlElement ("orginalTrackElement", Schemas.UpnpSchema, OmitIfNull = true)] public virtual int? OriginalTrackNumber { get; protected set; } [XmlArrayItem ("playlist", Schemas.UpnpSchema)] public virtual IList Playlists { get; private set; } [XmlElement ("storageMedium", Schemas.UpnpSchema, OmitIfNull = true)] public virtual string StorageMedium { get; protected set; } [XmlArrayItem ("contributor", Schemas.DublinCoreSchema)] public virtual IList Contributors { get; private set; } [XmlElement ("date", Schemas.DublinCoreSchema, OmitIfNull = true)] public virtual string Date { get; protected set; } // TODO what is the deal with this?!?!?! //public Uri LyricsUri { get; private set; } protected override void Deserialize (XmlDeserializationContext context) { base.Deserialize (context); Artists = new ReadOnlyCollection (Artists); Albums = new ReadOnlyCollection (Albums); Playlists = new ReadOnlyCollection (Playlists); Contributors = new ReadOnlyCollection (Contributors); } protected override void DeserializeElement (XmlDeserializationContext context) { context.AutoDeserializeElement (this); } protected override void SerializeMembers (XmlSerializationContext context) { AutoSerializeMembers (this, context); } } } MusicVideoClipOptions.cs0000664000175000017500000000475511707010776046751 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV// // MusicVideoClipOptions.cs // // Author: // Yavor Georgiev // // Copyright (c) 2010 Yavor Georgiev // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV { public class MusicVideoClipOptions : VideoItemOptions { IEnumerable artists; IEnumerable albums; IEnumerable scheduled_start_times; IEnumerable scheduled_end_times; IEnumerable contributors; public IEnumerable Artists { get { return GetEnumerable (artists); } set { artists = value; } } public IEnumerable Albums { get { return GetEnumerable (albums); } set { albums = value; } } public IEnumerable ScheduledStartTimes { get { return GetEnumerable (scheduled_start_times); } set { scheduled_start_times = value; } } public IEnumerable ScheduledEndTimes { get { return GetEnumerable (scheduled_end_times); } set { scheduled_end_times = value; } } public IEnumerable Contributors { get { return GetEnumerable (contributors); } set { contributors = value; } } public string StorageMedium { get; set; } public string Date { get; set; } } } PhotoAlbum.cs0000664000175000017500000000275611707010776044567 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV // // PhotoAlbum.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV { public class PhotoAlbum : Album { protected PhotoAlbum () { } public PhotoAlbum (string id, string parentId, AlbumOptions options) : base (id, parentId, options) { } } } StorageSystem.cs0000664000175000017500000000652011707010776045317 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV// // StorageSystem.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using Mono.Upnp.Xml; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV { public class StorageSystem : Container { protected StorageSystem () { } public StorageSystem (string id, string parentId, StorageSystemOptions options) : base (id, parentId, options) { StorageTotal = options.StorageTotal; StorageUsed = options.StorageUsed; StorageFree = options.StorageFree; StorageMaxPartition = options.StorageMaxPartition; StorageMedium = options.StorageMedium; } protected void CopyToOptions (StorageSystemOptions options) { base.CopyToOptions (options); options.StorageTotal = StorageTotal; options.StorageUsed = StorageUsed; options.StorageFree = StorageFree; options.StorageMaxPartition = StorageMaxPartition; options.StorageMedium = StorageMedium; } public new StorageSystemOptions GetOptions () { var option = new StorageSystemOptions (); CopyToOptions (option); return option; } [XmlElement ("storageTotal", Schemas.UpnpSchema)] public virtual long StorageTotal { get; protected set; } [XmlElement ("storageUsed", Schemas.UpnpSchema)] public virtual long StorageUsed { get; protected set; } [XmlElement ("storageFree", Schemas.UpnpSchema)] public virtual long StorageFree { get; protected set; } [XmlElement ("storageMaxPartition", Schemas.UpnpSchema)] public virtual long StorageMaxPartition { get; protected set; } [XmlElement ("storageMedium", Schemas.UpnpSchema)] public virtual string StorageMedium { get; protected set; } protected override void DeserializeElement (XmlDeserializationContext context) { context.AutoDeserializeElement (this); } protected override void SerializeMembers (XmlSerializationContext context) { AutoSerializeMembers (this, context); } } } Photo.cs0000664000175000017500000000527611707010776043606 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV// // Photo.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using System.Collections.ObjectModel; using Mono.Upnp.Internal; using Mono.Upnp.Xml; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV { public class Photo : ImageItem { protected Photo () { Albums = new List (); } public Photo (string id, string parentId, PhotoOptions options) : base (id, parentId, options) { Albums = Helper.MakeReadOnlyCopy (options.Albums); } protected void CopyToOptions (PhotoOptions options) { base.CopyToOptions (options); options.Albums = new List (Albums); } public new PhotoOptions GetOptions () { var options = new PhotoOptions (); CopyToOptions (options); return options; } [XmlArrayItem ("album", Schemas.UpnpSchema)] public virtual IList Albums { get; private set; } protected override void Deserialize (XmlDeserializationContext context) { base.Deserialize (context); Albums = new ReadOnlyCollection (Albums); } protected override void DeserializeElement (XmlDeserializationContext context) { context.AutoDeserializeElement (this); } protected override void SerializeMembers (XmlSerializationContext context) { AutoSerializeMembers (this, context); } } } PlaylistContainerOptions.cs0000664000175000017500000000507011707010776047525 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV// // PlaylistContainerOptions.cs // // Author: // Yavor Georgiev // // Copyright (c) 2010 Yavor Georgiev // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System.Collections.Generic; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV { public class PlaylistContainerOptions : ContainerOptions { IEnumerable artists; IEnumerable genres; IEnumerable producers; IEnumerable contributors; IEnumerable rights; public IEnumerable Artists { get { return GetEnumerable (artists); } set { artists = value; } } public IEnumerable Genres { get { return GetEnumerable (genres); } set { genres = value; } } public IEnumerable Producers { get { return GetEnumerable (producers); } set { producers = value; } } public IEnumerable Contributors { get { return GetEnumerable (contributors); } set { contributors = value; } } public IEnumerable Rights { get { return GetEnumerable (rights); } set { rights = value; } } public virtual string LongDescription { get; set; } public virtual string StorageMedium { get; set; } public virtual string Description { get; set; } public virtual string Date { get; set; } public virtual string Language { get; set; } } } PlaylistContainer.cs0000664000175000017500000001237011707010776046152 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV// // PlaylistContainer.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using System.Collections.ObjectModel; using Mono.Upnp.Internal; using Mono.Upnp.Xml; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV { public class PlaylistContainer : Container { protected PlaylistContainer () { } public PlaylistContainer (string id, string parentId, PlaylistContainerOptions options) : base (id, parentId, options) { LongDescription = options.LongDescription; Description = options.Description; Date = options.Date; StorageMedium = options.StorageMedium; Language = options.Language; Artists = Helper.MakeReadOnlyCopy (options.Artists); Producers = Helper.MakeReadOnlyCopy (options.Producers); Contributors = Helper.MakeReadOnlyCopy (options.Contributors); Genres = Helper.MakeReadOnlyCopy (options.Genres); Rights = Helper.MakeReadOnlyCopy (options.Rights); } protected void CopyToOptions (PlaylistContainerOptions options) { base.CopyToOptions (options); options.LongDescription = LongDescription; options.Description = Description; options.Date = Date; options.StorageMedium = StorageMedium; options.Language = Language; options.Artists = new List (Artists); options.Producers = new List (Producers); options.Contributors = new List (Contributors); options.Genres = new List (Genres); options.Rights = new List (Rights); } public new PlaylistContainerOptions GetOptions () { var options = new PlaylistContainerOptions (); CopyToOptions (options); return options; } [XmlArrayItem ("artist", Schemas.UpnpSchema)] public virtual IList Artists { get; private set; } [XmlArrayItem ("genre", Schemas.UpnpSchema)] public virtual IList Genres { get; private set; } [XmlElement ("longDescription", Schemas.UpnpSchema, OmitIfNull = true)] public virtual string LongDescription { get; protected set; } [XmlArrayItem ("producer", Schemas.UpnpSchema)] public virtual IList Producers { get; private set; } [XmlElement ("storageMedium", Schemas.UpnpSchema, OmitIfNull = true)] public virtual string StorageMedium { get; protected set; } [XmlElement ("description", Schemas.DublinCoreSchema, OmitIfNull = true)] public virtual string Description { get; protected set; } [XmlArrayItem ("contributor", Schemas.DublinCoreSchema)] public virtual IList Contributors { get; private set; } [XmlElement ("date", Schemas.DublinCoreSchema, OmitIfNull = true)] public virtual string Date { get; protected set; } [XmlElement ("language", Schemas.DublinCoreSchema, OmitIfNull = true)] public virtual string Language { get; protected set; } [XmlArrayItem ("rights", Schemas.DublinCoreSchema)] public virtual IList Rights { get; private set; } protected override void Deserialize (XmlDeserializationContext context) { base.Deserialize (context); Artists = new ReadOnlyCollection (Artists); Producers = new ReadOnlyCollection (Producers); Contributors = new ReadOnlyCollection (Contributors); Genres = new ReadOnlyCollection (Genres); Rights = new ReadOnlyCollection (Rights); } protected override void DeserializeElement (XmlDeserializationContext context) { context.AutoDeserializeElement (this); } protected override void SerializeMembers (XmlSerializationContext context) { AutoSerializeMembers (this, context); } } } MusicAlbum.cs0000664000175000017500000001006211707010776044543 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV// // MusicAlbum.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using System.Collections.ObjectModel; using Mono.Upnp.Internal; using Mono.Upnp.Xml; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV { public class MusicAlbum : Album { protected MusicAlbum () { Artists = new List (); Producers = new List (); Genres = new List (); AlbumArtUris = new List (); } public MusicAlbum (string id, string parentId, MusicAlbumOptions options) : base (id, parentId, options) { Toc = options.Toc; Artists = Helper.MakeReadOnlyCopy (options.Artists); Producers = Helper.MakeReadOnlyCopy (options.Producers); Genres = Helper.MakeReadOnlyCopy (options.Genres); AlbumArtUris = Helper.MakeReadOnlyCopy (options.AlbumArtUris); } protected void CopyToOptions (MusicAlbumOptions options) { base.CopyToOptions (options); options.Toc = Toc; options.Artists = new List (Artists); options.Producers = new List (Producers); options.Genres = new List (Genres); options.AlbumArtUris = new List (AlbumArtUris); } public new MusicAlbumOptions GetOptions () { var options = new MusicAlbumOptions (); CopyToOptions (options); return options; } [XmlArrayItem ("artist", Schemas.UpnpSchema)] public virtual IList Artists { get; private set; } [XmlArrayItem ("genre", Schemas.UpnpSchema)] public virtual IList Genres { get; private set; } [XmlArrayItem ("producer", Schemas.UpnpSchema)] public virtual IList Producers { get; private set; } [XmlArrayItem ("albumArtURI", Schemas.UpnpSchema)] public virtual IList AlbumArtUris { get; private set; } [XmlElement ("toc", Schemas.UpnpSchema, OmitIfNull = true)] public virtual string Toc { get; protected set; } protected override void Deserialize (XmlDeserializationContext context) { base.Deserialize (context); Artists = new ReadOnlyCollection (Artists); Producers = new ReadOnlyCollection (Producers); Genres = new ReadOnlyCollection (Genres); AlbumArtUris = new ReadOnlyCollection (AlbumArtUris); } protected override void DeserializeElement (XmlDeserializationContext context) { context.AutoDeserializeElement (this); } protected override void SerializeMembers (XmlSerializationContext context) { AutoSerializeMembers (this, context); } } } StorageSystemOptions.cs0000664000175000017500000000257211707010776046676 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV// // StorageSystemOptions.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV { public class StorageSystemOptions : StorageVolumeOptions { public long StorageMaxPartition { get; set; } } } VideoItemOptions.cs0000664000175000017500000000522111707010776045744 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV// // VideoItemOptions.cs // // Author: // Yavor Georgiev // // Copyright (c) 2010 Yavor Georgiev // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV { public class VideoItemOptions : ItemOptions { IEnumerable genres; IEnumerable producers; IEnumerable actors; IEnumerable directors; IEnumerable publishers; IEnumerable relations; public IEnumerable Genres { get { return GetEnumerable (genres); } set { genres = value; } } public IEnumerable Producers { get { return GetEnumerable (producers); } set { producers = value; } } public IEnumerable Actors { get { return GetEnumerable (actors); } set { actors = value; } } public IEnumerable Directors { get { return GetEnumerable (directors); } set { directors = value; } } public IEnumerable Publishers { get { return GetEnumerable (publishers); } set { publishers = value; } } public IEnumerable Relations { get { return GetEnumerable (relations); } set { relations = value; } } public string LongDescription { get; set; } public string Rating { get; set; } public string Description { get; set; } public string Language { get; set; } } } AudioItem.cs0000664000175000017500000001105511707010776044365 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV// // AudioItem.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using System.Collections.ObjectModel; using Mono.Upnp.Internal; using Mono.Upnp.Xml; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV { public class AudioItem : Item { protected AudioItem () { Publishers = new List (); Genres = new List (); Relations = new List (); Rights = new List (); } public AudioItem (string id, string parentId, AudioItemOptions options) : base (id, parentId, options) { Description = options.Description; LongDescription = options.LongDescription; Language = options.Language; Publishers = Helper.MakeReadOnlyCopy (options.Publishers); Genres = Helper.MakeReadOnlyCopy (options.Genres); Relations = Helper.MakeReadOnlyCopy (options.Relations); Rights = Helper.MakeReadOnlyCopy (options.Rights); } protected void CopyToOptions (AudioItemOptions options) { base.CopyToOptions (options); options.Description = Description; options.LongDescription = LongDescription; options.Language = Language; options.Publishers = new List (Publishers); options.Genres = new List (Genres); options.Relations = new List (Relations); options.Rights = new List (Rights); } public new AudioItemOptions GetOptions () { var options = new AudioItemOptions (); CopyToOptions (options); return options; } [XmlArrayItem ("genre", Schemas.UpnpSchema)] public virtual IList Genres { get; private set; } [XmlElement ("description", Schemas.DublinCoreSchema, OmitIfNull = true)] public virtual string Description { get; protected set; } [XmlElement ("longDescription", Schemas.UpnpSchema, OmitIfNull = true)] public virtual string LongDescription { get; protected set; } [XmlArrayItem ("publisher", Schemas.DublinCoreSchema)] public virtual IList Publishers { get; private set; } [XmlElement ("language", Schemas.DublinCoreSchema, OmitIfNull = true)] public virtual string Language { get; protected set; } [XmlArrayItem ("relation", Schemas.DublinCoreSchema)] public virtual IList Relations { get; private set; } [XmlArrayItem ("rights", Schemas.DublinCoreSchema)] public virtual IList Rights { get; private set; } protected override void Deserialize (XmlDeserializationContext context) { base.Deserialize (context); Publishers = new ReadOnlyCollection (Publishers); Genres = new ReadOnlyCollection (Genres); Relations = new ReadOnlyCollection (Relations); Rights = new ReadOnlyCollection (Rights); } protected override void DeserializeElement (XmlDeserializationContext context) { context.AutoDeserializeElement (this); } protected override void SerializeMembers (XmlSerializationContext context) { AutoSerializeMembers (this, context); } } } PlaylistItemOptions.cs0000664000175000017500000000375711707010776046513 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV// // PlaylistItemOptions.cs // // Author: // Yavor Georgiev // // Copyright (c) 2010 Yavor Georgiev // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System.Collections.Generic; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV { public class PlaylistItemOptions : ItemOptions { IEnumerable artists; IEnumerable genres; public IEnumerable Artists { get { return GetEnumerable (artists); } set { artists = value; } } public IEnumerable Genres { get { return GetEnumerable (genres); } set { genres = value; } } public virtual string LongDescription { get; set; } public virtual string StorageMedium { get; set; } public virtual string Description { get; set; } public virtual string Date { get; set; } public virtual string Language { get; set; } } } MusicGenre.cs0000664000175000017500000000275611707010776044556 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV// // MusicGenre.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV { public class MusicGenre : Genre { protected MusicGenre () { } public MusicGenre (string id, string parentId, GenreOptions options) : base (id, parentId, options) { } } } AudioBookOptions.cs0000664000175000017500000000350211707010776045733 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV// // AudioBookOptions.cs // // Author: // Yavor Georgiev // // Copyright (c) 2010 Yavor Georgiev // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System.Collections.Generic; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV { public class AudioBookOptions : AudioItemOptions { IEnumerable producers; IEnumerable contributors; public IEnumerable Producers { get { return GetEnumerable (producers); } set { producers = value; } } public IEnumerable Contributors { get { return GetEnumerable (contributors); } set { contributors = value; } } public string StorageMedium { get; set; } public string Date { get; set; } } } StorageVolume.cs0000664000175000017500000000600311707010776045276 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV// // StorageVolume.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using Mono.Upnp.Xml; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV { public class StorageVolume : Container { public StorageVolume (string id, string parentId, StorageVolumeOptions options) : base (id, parentId, options) { StorageTotal = options.StorageTotal; StorageUsed = options.StorageUsed; StorageFree = options.StorageFree; StorageMedium = options.StorageMedium; } protected void CopyToOptions (StorageVolumeOptions options) { base.CopyToOptions (options); options.StorageTotal = StorageTotal; options.StorageUsed = StorageUsed; options.StorageFree = StorageFree; options.StorageMedium = StorageMedium; } public new StorageVolumeOptions GetOptions () { var options = new StorageVolumeOptions (); CopyToOptions (options); return options; } [XmlElement ("storageTotal", Schemas.UpnpSchema)] public virtual long StorageTotal { get; protected set; } [XmlElement ("storageUsed", Schemas.UpnpSchema)] public virtual long StorageUsed { get; protected set; } [XmlElement ("storageFree", Schemas.UpnpSchema)] public virtual long StorageFree { get; protected set; } [XmlElement ("storageMedium", Schemas.UpnpSchema)] public virtual string StorageMedium { get; protected set; } protected override void DeserializeElement (XmlDeserializationContext context) { context.AutoDeserializeElement (this); } protected override void SerializeMembers (XmlSerializationContext context) { AutoSerializeMembers (this, context); } } } MovieGenre.cs0000664000175000017500000000275611707010776044555 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV// // MovieGenre.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV { public class MovieGenre : Genre { protected MovieGenre () { } public MovieGenre (string id, string parentId, GenreOptions options) : base (id, parentId, options) { } } } MusicVideoClip.cs0000664000175000017500000001164111707010776045365 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV// // MusicVideoClip.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using System.Collections.ObjectModel; using Mono.Upnp.Internal; using Mono.Upnp.Xml; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV { public class MusicVideoClip : VideoItem { protected MusicVideoClip () { Artists = new List (); Albums = new List (); ScheduledStartTimes = new List (); ScheduledEndTimes = new List (); Contributors = new List (); } public MusicVideoClip (string id, string parentId, MusicVideoClipOptions options) : base (id, parentId, options) { Date = options.Date; StorageMedium = options.StorageMedium; Artists = Helper.MakeReadOnlyCopy (options.Artists); Albums = Helper.MakeReadOnlyCopy (options.Albums); ScheduledStartTimes = Helper.MakeReadOnlyCopy (options.ScheduledStartTimes); ScheduledEndTimes = Helper.MakeReadOnlyCopy (options.ScheduledEndTimes); Contributors = Helper.MakeReadOnlyCopy (options.Contributors); } protected void CopyToOptions (MusicVideoClipOptions options) { base.CopyToOptions (options); options.Date = Date; options.StorageMedium = StorageMedium; options.Artists = new List (Artists); options.Albums = new List (Albums); options.ScheduledStartTimes = new List (ScheduledStartTimes); options.ScheduledEndTimes = new List (ScheduledEndTimes); options.Contributors = new List (Contributors); } public new MusicVideoClipOptions GetOptions () { var options = new MusicVideoClipOptions (); CopyToOptions (options); return options; } [XmlArrayItem ("artist", Schemas.UpnpSchema)] public virtual IList Artists { get; private set; } [XmlElement ("storageMedium", Schemas.UpnpSchema, OmitIfNull = true)] public virtual string StorageMedium { get; protected set; } [XmlArrayItem ("album", Schemas.UpnpSchema)] public virtual IList Albums { get; private set; } [XmlArrayItem ("scheduledStartTime", Schemas.UpnpSchema)] public virtual IList ScheduledStartTimes { get; private set; } [XmlArrayItem ("scheduledEndTime", Schemas.UpnpSchema)] public virtual IList ScheduledEndTimes { get; private set; } [XmlArrayItem ("contributor", Schemas.DublinCoreSchema)] public virtual IList Contributors { get; private set; } [XmlElement ("date", Schemas.DublinCoreSchema, OmitIfNull = true)] public virtual string Date { get; protected set; } protected override void Deserialize (XmlDeserializationContext context) { base.Deserialize (context); Artists = new ReadOnlyCollection (Artists); Albums = new ReadOnlyCollection (Albums); ScheduledStartTimes = new ReadOnlyCollection (ScheduledStartTimes); ScheduledEndTimes = new ReadOnlyCollection (ScheduledEndTimes); Contributors = new ReadOnlyCollection (Contributors); } protected override void DeserializeElement (XmlDeserializationContext context) { context.AutoDeserializeElement (this); } protected override void SerializeMembers (XmlSerializationContext context) { AutoSerializeMembers (this, context); } } } StorageFolder.cs0000664000175000017500000000461711707010776045253 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV// // StorageFolder.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using Mono.Upnp.Xml; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV { public class StorageFolder : Container { protected StorageFolder () { } public StorageFolder (string id, string parentId, StorageFolderOptions options) : base (id, parentId, options) { StorageUsed = options.StorageUsed; } protected void CopyToOptions (StorageFolderOptions options) { base.CopyToOptions (options); options.StorageUsed = StorageUsed; } public new StorageFolderOptions GetOptions () { var options = new StorageFolderOptions (); CopyToOptions (options); return options; } [XmlElement ("storageUsed", Schemas.UpnpSchema)] public virtual long StorageUsed { get; protected set; } protected override void DeserializeElement (XmlDeserializationContext context) { context.AutoDeserializeElement (this); } protected override void SerializeMembers (XmlSerializationContext context) { AutoSerializeMembers (this, context); } } } Album.cs0000664000175000017500000001162611707010776043551 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV// // Album.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using System.Collections.ObjectModel; using Mono.Upnp.Internal; using Mono.Upnp.Xml; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV { public class Album : Container { protected Album () { Publishers = new List (); Contributors = new List (); Relations = new List (); Rights = new List (); } public Album (string id, string parentId, AlbumOptions options) : base (id, parentId, options) { StorageMedium = options.StorageMedium; LongDescription = options.LongDescription; Description = options.Description; Date = options.Date; Publishers = Helper.MakeReadOnlyCopy (options.Publishers); Contributors = Helper.MakeReadOnlyCopy (options.Contributors); Relations = Helper.MakeReadOnlyCopy (options.Relations); Rights = Helper.MakeReadOnlyCopy (options.Rights); } protected void CopyToOptions (AlbumOptions options) { base.CopyToOptions (options); options.StorageMedium = StorageMedium; options.LongDescription = LongDescription; options.Description = Description; options.Date = Date; options.Publishers = new List (Publishers); options.Contributors = new List (Contributors); options.Relations = new List (Relations); options.Rights = new List (Rights); } public new AlbumOptions GetOptions () { var options = new AlbumOptions (); CopyToOptions (options); return options; } [XmlElement ("storageMedium", Schemas.UpnpSchema, OmitIfNull = true)] public virtual string StorageMedium { get; protected set; } [XmlElement ("longDescription", Schemas.UpnpSchema, OmitIfNull = true)] public virtual string LongDescription { get; protected set; } [XmlElement ("description", Schemas.DublinCoreSchema, OmitIfNull = true)] public virtual string Description { get; protected set; } [XmlArrayItem ("publisher", Schemas.DublinCoreSchema)] public virtual IList Publishers { get; private set; } [XmlArrayItem ("contributor", Schemas.DublinCoreSchema)] public virtual IList Contributors { get; private set; } [XmlElement ("date", Schemas.DublinCoreSchema, OmitIfNull = true)] public virtual string Date { get; protected set; } [XmlArrayItem ("relation", Schemas.DublinCoreSchema)] public virtual IList Relations { get; private set; } [XmlArrayItem ("rights", Schemas.DublinCoreSchema)] public virtual IList Rights { get; private set; } // TODO What about this? //public Uri LyricsUri { get; private set; } protected override void Deserialize (XmlDeserializationContext context) { base.Deserialize (context); Publishers = new ReadOnlyCollection (Publishers); Contributors = new ReadOnlyCollection (Contributors); Relations = new ReadOnlyCollection (Relations); Rights = new ReadOnlyCollection (Rights); } protected override void DeserializeElement (XmlDeserializationContext context) { context.AutoDeserializeElement (this); } protected override void SerializeMembers (XmlSerializationContext context) { AutoSerializeMembers (this, context); } } } StorageFolderOptions.cs0000664000175000017500000000255611707010776046627 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV// // StorageFolderOptions.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV { public class StorageFolderOptions : ContainerOptions { public long StorageUsed { get; set; } } } TextItem.cs0000664000175000017500000001361211707010776044251 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV// // TextItem.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using System.Collections.ObjectModel; using Mono.Upnp.Internal; using Mono.Upnp.Xml; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV { public class TextItem : Item { protected TextItem () { Authors = new List (); Publishers = new List (); Contributors = new List (); Relations = new List (); Rights = new List (); } public TextItem (string id, string parentId, TextItemOptions options) : base (id, parentId, options) { Protection = options.Protection; LongDescription = options.LongDescription; Description = options.Description; StorageMedium = options.StorageMedium; Rating = options.Rating; Date = options.Date; Language = options.Language; Authors = Helper.MakeReadOnlyCopy (options.Authors); Publishers = Helper.MakeReadOnlyCopy (options.Publishers); Contributors = Helper.MakeReadOnlyCopy (options.Contributors); Relations = Helper.MakeReadOnlyCopy (options.Relations); Rights = Helper.MakeReadOnlyCopy (options.Rights); } protected void CopyToOptions (TextItemOptions options) { base.CopyToOptions (options); options.Protection = Protection; options.LongDescription = LongDescription; options.Description = Description; options.StorageMedium = StorageMedium; options.Rating = Rating; options.Date = Date; options.Language = Language; options.Authors = new List (Authors); options.Publishers = new List (Publishers); options.Contributors = new List (Contributors); options.Relations = new List (Relations); options.Rights = new List (Rights); } public new TextItemOptions GetOptions () { var options = new TextItemOptions (); CopyToOptions (options); return options; } [XmlArrayItemAttribute ("author", Schemas.UpnpSchema)] public virtual IList Authors { get; private set; } [XmlElement ("protection", Schemas.UpnpSchema, OmitIfNull = true)] public virtual string Protection { get; protected set; } [XmlElement ("longDescription", Schemas.UpnpSchema, OmitIfNull = true)] public virtual string LongDescription { get; protected set; } [XmlElement ("storageMedium", Schemas.UpnpSchema, OmitIfNull = true)] public virtual string StorageMedium { get; protected set; } [XmlElement ("rating", Schemas.UpnpSchema, OmitIfNull = true)] public virtual string Rating { get; protected set; } [XmlElement ("description", Schemas.DublinCoreSchema, OmitIfNull = true)] public virtual string Description { get; protected set; } [XmlArrayItem ("publisher", Schemas.DublinCoreSchema)] public virtual IList Publishers { get; private set; } [XmlArrayItem ("contributor", Schemas.DublinCoreSchema)] public virtual IList Contributors { get; private set; } [XmlElement ("date", Schemas.DublinCoreSchema, OmitIfNull = true)] public virtual string Date { get; protected set; } [XmlArrayItem ("relation", Schemas.DublinCoreSchema)] public virtual IList Relations { get; private set; } [XmlElement ("language", Schemas.DublinCoreSchema, OmitIfNull = true)] public virtual string Language { get; protected set; } [XmlArrayItem ("rights", Schemas.DublinCoreSchema)] public virtual IList Rights { get; private set; } protected override void Deserialize (XmlDeserializationContext context) { base.Deserialize (context); Authors = new ReadOnlyCollection (Authors); Publishers = new ReadOnlyCollection (Publishers); Contributors = new ReadOnlyCollection (Contributors); Relations = new ReadOnlyCollection (Relations); Rights = new ReadOnlyCollection (Rights); } protected override void DeserializeElement (XmlDeserializationContext context) { context.AutoDeserializeElement (this); } protected override void SerializeMembers (XmlSerializationContext context) { AutoSerializeMembers (this, context); } } } VideoBroadcastOptions.cs0000664000175000017500000000272311707010776046754 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV// // VideoBroadcastOptions.cs // // Author: // Yavor Georgiev // // Copyright (c) 2010 Yavor Georgiev // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV { public class VideoBroadcastOptions : VideoItemOptions { public Uri Icon { get; set; } public string Region { get; set; } public int? ChannelNr { get; set; } } } AudioBroadcastOptions.cs0000664000175000017500000000306311707010776046745 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV// // AudioBroadcastOptions.cs // // Author: // Yavor Georgiev // // Copyright (c) 2010 Yavor Georgiev // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV { public class AudioBroadcastOptions : AudioItemOptions { public string Region { get; set; } public string RadioCallSign { get; set; } public string RadioStationId { get; set; } public string RadioBand { get; set; } public int? ChannelNr { get; set; } } } MusicArtistOptions.cs0000664000175000017500000000312511707010776046327 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV// // MusicArtistOptions.cs // // Author: // Yavor Georgiev // // Copyright (c) 2010 Yavor Georgiev // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV { public class MusicArtistOptions : PersonOptions { IEnumerable genres; public IEnumerable Genres { get { return GetEnumerable (genres); } set { genres = value; } } public Uri ArtistDiscographyUri { get; set; } } } PlaylistItem.cs0000664000175000017500000001033711707010776045127 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV// // PlaylistItem.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using System.Collections.ObjectModel; using Mono.Upnp.Internal; using Mono.Upnp.Xml; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV { public class PlaylistItem : Item { protected PlaylistItem () { } public PlaylistItem (string id, string parentId, PlaylistItemOptions options) : base (id, parentId, options) { LongDescription = options.LongDescription; StorageMedium = options.StorageMedium; Description = options.Description; Date = options.Date; Language = options.Language; Artists = Helper.MakeReadOnlyCopy (options.Artists); Genres = Helper.MakeReadOnlyCopy (options.Genres); } protected void CopyToOptions (PlaylistItemOptions options) { base.CopyToOptions (options); options.LongDescription = LongDescription; options.StorageMedium = StorageMedium; options.Description = Description; options.Date = Date; options.Language = Language; options.Artists = new List (Artists); options.Genres = new List (Genres); } public new PlaylistItemOptions GetOptions () { var options = new PlaylistItemOptions (); CopyToOptions (options); return options; } [XmlArrayItem ("artist", Schemas.UpnpSchema)] public virtual IList Artists { get; private set; } [XmlArrayItem ("genre", Schemas.UpnpSchema)] public virtual IList Genres { get; private set; } [XmlElement ("longDescription", Schemas.UpnpSchema, OmitIfNull = true)] public virtual string LongDescription { get; protected set; } [XmlElement ("storageMedium", Schemas.UpnpSchema, OmitIfNull = true)] public virtual string StorageMedium { get; protected set; } [XmlElement ("description", Schemas.DublinCoreSchema, OmitIfNull = true)] public virtual string Description { get; protected set; } [XmlElement ("date", Schemas.DublinCoreSchema, OmitIfNull = true)] public virtual string Date { get; protected set; } [XmlElement ("language", Schemas.DublinCoreSchema, OmitIfNull = true)] public virtual string Language { get; protected set; } protected override void Deserialize (XmlDeserializationContext context) { base.Deserialize (context); Artists = new ReadOnlyCollection (Artists); Genres = new ReadOnlyCollection (Genres); } protected override void DeserializeElement (XmlDeserializationContext context) { context.AutoDeserializeElement (this); } protected override void SerializeMembers (XmlSerializationContext context) { AutoSerializeMembers (this, context); } } } Mono.Upnp.Dcp.MediaServer1/0000775000175000017500000000000011707010776036270 5ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1TransferStatus.cs0000664000175000017500000000035711707010776041614 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1// TransferStatus.cs auto-generated at 1/17/2009 8:08:36 PM by Sharpener namespace Mono.Upnp.Dcp.MediaServer1 { public enum TransferStatus { COMPLETED, ERROR, IN_PROGRESS, STOPPED } }DiscoveryEventArgs.cs0000664000175000017500000000061611707010776042410 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1// ConnectionManager1.cs auto-generated at 1/17/2009 8:30:43 PM by Sharpener using System; namespace Mono.Upnp.Dcp.MediaServer1 { public class DiscoveryEventArgs : EventArgs { readonly T item; internal DiscoveryEventArgs (T item) { this.item = item; } public T Item { get { return item; } } } }MediaServer.cs0000664000175000017500000001102411707010776041023 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1// // MediaServer.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using Mono.Upnp.Dcp.MediaServer1.ConnectionManager1; using Mono.Upnp.Dcp.MediaServer1.ContentDirectory1; namespace Mono.Upnp.Dcp.MediaServer1 { public class MediaServer : IDisposable { public static readonly DeviceType DeviceType = new DeviceType ("schemas-upnp-org", "MediaServer", new Version (1, 0)); Server server; readonly LocalContentDirectory content_directory; public MediaServer (string udn, string friendlyName, string manufacturer, string modelName, ConnectionManager connectionManager, LocalContentDirectory contentDirectory) : this (udn, friendlyName, manufacturer, modelName, null, connectionManager, contentDirectory) { } public MediaServer (string udn, string friendlyName, string manufacturer, string modelName, DeviceOptions options, ConnectionManager connectionManager, LocalContentDirectory contentDirectory) { if (connectionManager == null) throw new ArgumentNullException ("connnectionManager"); if (contentDirectory == null) throw new ArgumentNullException ("contentDirectory"); if (options == null) { options = new DeviceOptions (); } this.content_directory = contentDirectory; var connectionManagerService = new Service (ConnectionManager.ServiceType, "urn:upnp-org:serviceId:ConnectionManager", connectionManager); var contentDirectoryService = new Service (ContentDirectory.ServiceType, "urn:upnp-org:serviceId:ContentDirectory", contentDirectory); options.Services = Combine (new Service[] { connectionManagerService, contentDirectoryService }, options.Services); server = new Server (new Root (DeviceType, udn, friendlyName, manufacturer, modelName, options)); } public bool IsDisposed { get { return server == null; } } public void Start () { CheckDisposed (); content_directory.Start (); server.Start (); } public void Stop () { CheckDisposed (); server.Stop (); content_directory.Stop (); } public void Dispose () { Dispose (true); GC.SuppressFinalize (this); } protected virtual void Dispose (bool disposing) { if (IsDisposed) { return; } if (disposing) { server.Dispose (); content_directory.Dispose (); } server = null; } void CheckDisposed () { if (IsDisposed) { throw new ObjectDisposedException (ToString ()); } } IEnumerable Combine (IEnumerable first, IEnumerable second) { foreach (var service in first) { yield return service; } if (second != null) { foreach (var service in second) { yield return service; } } } } } mono.upnp.dcp.mediaserver1.pc.in0000664000175000017500000000041111761736703037462 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1assemblies_dir=@expanded_libdir@/@PACKAGE@ Libraries=${assemblies_dir}/Mono.Upnp.Dcp.MediaServer1.dll Name: Mono.Upnp.Dcp.MediaServer1 Description: Mono.Upnp.Dcp.MediaServer1 Version: @VERSION@ Requires: Libs: -r:${assemblies_dir}/Mono.Upnp.Dcp.MediaServer1.dll Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/0000775000175000017500000000000011733142461041643 5ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1ContainerOptions.cs0000664000175000017500000000356411707010776045504 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1// // ContainerOptions.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System.Collections.Generic; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1 { public class ContainerOptions : ObjectOptions { IEnumerable search_classes; IEnumerable create_classes; public IEnumerable SearchClasses { get { return GetEnumerable (search_classes); } set { search_classes = value; } } public IEnumerable CreateClasses { get { return GetEnumerable (create_classes); } set { create_classes = value; } } public int? ChildCount { get; set; } public bool IsSearchable { get; set; } } } Object.cs0000664000175000017500000001227411707010776043412 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1// // Object.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using System.Collections.ObjectModel; using Mono.Upnp.Internal; using Mono.Upnp.Xml; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1 { public class Object : XmlAutomatable { protected Object () { Resources = new List (); } public Object (string id, string parentId, ObjectOptions options) { if (id == null) { throw new ArgumentNullException ("id"); } else if (parentId == null) { throw new ArgumentNullException ("parentId"); } else if (options == null) { throw new ArgumentNullException ("options"); } Id = id; ParentId = parentId; Title = options.Title; Creator = options.Creator; WriteStatus = options.WriteStatus; IsRestricted = options.IsRestricted; Resources = Helper.MakeReadOnlyCopy (options.Resources); Class = new Class (ClassManager.GetClassNameFromType (GetType ())); } protected void CopyToOptions (ObjectOptions options) { if (options == null) { throw new ArgumentNullException ("options"); } options.Title = Title; options.Creator = Creator; options.WriteStatus = WriteStatus; options.IsRestricted = IsRestricted; options.Resources = new List (Resources); } public ObjectOptions GetOptions () { var options = new ObjectOptions (); CopyToOptions (options); return options; } [XmlElement ("class", Schemas.UpnpSchema)] public virtual Class Class { get; protected set; } [XmlElement ("title", Schemas.DublinCoreSchema)] public virtual string Title { get; protected set; } [XmlElement ("creator", Schemas.DublinCoreSchema, OmitIfNull = true)] public virtual string Creator { get; protected set; } [XmlElement ("writeStatus", Schemas.UpnpSchema, OmitIfNull = true)] public virtual WriteStatus? WriteStatus { get; protected set; } [XmlAttribute ("id")] public virtual string Id { get; protected set; } [XmlAttribute ("parentID")] public virtual string ParentId { get; protected set; } [XmlAttribute ("restricted")] protected virtual string Restricted { get { return IsRestricted ? "true" : "false"; } set { IsRestricted = value == "true"; } } public bool IsRestricted { get; protected set; } [XmlArrayItem] public virtual IList Resources { get; private set; } public override string ToString () { if (Class == null) { return Id; } else { return string.Format("{0} ({1})", Id, Class.FullClassName); } } protected override void Deserialize (XmlDeserializationContext context) { base.Deserialize (context); Resources = new ReadOnlyCollection (Resources); } protected override void DeserializeAttribute (XmlDeserializationContext context) { context.AutoDeserializeAttribute (this); } protected override void DeserializeElement (XmlDeserializationContext context) { context.AutoDeserializeElement (this); } protected override void Serialize (XmlSerializationContext context) { AutoSerialize (this, context); } protected override void SerializeMembers (XmlSerializationContext context) { AutoSerializeMembers (this, context); } } } ObjectOptions.cs0000664000175000017500000000371311707010776044764 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1// // ObjectOptions.cs // // Author: // Yavor Georgiev // // Copyright (c) 2010 Yavor Georgiev // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System.Collections.Generic; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1 { public class ObjectOptions { IEnumerable resources; public IEnumerable Resources { get { return GetEnumerable (resources); } set { resources = value; } } public string Title { get; set; } public string Creator { get; set; } public WriteStatus? WriteStatus { get; set; } public bool IsRestricted { get; set; } internal static IEnumerable GetEnumerable (IEnumerable enumerable) { return enumerable ?? GetEmptyEnumerable (); } static IEnumerable GetEmptyEnumerable () { yield break; } } } Query.cs0000664000175000017500000000623411707010776043310 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1// // Query.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1 { #pragma warning disable 0660, 0661 public class Query { readonly string name; public Query (string name) { this.name = name; } public Action Contains (string value) { return visitor => visitor.VisitContains (name, value); } public Action DoesNotContain (string value) { return visitor => visitor.VisitDoesNotContain (name, value); } public Action DerivedFrom (string value) { return visitor => visitor.VisitDerivedFrom (name, value); } public Action Exists (bool value) { return visitor => visitor.VisitExists (name, value); } public static Action operator == (Query property, string value) { return visitor => visitor.VisitEquals (property.name, value); } public static Action operator != (Query property, string value) { return visitor => visitor.VisitDoesNotEqual (property.name, value); } public static Action operator < (Query property, string value) { return visitor => visitor.VisitLessThan (property.name, value); } public static Action operator <= (Query property, string value) { return visitor => visitor.VisitLessThanOrEqualTo (property.name, value); } public static Action operator > (Query property, string value) { return visitor => visitor.VisitGreaterThan (property.name, value); } public static Action operator >= (Query property, string value) { return visitor => visitor.VisitGreaterThanOrEqualTo (property.name, value); } } #pragma warning restore 0661, 0660 } ObjectQueryContext.cs0000664000175000017500000002642611707010776046011 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1// // ObjectQueryProvider.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections; using System.Collections.Generic; using System.Reflection; using Mono.Upnp.Dcp.MediaServer1.Xml; using Mono.Upnp.Xml; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1 { public class ObjectQueryContext { static readonly object[] empty_args = new object[0]; readonly ObjectQueryContext parentContext; Dictionary properties = new Dictionary (); public ObjectQueryContext (Type type) : this (type, null) { } public ObjectQueryContext (Type type, ObjectQueryContext parentContext) { if (type == null) { throw new ArgumentNullException ("type"); } this.parentContext = parentContext; foreach (var property_info in GetProperties (type, BindingFlags.DeclaredOnly)) { foreach (var attribute in property_info.GetCustomAttributes (false)) { if (ProcessElementAttribute (property_info, attribute as XmlElementAttribute)) { break; } else if (ProcessAttributeAttribute (property_info, attribute as XmlAttributeAttribute)) { break; } else if (ProcessArrayItemAttribute (property_info, attribute as XmlArrayItemAttribute)) { break; } } } } bool ProcessElementAttribute (PropertyInfo propertyInfo, XmlElementAttribute attribute) { if (attribute != null) { var name = string.IsNullOrEmpty (attribute.Name) ? propertyInfo.Name : attribute.Name; var id = PropertyName.CreateForElement (name, attribute.Prefix); var property = new ValuePropertyVisitor (attribute.OmitIfNull, propertyInfo); ProcessNestedAttributes (id, property); properties[id] = property; return true; } else { return false; } } bool ProcessAttributeAttribute (PropertyInfo propertyInfo, XmlAttributeAttribute attribute) { if (attribute != null) { var name = string.IsNullOrEmpty (attribute.Name) ? propertyInfo.Name : attribute.Name; var id = PropertyName.CreateForAttribute (name, attribute.Prefix, null); properties[id] = new ValuePropertyVisitor (attribute.OmitIfNull, propertyInfo); return true; } else { return false; } } bool ProcessArrayItemAttribute (PropertyInfo propertyInfo, XmlArrayItemAttribute attribute) { if (attribute != null) { var name = string.IsNullOrEmpty (attribute.Name) ? propertyInfo.Name : attribute.Name; var id = PropertyName.CreateForElement (name, attribute.Prefix); var property = new EnumerationPropertyVisitor (propertyInfo); ProcessNestedAttributes (id, property); properties[id] = property; return true; } else { return false; } } void ProcessNestedAttributes (string nestedName, PropertyVisitor parentProperty) { foreach (var propertyInfo in GetProperties (parentProperty.PropertyInfo.PropertyType, 0)) { var attributes = propertyInfo.GetCustomAttributes (typeof (XmlAttributeAttribute), false); if (attributes.Length != 0) { var attribute_attribute = (XmlAttributeAttribute)attributes[0]; var name = string.IsNullOrEmpty (attribute_attribute.Name) ? propertyInfo.Name : attribute_attribute.Name; var id = PropertyName.CreateForAttribute (name, attribute_attribute.Prefix, nestedName); properties[id] = new NestedValuePropertyVisitor ( parentProperty, attribute_attribute.OmitIfNull, propertyInfo); } } } public void VisitProperty (string property, object @object, Action consumer) { PropertyVisitor property_visitor; if (properties.TryGetValue (property, out property_visitor)) { property_visitor.Visit (@object, value => consumer (value)); } else if (parentContext != null) { parentContext.VisitProperty (property, @object, consumer); } } public void CompareProperty (string property, object @object, string value, Action consumer) { PropertyVisitor property_visitor; if (properties.TryGetValue (property, out property_visitor)) { property_visitor.Visit (@object, val => { if (property_visitor.ParseMethod != null) { var parsed_value = property_visitor.ParseMethod.Invoke (null, new[] { value }); consumer (((IComparable)val).CompareTo (parsed_value)); } else { // TODO throw? } }); } else if (parentContext != null) { parentContext.CompareProperty (property, @object, value, consumer); } } public bool PropertyExists (string property, object @object) { PropertyVisitor property_visitor; if (properties.TryGetValue (property, out property_visitor)) { return property_visitor.Exists (@object); } else if (parentContext != null) { return parentContext.PropertyExists (property, @object); } else { return false; } } static IEnumerable GetProperties (Type type, BindingFlags flags) { foreach (var property in type.GetProperties (flags | BindingFlags.Instance | BindingFlags.Public)) { yield return property; } foreach (var property in type.GetProperties (flags | BindingFlags.Instance | BindingFlags.NonPublic)) { yield return property; } } abstract class PropertyVisitor { public readonly PropertyInfo PropertyInfo; public readonly MethodInfo ParseMethod; protected PropertyVisitor (PropertyInfo propertyInfo) { this.PropertyInfo = propertyInfo; var property_type = propertyInfo.PropertyType; var ienumerable = property_type.GetInterface ("IEnumerable`1"); if (ienumerable != null) { property_type = ienumerable.GetGenericArguments ()[0]; } else if (property_type.IsGenericType) { var generic_type = property_type.GetGenericTypeDefinition (); if (generic_type == typeof (Nullable<>) || generic_type == typeof (IEnumerable<>)) { property_type = property_type.GetGenericArguments ()[0]; } } if (typeof (IComparable).IsAssignableFrom (property_type)) { this.ParseMethod = property_type.GetMethod ( "Parse", BindingFlags.Public | BindingFlags.Static, null, new[] { typeof (string) }, null); } } public abstract void Visit (object @object, Action consumer); public abstract bool Exists (object @object); } class ValuePropertyVisitor : PropertyVisitor { protected readonly bool omit_if_null; public ValuePropertyVisitor (bool omitIfNull, PropertyInfo propertyInfo) : base (propertyInfo) { this.omit_if_null = omitIfNull; } public override void Visit (object @object, Action consumer) { var value = PropertyInfo.GetValue (@object, empty_args); if (value != null || !omit_if_null) { consumer (value); } } public override bool Exists (object @object) { if (!omit_if_null) { return true; } else { return PropertyInfo.GetValue (@object, empty_args) != null; } } } class NestedValuePropertyVisitor : ValuePropertyVisitor { readonly PropertyVisitor parent_property_visitor; public NestedValuePropertyVisitor (PropertyVisitor parentPropertyVisitor, bool omitIfNull, PropertyInfo propertyInfo) : base (omitIfNull, propertyInfo) { this.parent_property_visitor = parentPropertyVisitor; } public override void Visit (object @object, Action consumer) { parent_property_visitor.Visit (@object, value => base.Visit (value, v => consumer (v))); } public override bool Exists (object @object) { var exists = false; parent_property_visitor.Visit (@object, value => exists = base.Exists (value)); return exists; } } class EnumerationPropertyVisitor : PropertyVisitor { public EnumerationPropertyVisitor (PropertyInfo propertyInfo) : base (propertyInfo) { } public override void Visit (object @object, Action consumer) { foreach (var value in (IEnumerable)PropertyInfo.GetValue (@object, empty_args)) { consumer(value); } } public override bool Exists (object @object) { var enumerable = (IEnumerable)PropertyInfo.GetValue (@object, empty_args); return enumerable != null && enumerable.GetEnumerator ().MoveNext (); } } } } RemoteContentDirectory.cs0000664000175000017500000001667311707010776046666 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1// // RemoteContentDirectory.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using System.IO; using System.Reflection; using System.Text; using System.Xml; using Mono.Upnp.Dcp.MediaServer1.Internal; using Mono.Upnp.Internal; using Mono.Upnp.Xml; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1 { public class RemoteContentDirectory { ContentDirectoryController controller; XmlDeserializer deserializer; MethodInfo deserialize_method; public RemoteContentDirectory (ContentDirectoryController controller) : this (controller, null) { } public RemoteContentDirectory (ContentDirectoryController controller, XmlDeserializer deserializer) { if (controller == null) { throw new ArgumentNullException ("controller"); } this.controller = controller; this.deserializer = deserializer ?? new XmlDeserializer (); this.deserialize_method = this.deserializer.GetType ().GetMethod ( "Deserialize", new Type[] { typeof (XmlReader) }); } public Container GetRootObject () { return GetObject ("0"); } public T GetObject (string id) { uint returned, total, update_id; var xml = controller.Browse ( id, BrowseFlag.BrowseMetadata, "*", 0, 1, "", out returned, out total, out update_id); foreach (var result in Deserialize (xml)) { return result; } return default (T); } public Results GetChildren (Container container) { return GetChildren (container, new ResultsSettings ()); } public Results GetChildren (Container container, ResultsSettings settings) { if (container == null) { throw new ArgumentNullException ("container"); } uint returned, total, update_id; var xml = controller.Browse (container.Id, BrowseFlag.BrowseDirectChildren, settings.Filter, settings.Offset, settings.RequestCount, settings.SortCriteria, out returned, out total, out update_id); var results = new List ((int)returned); foreach (var result in Deserialize (xml)) { results.Add (result); } return new BrowseResults (container, settings.SortCriteria, settings.Filter, settings.RequestCount, settings.Offset, total, results); } public Results Search (Container container, Action query, ResultsSettings settings) { if (container == null) { throw new ArgumentNullException ("container"); } else if (query == null) { throw new ArgumentNullException ("query"); } var builder = new StringBuilder (); query (new QueryStringifier (builder)); var search_criteria = builder.ToString (); uint returned, total, update_id; var xml = controller.Search (container.Id, search_criteria, settings.Filter, settings.Offset, settings.RequestCount, settings.SortCriteria, out returned, out total, out update_id); var results = new List ((int)returned); foreach (var result in Deserialize (xml)) { results.Add (result); } return new SearchResults (container, query, settings.SortCriteria, settings.Filter, settings.RequestCount, settings.Offset, total, results); } protected virtual IEnumerable Deserialize (string xml) { var types = new List (); foreach (var @object in Deserialize (xml, Deserializers ())) { types.Add (ClassManager.GetTypeFromClassName (@object.Class.FullClassName)); } return Deserialize (xml, Deserializers (types)); } IEnumerable> Deserializers () { while (true) { yield return reader => deserializer.Deserialize (reader); } } IEnumerable> Deserializers (IEnumerable types) { foreach (var type in types) { var method = deserialize_method.MakeGenericMethod (type); yield return reader => (T)method.Invoke (deserializer, new object[] { reader }); } } IEnumerable Deserialize (string xml, IEnumerable> deserializers) { var enumerator = deserializers.GetEnumerator (); using (var reader = XmlReader.Create (new StringReader (xml))) { if (reader.MoveToContent () != XmlNodeType.Element) { throw new DeserializationException ("Unable to read XML content"); } if (reader.LocalName != "DIDL-Lite" && !reader.ReadToFollowing ("DIDL-Lite")) { throw new DeserializationException ("There is no DIDL-Lite element."); } if (!reader.Read ()) { throw new DeserializationException ("The DIDL-Lite element has no proper children."); } while (reader.NodeType != XmlNodeType.Element) { if (!reader.Read ()) { throw new DeserializationException ("The DIDL-Lite element has no proper children."); } } while (reader.NodeType == XmlNodeType.Element) { using (var subtree = reader.ReadSubtree ()) { subtree.Read (); if (!enumerator.MoveNext ()) { throw new ArgumentNullException ("types", "The enumeration of deserializers must have" + " as many elements are there are objects in the XML."); } yield return enumerator.Current (subtree); } if (!reader.ReadToNextSibling (reader.LocalName)) { } } } } } } ResourceOptions.cs0000664000175000017500000000363111707010776045344 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1// // ResourceOptions.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using Mono.Upnp.Dcp.MediaServer1.ConnectionManager1; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1 { public class ResourceOptions { public ulong? Size { get; set; } public TimeSpan? Duration { get; set; } public uint? BitRate { get; set; } public uint? SampleFrequency { get; set; } public uint? BitsPerSample { get; set; } public uint? NrAudioChannels { get; set; } public Resolution? Resolution { get; set; } public uint? ColorDepth { get; set; } public ProtocolInfo ProtocolInfo { get; set; } public string Protection { get; set; } public Uri ImportUri { get; set; } } } DeserializationException.cs0000664000175000017500000000317311707010776047207 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1// // UpnpDeserializationException.cs // // Author: // Scott Peterson // // Copyright (C) 2008 S&S Black Ltd. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1 { public class DeserializationException : Exception { public DeserializationException (string message) : base (message) { } public DeserializationException (string message, Exception innerException) : base (message, innerException) { } } } WriteStatus.cs0000664000175000017500000000305111707010776044473 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1// // WriteStatus.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE.  using Mono.Upnp.Xml; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1 { public enum WriteStatus { [XmlEnum ("WRITABLE")] Writeable, [XmlEnum ("PROTECTED")] Protected, [XmlEnum ("NOT_WRITABLE")] NotWritable, [XmlEnum ("UNKNOWN")] Unknown, [XmlEnum ("MIXED")] Mixed } } ClassManager.cs0000664000175000017500000001235411707010776044543 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1// // ClassManager.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using System.Reflection; using System.Text; using Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1 { public static class ClassManager { readonly static Dictionary types; readonly static Dictionary names; static ClassManager () { types = new Dictionary (); names = new Dictionary (); RegisterType (); RegisterType (); RegisterType (); RegisterType (); RegisterType (); RegisterType (); RegisterType (); RegisterType (); RegisterType (); RegisterType (); RegisterType (); RegisterType (); RegisterType (); RegisterType (); RegisterType (); RegisterType (); RegisterType (); RegisterType (); RegisterType (); RegisterType (); RegisterType (); RegisterType (); RegisterType (); RegisterType (); RegisterType (); RegisterType (); RegisterType (); } public static void RegisterType () where T : Object { var type = typeof (T); var name = GetClassNameFromTypeCore (type); types[name] = type; } public static string GetClassNameFromType () where T : Object { return GetClassNameFromTypeCore (typeof (T)); } public static string GetClassNameFromType (Type type) { if (type == null) throw new ArgumentNullException ("type"); if (!typeof (Object).IsAssignableFrom (type)) throw new ArgumentException ("The type does not inherit from Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.Object."); return GetClassNameFromTypeCore (type); } static string GetClassNameFromTypeCore (Type type) { string name; if (!names.TryGetValue (type, out name)) { name = CreateClassName (type, typeof (Object)); names[type] = name; } return name; } public static Type GetTypeFromClassName (string @class) { while (!types.ContainsKey (@class)) { var dot = @class.LastIndexOf ('.'); if (dot == -1) { return null; } @class = @class.Substring (0, dot); } return types[@class]; } static string CreateClassName (Type type, Type rootType) { var builder = new StringBuilder (); BuildClassName (type, rootType, builder); return builder.ToString (); } static void BuildClassName (Type type, Type rootType, StringBuilder builder) { if (type != rootType) { BuildClassName (type.BaseType, rootType, builder); builder.Append ('.'); } foreach (var attribute in type.GetCustomAttributes (false)) { var class_name = attribute as ClassNameAttribute; if (class_name != null) { builder.Append (class_name.ClassName); return; } } builder.Append (char.ToLower (type.Name [0])); for (var i = 1; i < type.Name.Length; i++) { builder.Append (type.Name[i]); } } } } Resolution.cs0000664000175000017500000000603211707010776044342 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1// // Resolution.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1 { public struct Resolution : IEquatable { readonly uint x; readonly uint y; public Resolution (uint x, uint y) { this.x = x; this.y = y; } public uint X { get { return x; } } public uint Y { get { return y; } } public override string ToString () { return string.Format("{0}x{1}", x, y); } public override int GetHashCode () { return x.GetHashCode () ^ y.GetHashCode (); } public override bool Equals (object obj) { return (obj is Resolution) && Equals ((Resolution)obj); } public bool Equals (Resolution resolution) { return this == resolution; } public static bool operator == (Resolution resolution1, Resolution resolution2) { return resolution1.x == resolution2.x && resolution1.y == resolution2.y; } public static bool operator != (Resolution resolution1, Resolution resolution2) { return resolution1.x != resolution2.x || resolution1.y != resolution2.y; } internal static bool TryParse (string s, out Resolution result) { if (s != null) { var index = s.IndexOf ('x'); if (index > -1) { uint x, y; if (uint.TryParse (s.Substring (0, index), out x) && uint.TryParse (s.Substring (index + 1), out y)) { result = new Resolution (x, y); return true; } } } result = new Resolution (0, 0); return false; } } } ContentDirectoryController.cs0000664000175000017500000002734711707010776047556 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1// ContentDirectoryController.cs auto-generated at 1/18/2009 9:31:12 PM by Sharpener using System; using System.Collections.Generic; using Mono.Upnp; using Mono.Upnp.Control; using Mono.Upnp.Dcp.MediaServer1.Internal; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1 { public class ContentDirectoryController { readonly ServiceController controller; public ContentDirectoryController (ServiceController controller) { if (controller == null) throw new ArgumentNullException ("controller"); this.controller = controller; } public ServiceController ServiceController { get { return controller; } } public string GetSearchCapabilities () { var action_result = controller.Actions["GetSearchCapabilities"].Invoke (2); return action_result["SearchCaps"]; } public string GetSortCapabilities () { var action_result = controller.Actions["GetSortCapabilities"].Invoke (2); return action_result["SortCaps"]; } public string GetSystemUpdateId () { var action_result = controller.Actions["GetSystemUpdateID"].Invoke (2); return action_result["Id"]; } public string Browse (string objectId, BrowseFlag browseFlag, string filter, uint startingIndex, uint requestedCount, string sortCriteria, out uint numberReturned, out uint totalMatches, out uint updateId) { if (browseFlag < BrowseFlag.BrowseMetadata || browseFlag > BrowseFlag.BrowseDirectChildren) throw new ArgumentOutOfRangeException ("browseFlag"); var in_arguments = new Arguments ( "ObjectID", objectId, "BrowseFlag", browseFlag.ToString (), "Filter", filter, "StartingIndex", startingIndex.ToString (), "RequestedCount", requestedCount.ToString (), "SortCriteria", sortCriteria); var action_result = controller.Actions["Browse"].Invoke (in_arguments, 2); numberReturned = uint.Parse (action_result["NumberReturned"]); totalMatches = uint.Parse (action_result["TotalMatches"]); updateId = uint.Parse (action_result["UpdateID"]); return action_result["Result"]; } public bool CanSearch { get { return controller.Actions.ContainsKey ("Search"); } } public string Search (string containerId, string searchCriteria, string filter, uint startingIndex, uint requestedCount, string sortCriteria, out uint numberReturned, out uint totalMatches, out uint updateId) { if (!CanSearch) throw new NotImplementedException (); var in_arguments = new Arguments ( "ContainerID", containerId, "SearchCriteria", searchCriteria, "Filter", filter, "StartingIndex", startingIndex.ToString (), "RequestedCount", requestedCount.ToString (), "SortCriteria", sortCriteria); var action_result = controller.Actions["Search"].Invoke (in_arguments, 2); numberReturned = uint.Parse (action_result["NumberReturned"]); totalMatches = uint.Parse (action_result["TotalMatches"]); updateId = uint.Parse (action_result["UpdateID"]); return action_result["Result"]; } public bool CanCreateObject { get { return controller.Actions.ContainsKey ("CreateObject"); } } public string CreateObject (string containerId, string elements) { if (!CanCreateObject) throw new NotImplementedException (); var in_arguments = new Arguments ( "ContainerID", containerId, "Elements", elements); var action_result = controller.Actions["CreateObject"].Invoke (in_arguments); return action_result["Result"]; } public bool CanDestroyObject { get { return controller.Actions.ContainsKey ("DestroyObject"); } } public void DestroyObject (string objectId) { if (!CanDestroyObject) throw new NotImplementedException (); var in_arguments = new Arguments ("ObjectID", objectId); controller.Actions["DestroyObject"].Invoke (in_arguments); } public bool CanUpdateObject { get { return controller.Actions.ContainsKey ("UpdateObject"); } } public void UpdateObject (string objectId, string currentTagValue, string newTagValue) { if (!CanUpdateObject) throw new NotImplementedException (); var in_arguments = new Arguments ( "ObjectID", objectId, "CurrentTagValue", currentTagValue, "NewTagValue", newTagValue); controller.Actions["UpdateObject"].Invoke (in_arguments); } public bool CanImportResource { get { return controller.Actions.ContainsKey ("ImportResource"); } } public string ImportResource (Uri sourceUri, Uri destinationUri) { if (!CanImportResource) throw new NotImplementedException (); var in_arguments = new Arguments ( "SourceURI", sourceUri.ToString (), "DestinationURI", destinationUri.ToString ()); var action_result = controller.Actions["ImportResource"].Invoke (in_arguments); return action_result["TransferID"]; } public bool CanExportResource { get { return controller.Actions.ContainsKey ("ExportResource"); } } public string ExportResource (Uri sourceUri, Uri destinationUri) { if (!CanExportResource) throw new NotImplementedException (); var in_arguments = new Arguments ( "SourceURI", sourceUri.ToString (), "DestinationURI", destinationUri.ToString ()); var action_result = controller.Actions["ExportResource"].Invoke (in_arguments); return action_result["TransferID"]; } public bool CanStopTransferResource { get { return controller.Actions.ContainsKey ("StopTransferResource"); } } public void StopTransferResource (uint transferId) { if (!CanStopTransferResource) throw new NotImplementedException (); var in_arguments = new Arguments ("TransferID", transferId.ToString ()); controller.Actions["StopTransferResource"].Invoke (in_arguments); } public bool CanGetTransferProgress { get { return controller.Actions.ContainsKey ("GetTransferProgress"); } } public void GetTransferProgress (uint transferId, out string transferStatus, out string transferLength, out string transferTotal) { if (!CanGetTransferProgress) throw new NotImplementedException (); var in_arguments = new Arguments ("TransferID", transferId.ToString ()); var action_result = controller.Actions["GetTransferProgress"].Invoke (in_arguments); transferStatus = action_result["TransferStatus"]; transferLength = action_result["TransferLength"]; transferTotal = action_result["TransferTotal"]; } public bool CanDeleteResource { get { return controller.Actions.ContainsKey ("DeleteResource"); } } public void DeleteResource (Uri resourceUri) { if (!CanDeleteResource) throw new NotImplementedException (); var in_arguments = new Arguments ("ResourceURI", resourceUri.ToString ()); controller.Actions["DeleteResource"].Invoke (in_arguments); } public bool CanCreateReference { get { return controller.Actions.ContainsKey ("CreateReference"); } } public string CreateReference (string containerId, string objectId) { if (!CanCreateReference) throw new NotImplementedException (); var in_arguments = new Arguments ( "ContainerID", containerId, "ObjectID", objectId); var action_result = controller.Actions["CreateReference"].Invoke (in_arguments); return action_result["NewID"]; } // public bool HasTransferIds { get { return controller.StateVariables.ContainsKey ("TransferIDs"); } } // public event EventHandler> TransferIdsChanged { // add { // if (!HasTransferIds) return; // controller.StateVariables["TransferIDs"].Changed += value; // } // remove { // if (!HasTransferIds) return; // controller.StateVariables["TransferIDs"].Changed -= value; // } // } // // public event EventHandler> SystemUpdateIdChanged { // add { controller.StateVariables["SystemUpdateID"].Changed += value; } // remove { controller.StateVariables["SystemUpdateID"].Changed -= value; } // } // // public bool HasContainerUpdateIds { get { return controller.StateVariables.ContainsKey ("ContainerUpdateIDs"); } } // public event EventHandler> ContainerUpdateIdsChanged { // add { // if (!HasContainerUpdateIds) return; // controller.StateVariables["ContainerUpdateIDs"].Changed += value; // } // remove { // if (!HasContainerUpdateIds) return; // controller.StateVariables["ContainerUpdateIDs"].Changed -= value; // } // } /* void Verify () { // if (!controller.Actions.ContainsKey ("GetSearchCapabilities")) // throw new UpnpDeserializationException (string.Format ("The service {0} claims to be of type urn:schemas-upnp-org:service:ContentDirectory:1 but it does not have the required action GetSearchCapabilities.", controller.Description.Id)); // if (!controller.Actions.ContainsKey ("GetSortCapabilities")) // throw new UpnpDeserializationException (string.Format ("The service {0} claims to be of type urn:schemas-upnp-org:service:ContentDirectory:1 but it does not have the required action GetSortCapabilities.", controller.Description.Id)); // if (!controller.Actions.ContainsKey ("GetSystemUpdateID")) // throw new UpnpDeserializationException (string.Format ("The service {0} claims to be of type urn:schemas-upnp-org:service:ContentDirectory:1 but it does not have the required action GetSystemUpdateID.", controller.Description.Id)); // if (!controller.Actions.ContainsKey ("Browse")) // throw new UpnpDeserializationException (string.Format ("The service {0} claims to be of type urn:schemas-upnp-org:service:ContentDirectory:1 but it does not have the required action Browse.", controller.Description.Id)); // if (!controller.StateVariables.ContainsKey ("SystemUpdateID")) // throw new UpnpDeserializationException (string.Format ("The service {0} claims to be of type urn:schemas-upnp-org:service:ContentDirectory:1 but it does not have the required state variable SystemUpdateID.", controller.Description.Id)); }*/ } }Class.cs0000664000175000017500000000456611707010776043256 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1// // Class.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using Mono.Upnp.Xml; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1 { public class Class : IEquatable { protected Class () { } public Class (string fullClassName) : this (fullClassName, null) { } public Class (string fullClassName, string friendlyClassName) { if (fullClassName == null) { throw new ArgumentNullException ("fullClassName"); } FullClassName = fullClassName; FriendlyClassName = friendlyClassName; } [XmlAttribute ("name", OmitIfNull = true)] public virtual string FriendlyClassName { get; protected set; } [XmlValue] public virtual string FullClassName { get; protected set; } public override bool Equals (object obj) { return Equals (obj as Class); } public bool Equals (Class @class) { return @class != null && @class.FullClassName == FullClassName; } public override int GetHashCode () { return FullClassName.GetHashCode (); } } } ClassNameAttribute.cs0000664000175000017500000000313311707010776045730 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1// // ClassNameAttribute.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1 { [AttributeUsage (AttributeTargets.Class)] public sealed class ClassNameAttribute : Attribute { readonly string class_name; public ClassNameAttribute(string className) { class_name = className; } public string ClassName { get { return class_name; } } } } ContentDirectoryClient.cs0000664000175000017500000000375011714005363046633 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1// ContentDirectory1.cs auto-generated at 1/17/2009 8:08:36 PM by Sharpener using System; using Mono.Upnp.Dcp.MediaServer1; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1 { public class ContentDirectoryClient : IDisposable { readonly Client client; public ContentDirectoryClient () : this (null) { } public ContentDirectoryClient (Client client) { this.client = client ?? new Client (); this.client.ServiceAdded += ClientServiceAdded; } public Client Client { get { return client; } } void ClientServiceAdded (object sender, ServiceEventArgs args) { if (args.Service.Type != ContentDirectory.ServiceType) return; try { var description = args.Service.GetService (); if (description != null) { var controller = description.GetController (); if (controller != null) { //var service = new Deserializer (new ContentDirectoryController (controller)); //OnContentDirectoryAdded (new DiscoveryEventArgs (service)); } } } catch { } } public void Browse () { client.Browse (ContentDirectory.ServiceType); } /*void OnContentDirectoryAdded (DiscoveryEventArgs e) { var handler = ContentDirectoryAdded; if (handler != null) { handler (this, e); } }*/ public void Dispose () { Dispose (true); GC.SuppressFinalize (this); } protected virtual void Dispose (bool disposing) { if (disposing) { client.Dispose (); } } } }Item.cs0000664000175000017500000000523611707010776043102 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1// // Item.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using Mono.Upnp.Xml; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1 { [XmlType ("item", Schemas.DidlLiteSchema)] public class Item : Object { protected Item () { } public Item (string id, string parentId, ItemOptions options) : base (id, parentId, options) { RefId = options.RefId; } protected void CopyToOptions (ItemOptions options) { base.CopyToOptions (options); options.RefId = RefId; } public new ItemOptions GetOptions () { var options = new ItemOptions (); CopyToOptions (options); return options; } [XmlAttribute ("refID", Schemas.DidlLiteSchema, OmitIfNull = true)] public virtual string RefId { get; protected set; } public bool IsReference { get { return RefId != null; } } protected override void DeserializeAttribute (XmlDeserializationContext context) { context.AutoDeserializeAttribute (this); } protected override void Serialize (XmlSerializationContext context) { AutoSerialize (this, context); } protected override void SerializeMembers (XmlSerializationContext context) { AutoSerializeMembers (this, context); } } } LocalContentDirectory.cs0000664000175000017500000003326511707010776046461 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1// // LocalContentDirectory.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using Mono.Upnp.Control; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1 { public abstract class LocalContentDirectory : IDisposable { bool is_started; ulong system_id; protected virtual void OnSystemUpdate () { if (is_started) { system_id++; } } public virtual void Start () { is_started = true; } public virtual void Stop () { is_started = false; } public bool IsStarted { get { return is_started; } } [UpnpAction] public virtual void GetSearchCapabilities ([UpnpArgument ("SearchCaps")] [UpnpRelatedStateVariable ("SearchCapabilities")] out string searchCapabilities) { searchCapabilities = SearchCapabilities; } protected abstract string SearchCapabilities { get; } [UpnpAction] public virtual void GetSortCapabilities ([UpnpArgument ("SortCaps")] [UpnpRelatedStateVariable ("SortCapabilities")] out string sortCapabilities) { sortCapabilities = SortCapabilities; } protected abstract string SortCapabilities { get; } [UpnpAction ("GetSystemUpdateID")] public virtual void GetSystemUpdateId ([UpnpArgument ("Id")] [UpnpRelatedStateVariable ("SystemUpdateID")] out string systemUpdateId) { systemUpdateId = GetSystemUpdateId (); } protected virtual string GetSystemUpdateId () { return system_id.ToString (); } [UpnpAction] public virtual void Browse ([UpnpArgument ("ObjectID")] string objectId, [UpnpArgument ("BrowseFlag")] BrowseFlag browseFlag, [UpnpArgument ("Filter")] string filter, [UpnpArgument ("StartingIndex")] int startingIndex, [UpnpArgument ("RequestedCount")] int requestCount, [UpnpArgument ("SortCriteria")] string sortCriteria, [UpnpArgument ("Result")] out string result, [UpnpArgument ("NumberReturned")] out int numberReturned, [UpnpArgument ("TotalMatches")] out int totalMatches, [UpnpArgument ("UpdateID")] out string updateId) { result = Browse (objectId, browseFlag, filter, startingIndex, requestCount, sortCriteria, out numberReturned, out totalMatches, out updateId); } protected abstract string Browse (string objectId, BrowseFlag browseFlag, string filter, int startIndex, int requestCount, string sortCriteria, out int numberReturned, out int totalMatches, out string updateId); [UpnpAction (OmitUnless = "CanSearch")] public virtual void Search ([UpnpArgument ("ContainerID")] string containerId, [UpnpArgument ("SearchCriteria")] string searchCriteria, [UpnpArgument ("Filter")] string filter, [UpnpArgument ("StartingIndex")] int startingIndex, [UpnpArgument ("RequestedCount")] int requestCount, [UpnpArgument ("SortCriteria")] string sortCriteria, [UpnpArgument ("Result")] out string result, [UpnpArgument ("NumberReturned")] out int numberReturned, [UpnpArgument ("TotalMatches")] out int totalMatches, [UpnpArgument ("UpdateID")] out string updateId) { try { result = Search (containerId, QueryParser.Parse (searchCriteria), filter, startingIndex, requestCount, sortCriteria, out numberReturned, out totalMatches, out updateId); } catch (QueryParsingException e) { throw new UpnpControlException ( Error.UnsupportedOrInvalidSearchCriteria (), "Unable to parse searchCriteria.", e); } } public virtual bool CanSearch { get { return false; } } protected virtual string Search (string containerId, Action query, string filter, int startingIndex, int requestCount, string sortCriteria, out int numberReturned, out int totalMatches, out string updateId) { throw new UpnpControlException (UpnpError.OptionalActionNotImplemented ()); } public virtual bool CanCreateObject { get { return false; } } [UpnpAction (OmitUnless = "CanCreateObject")] public virtual void CreateObject ([UpnpArgument ("ContainerID")] string containerId, [UpnpArgument ("Elements"), UpnpRelatedStateVariable ("A_ARG_TYPE_Result")] string elements, [UpnpArgument ("ObjectID"), UpnpRelatedStateVariable ("A_ARG_TYPE_Result")] out string objectId, [UpnpArgument ("Result"), UpnpRelatedStateVariable ("A_ARG_TYPE_Result")] out string result) { objectId = CreateObject (containerId, elements, out result); } protected virtual string CreateObject (string containerId, string elements, out string result) { throw new UpnpControlException (UpnpError.OptionalActionNotImplemented ()); } public virtual bool CanDestroyObject { get { return false; } } [UpnpAction (OmitUnless = "CanDestroyObject")] public virtual void DestroyObject ([UpnpArgument ("ObjectID")] string objectId) { throw new UpnpControlException (UpnpError.OptionalActionNotImplemented ()); } public virtual bool CanUpdateObject { get { return false; } } [UpnpAction (OmitUnless = "CanUpdateObject")] public virtual void UpdateObject ([UpnpArgument ("ObjectID")] string objectId, [UpnpArgument ("CurrentTagValue"), UpnpRelatedStateVariable ("A_ARG_TYPE_TagValueList")] string currentTagValue, [UpnpArgument ("NewTagValue"), UpnpRelatedStateVariable ("A_ARG_TYPE_TagValueList")] string newTagValue) { throw new UpnpControlException (UpnpError.OptionalActionNotImplemented ()); } public virtual bool CanImportResource { get { return false; } } [UpnpAction (OmitUnless = "CanImportResource")] public virtual void ImportResource ([UpnpArgument ("SourceURI"), UpnpRelatedStateVariable ("A_ARG_TYPE_URI")] Uri sourceUri, [UpnpArgument ("DestinationURI"), UpnpRelatedStateVariable ("A_ARG_TYPE_URI")] Uri destinationUri, [UpnpArgument ("TransferID")] out int transferId) { transferId = ImportResource (sourceUri, destinationUri); } protected virtual int ImportResource (Uri sourceUri, Uri destinationUri) { throw new UpnpControlException (UpnpError.OptionalActionNotImplemented ()); } public virtual bool CanExportResource { get { return false; } } [UpnpAction (OmitUnless = "CanExportResource")] public virtual void ExportResource ([UpnpArgument ("SourceURI"), UpnpRelatedStateVariable ("A_ARG_TYPE_URI")] Uri sourceUri, [UpnpArgument ("DestinationURI"), UpnpRelatedStateVariable ("A_ARG_TYPE_URI")] Uri destinationUri, [UpnpArgument ("TransferID")] out int transferId) { transferId = ExportResource (sourceUri, destinationUri); } protected virtual int ExportResource (Uri sourceUri, Uri destinationUri) { throw new UpnpControlException (UpnpError.OptionalActionNotImplemented ()); } public virtual bool CanStopTransferResource { get { return false; } } [UpnpAction (OmitUnless = "CanStopTransferResource")] public virtual void StopTransferResource ([UpnpArgument ("TransferId")] int transferId) { throw new UpnpControlException (UpnpError.OptionalActionNotImplemented ()); } public virtual bool CanGetTransferProgress { get { return false; } } [UpnpAction (OmitUnless = "CanGetTransferProgress")] public virtual void GetTransferProgress ([UpnpArgument ("TransferId")] int transferId, [UpnpArgument ("TransferStatus")] out string transferStatus, [UpnpArgument ("TransferLength")] out string transferLength, [UpnpArgument ("TransferTotal")] out string transferTotal) { transferStatus = GetTransferProgress (transferId, out transferLength, out transferTotal); } protected virtual string GetTransferProgress (int transferId, out string transferLength, out string transferTotal) { throw new UpnpControlException (UpnpError.OptionalActionNotImplemented ()); } public virtual bool CanDeleteResource { get { return false; } } [UpnpAction (OmitUnless = "CanDeleteResource")] public virtual void DeleteResource ([UpnpArgument ("ResourceURI"), UpnpRelatedStateVariable ("A_ARG_TYPE_URI")] Uri resourceUri) { throw new UpnpControlException (UpnpError.OptionalActionNotImplemented ()); } public virtual bool CanCreateReference { get { return false; } } [UpnpAction (OmitUnless = "CanCreateReference")] public virtual void CreateReference ([UpnpArgument ("ContainerId"), UpnpRelatedStateVariable ("A_ARG_TYPE_ObjectID")] string containerId, [UpnpArgument ("ObjectID")] string objectId, [UpnpArgument ("NewID"), UpnpRelatedStateVariable ("A_ARG_TYPE_ObjectID")] out string newId) { newId = CreateReference (containerId, objectId); } protected virtual string CreateReference (string containerId, string objectId) { throw new UpnpControlException (UpnpError.OptionalActionNotImplemented ()); } [UpnpStateVariable ("SystemUpdateID")] public virtual event EventHandler> SystemUpdateIdChanged; public virtual bool HasTransferIds { get { return false; } } [UpnpStateVariable ("TransferIDs", OmitUnless = "HasTransferIds")] public virtual event EventHandler> TransferIdsChanged; public virtual bool HasContainerUpdateIds { get { return false; } } [UpnpStateVariable ("ContainerUpdateIDs", OmitUnless = "HasContainerUpdateIds")] public virtual event EventHandler> ContainerUpdateIdsChanged; public void Dispose () { Dispose (true); GC.SuppressFinalize (this); } protected virtual void Dispose (bool disposing) { } } } Container.cs0000664000175000017500000001050011707010776044114 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1// // Container.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using System.Collections.ObjectModel; using Mono.Upnp.Internal; using Mono.Upnp.Xml; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1 { [XmlType ("container", Schemas.DidlLiteSchema)] public class Container : Object, IXmlDeserializable { protected Container () { SearchClasses = new List (); CreateClasses = new List (); } public Container (string id, string parentId, ContainerOptions options) : base (id, parentId, options) { ChildCount = options.ChildCount; IsSearchable = options.IsSearchable; SearchClasses = Helper.MakeReadOnlyCopy (options.SearchClasses); CreateClasses = Helper.MakeReadOnlyCopy (options.CreateClasses); } protected void CopyToOptions (ContainerOptions options) { base.CopyToOptions (options); options.ChildCount = ChildCount; options.IsSearchable = IsSearchable; options.SearchClasses = new List (SearchClasses); options.CreateClasses = new List (CreateClasses); } public new ContainerOptions GetOptions () { var options = new ContainerOptions (); CopyToOptions (options); return options; } [XmlAttribute ("childCount", OmitIfNull = true)] public virtual int? ChildCount { get; protected set; } [XmlAttribute ("searchable", OmitIfNull = true)] protected virtual string Searchable { get { return IsSearchable ? "true" : null; } set { IsSearchable = value == "true"; } } public bool IsSearchable { get; protected set; } [XmlArrayItem ("createClass", Schemas.UpnpSchema)] public virtual IList CreateClasses { get; private set; } [XmlArrayItem ("searchClass", Schemas.UpnpSchema)] public virtual IList SearchClasses { get; private set; } protected override void Deserialize (XmlDeserializationContext context) { base.Deserialize (context); SearchClasses = new ReadOnlyCollection (SearchClasses); CreateClasses = new ReadOnlyCollection (CreateClasses); } protected override void DeserializeAttribute (XmlDeserializationContext context) { context.AutoDeserializeAttribute (this); } protected override void DeserializeElement (XmlDeserializationContext context) { context.AutoDeserializeElement (this); } protected override void Serialize (XmlSerializationContext context) { AutoSerialize (this, context); } protected override void SerializeMembers (XmlSerializationContext context) { AutoSerializeMembers (this, context); } } } Schemas.cs0000664000175000017500000000303711707010776043564 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1// // Schemas.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1 { public static class Schemas { public const string UpnpSchema = "urn:schemas-upnp-org:metadata-1-0/upnp/"; public const string DidlLiteSchema = "urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/"; public const string DublinCoreSchema = "http://purl.org/dc/elements/1.1/"; } } Error.cs0000664000175000017500000001643411707010776043277 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1// // Error.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using Mono.Upnp.Control; using Mono.Upnp.Internal; namespace Mono.Upnp.Dcp.MediaServer1 { public static class Error { public static UpnpError NoSuchObject () { return NoSuchObject (null); } public static UpnpError NoSuchObject (string message) { return new UpnpError (701, Helper.MakeErrorDescription ("No such object", message)); } public static UpnpError InvalidCurrentTagValue () { return InvalidCurrentTagValue (null); } public static UpnpError InvalidCurrentTagValue (string message) { return new UpnpError (702, Helper.MakeErrorDescription ("Invalid CurrentTagValue", message)); } public static UpnpError InvalidNewTagValue () { return InvalidNewTagValue (null); } public static UpnpError InvalidNewTagValue (string message) { return new UpnpError (703, Helper.MakeErrorDescription ("Invalid NewTagValue", message)); } public static UpnpError RequiredTag () { return RequiredTag (null); } public static UpnpError RequiredTag (string message) { return new UpnpError (704, Helper.MakeErrorDescription ("Required tag", message)); } public static UpnpError ReadOnlyTag () { return ReadOnlyTag (null); } public static UpnpError ReadOnlyTag (string message) { return new UpnpError (705, Helper.MakeErrorDescription ("Read only tag", message)); } public static UpnpError ParameterMismatch () { return ParameterMismatch (null); } public static UpnpError ParameterMismatch (string message) { return new UpnpError (706, Helper.MakeErrorDescription ("Parameter mismatch", message)); } public static UpnpError UnsupportedOrInvalidSearchCriteria () { return UnsupportedOrInvalidSearchCriteria (null); } public static UpnpError UnsupportedOrInvalidSearchCriteria (string message) { return new UpnpError (708, Helper.MakeErrorDescription ( "Unsupported or invalid search criteria", message)); } public static UpnpError UnsupportedOrInvalidSortCriteria () { return UnsupportedOrInvalidSortCriteria (null); } public static UpnpError UnsupportedOrInvalidSortCriteria (string message) { return new UpnpError (709, Helper.MakeErrorDescription ( "Unsupported or invalid sort criteria", message)); } public static UpnpError NoSuchContainer () { return NoSuchContainer (null); } public static UpnpError NoSuchContainer (string message) { return new UpnpError (710, Helper.MakeErrorDescription ("No such container", message)); } public static UpnpError RestrictedObject () { return RestrictedObject (null); } public static UpnpError RestrictedObject (string message) { return new UpnpError (711, Helper.MakeErrorDescription ("Restricted object", message)); } public static UpnpError BadMetadata () { return BadMetadata (null); } public static UpnpError BadMetadata (string message) { return new UpnpError (712, Helper.MakeErrorDescription ("Bad metadata", message)); } public static UpnpError RestrictedParentObject () { return RestrictedParentObject (null); } public static UpnpError RestrictedParentObject (string message) { return new UpnpError (713, Helper.MakeErrorDescription ("Restricted parent object", message)); } public static UpnpError NoSuchSourceResource () { return NoSuchSourceResource (null); } public static UpnpError NoSuchSourceResource (string message) { return new UpnpError (714, Helper.MakeErrorDescription ("No such source resource", message)); } public static UpnpError SourceResourceAccessDenied () { return SourceResourceAccessDenied (null); } public static UpnpError SourceResourceAccessDenied (string message) { return new UpnpError (715, Helper.MakeErrorDescription ("Source resource access denied", message)); } public static UpnpError TransferBusy () { return TransferBusy (null); } public static UpnpError TransferBusy (string message) { return new UpnpError (716, Helper.MakeErrorDescription ("Transfer busy", message)); } public static UpnpError NoSuchFileTransfer () { return NoSuchFileTransfer (null); } public static UpnpError NoSuchFileTransfer (string message) { return new UpnpError (717, Helper.MakeErrorDescription ("No such file transfer", message)); } public static UpnpError NoSuchDestinationResource () { return NoSuchDestinationResource (null); } public static UpnpError NoSuchDestinationResource (string message) { return new UpnpError (718, Helper.MakeErrorDescription ("No such destination resource", message)); } public static UpnpError DestinationResourceAccessDenied () { return DestinationResourceAccessDenied (null); } public static UpnpError DestinationResourceAccessDenied (string message) { return new UpnpError (719, Helper.MakeErrorDescription ("Destination resource access denied", message)); } public static UpnpError CannotProcessTheRequest () { return CannotProcessTheRequest (null); } public static UpnpError CannotProcessTheRequest (string message) { return new UpnpError (720, Helper.MakeErrorDescription ("Cannot process the request", message)); } } } ObjectBasedContentDirectory.cs0000664000175000017500000001541411707010776047570 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1// // ObjectBasedContentDirectory.cs // // Author: // scott <${AuthorEmail}> // // Copyright (c) 2009 scott // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using System.Text; using System.Xml; using Mono.Upnp.Xml; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1 { public abstract class ObjectBasedContentDirectory : LocalContentDirectory { XmlSerializer serializer = new XmlSerializer (); Dictionary queryContexts = new Dictionary(); ObjectQueryContext GetQueryContext (Type type) { if (type == null) { return null; } ObjectQueryContext context; if (!queryContexts.TryGetValue (type, out context)) { context = new ObjectQueryContext (type, GetQueryContext (type.BaseType)); queryContexts[type] = context; } return context; } public override bool CanSearch { get { return true; } } protected override string Search (string containerId, Action query, string filter, int startingIndex, int requestCount, string sortCriteria, out int numberReturned, out int totalMatches, out string updateId) { updateId = "0"; var serializer = new ResultsSerializer (this.serializer); Search (result => serializer.Serialize (result), containerId, query, startingIndex, requestCount, sortCriteria, out numberReturned, out totalMatches); return serializer.ToString (); } protected virtual void Search (Action consumer, string containerId, Action query, int startingIndex, int requestCount, string sortCriteria, out int numberReturned, out int totalMatches) { if (consumer == null) { throw new ArgumentNullException ("consumer"); } else if (query == null) { throw new ArgumentNullException ("query"); } var total = 0; var count = 0; Action query_consumer = result => { total++; if (total > startingIndex && count < requestCount) { consumer (result); count++; } }; VisitChildren (child => { query (new ObjectQueryVisitor (GetQueryContext (child.GetType ()), child, query_consumer)); }, containerId, 0, -1, string.Empty, out totalMatches); totalMatches = total; numberReturned = count; } protected override string Browse (string objectId, BrowseFlag browseFlag, string filter, int startIndex, int requestCount, string sortCriteria, out int numberReturned, out int totalMatches, out string updateId) { var serializer = new ResultsSerializer (this.serializer); var @object = GetObject (objectId); if (browseFlag == BrowseFlag.BrowseDirectChildren) { numberReturned = VisitChildren (child => serializer.Serialize (child), @object.Id, startIndex, requestCount, sortCriteria, out totalMatches); } else { serializer.Serialize (@object); numberReturned = 1; totalMatches = 1; } updateId = "0"; return serializer.ToString (); } protected abstract int VisitChildren (Action consumer, string objectId, int startIndex, int requestCount, string sortCriteria, out int totalMatches); protected abstract Object GetObject (string objectId); class ResultsSerializer { XmlSerializer serializer; StringBuilder builder = new StringBuilder (); XmlWriter writer; public ResultsSerializer (XmlSerializer serializer) { this.serializer = serializer; writer = XmlWriter.Create (builder); writer.WriteStartElement ("DIDL-Lite", Schemas.DidlLiteSchema); writer.WriteAttributeString ("xmlns", "dc", null, Schemas.DublinCoreSchema); writer.WriteAttributeString ("xmlns", "upnp", null, Schemas.UpnpSchema); } public void Serialize (T item) { serializer.Serialize (item, writer); } public override string ToString () { writer.WriteEndElement (); return builder.ToString (); } } } } ItemOptions.cs0000664000175000017500000000252211707010776044451 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1// // ItemOptions.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1 { public class ItemOptions : ObjectOptions { public string RefId { get; set; } } } Resource.cs0000664000175000017500000001340611707010776043771 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1// // Resource.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using Mono.Upnp.Xml; using Mono.Upnp.Dcp.MediaServer1.ConnectionManager1; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1 { [XmlType ("res", Schemas.DidlLiteSchema)] public class Resource : XmlAutomatable, IXmlDeserializer { protected Resource () { } public Resource (Uri uri, ResourceOptions options) { if (uri == null) { throw new ArgumentNullException ("uri"); } else if (options == null) { throw new ArgumentNullException ("options"); } Uri = uri; Size = options.Size; Duration = options.Duration; BitRate = options.BitRate; SampleFrequency = options.SampleFrequency; BitsPerSample = options.BitsPerSample; NrAudioChannels = options.NrAudioChannels; Resolution = options.Resolution; ColorDepth = options.ColorDepth; ProtocolInfo = options.ProtocolInfo; Protection = options.Protection; ImportUri = options.ImportUri; } protected void CopyToOptions (ResourceOptions options) { if (options == null) { throw new ArgumentNullException ("options"); } options.Size = Size; options.Duration = Duration; options.BitRate = BitRate; options.SampleFrequency = SampleFrequency; options.BitsPerSample = BitsPerSample; options.NrAudioChannels = NrAudioChannels; options.Resolution = Resolution; options.ColorDepth = ColorDepth; options.ProtocolInfo = ProtocolInfo; options.Protection = Protection; options.ImportUri = ImportUri; } public ResourceOptions GetOptions () { var options = new ResourceOptions (); CopyToOptions (options); return options; } [XmlValue] public virtual Uri Uri { get; protected set; } [XmlAttribute ("size", OmitIfNull = true)] public virtual ulong? Size { get; protected set; } [XmlAttribute ("duration", OmitIfNull = true)] public virtual TimeSpan? Duration { get; protected set; } [XmlAttribute ("bitrate", OmitIfNull = true)] public virtual uint? BitRate { get; protected set; } [XmlAttribute ("sampleFrequency", OmitIfNull = true)] public virtual uint? SampleFrequency { get; protected set; } [XmlAttribute ("bitsPerSample", OmitIfNull = true)] public virtual uint? BitsPerSample { get; protected set; } [XmlAttribute ("nrAudioChannels", OmitIfNull = true)] public virtual uint? NrAudioChannels { get; protected set; } //[XmlAttribute ("resolution", OmitIfNull = true)] public virtual Resolution? Resolution { get; protected set; } [XmlAttribute ("colorDepth", OmitIfNull = true)] public virtual uint? ColorDepth { get; protected set; } [XmlAttribute ("protocolInfo", OmitIfNull = true)] public virtual ProtocolInfo ProtocolInfo { get; protected set; } [XmlAttribute ("protection", OmitIfNull = true)] public virtual string Protection { get; protected set; } [XmlAttribute ("importUri", OmitIfNull = true)] public virtual Uri ImportUri { get; protected set; } protected override void Deserialize (XmlDeserializationContext context) { context.AutoDeserialize (this); } protected override void DeserializeAttribute (XmlDeserializationContext context) { context.AutoDeserializeAttribute (this); } protected override void DeserializeElement (XmlDeserializationContext context) { context.AutoDeserializeElement (this); } protected override void Serialize (XmlSerializationContext context) { AutoSerialize (this, context); } protected override void SerializeMembers (XmlSerializationContext context) { AutoSerializeMembers (this, context); } ProtocolInfo IXmlDeserializer.Deserialize (XmlDeserializationContext context) { // FIXME I'd like to do a better job with this. Maybe make ProtocolInfo an IXmlDeserializable and // support IXmlDeserializable attributes (which would require using the Activator). return ProtocolInfo.Parse (context.Reader["protocolInfo"]); } } } QueryParsingException.cs0000664000175000017500000000265711707010776046520 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1// // QueryParsingException.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1 { public class QueryParsingException : Exception { public QueryParsingException (string message) : base (message) { } } } Results.cs0000664000175000017500000000717611707010776043652 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1// // Results.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections; using System.Collections.Generic; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1 { public abstract class Results : IEnumerable { public Results (Container container, string sortCriteria, string filter, uint requestCount, uint offset, uint totalCount, IList results) { if (container == null) { throw new ArgumentNullException ("container"); } else if (results == null) { throw new ArgumentNullException ("results"); } this.Container = container; this.SortCriteria = sortCriteria; this.Filter = filter; this.RequestCount = requestCount; this.Offset = offset; this.TotalCount = totalCount; this.ResultsList = results; } protected Container Container { get; private set; } protected string SortCriteria { get; private set; } protected string Filter { get; private set; } protected uint RequestCount { get; private set; } public uint Offset { get; private set; } public uint TotalCount { get; private set; } public uint Count { get { return (uint)ResultsList.Count; } } public IList ResultsList { get; private set; } public bool HasMoreResults { get { return Offset + ResultsList.Count < TotalCount; } } public Results GetMoreResults (RemoteContentDirectory contentDirectory) { return GetMoreResults (contentDirectory, new ResultsSettings { SortCriteria = SortCriteria, Filter = Filter, RequestCount = System.Math.Min (RequestCount, TotalCount - (Offset + Count)), Offset = Offset + Count }); } protected abstract Results GetMoreResults (RemoteContentDirectory contentDirectory, ResultsSettings settings); public IEnumerator GetEnumerator () { return ResultsList.GetEnumerator (); } IEnumerator IEnumerable.GetEnumerator () { return GetEnumerator (); } } } BrowseFlag.cs0000664000175000017500000000034511707010776044233 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1// BrowseFlag.cs auto-generated at 1/17/2009 8:08:36 PM by Sharpener namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1 { public enum BrowseFlag { BrowseMetadata, BrowseDirectChildren } }QueryParser.cs0000664000175000017500000005525211707010776044471 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1// // QueryParser.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System.Text; using Mono.Upnp.Internal; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1 { using Expression = System.Action; using OperatorHandler = Func, System.Action>, Func, System.Action>>; // Refer to ContentDirectory1 Service Template 1.0.1, Section 2.5.5.1: Search Criteria String Syntax public abstract class QueryParser { protected abstract QueryParser OnCharacter (char character); protected abstract Expression OnDone (); protected static bool IsWhiteSpace (char character) { switch (character) { case ' ': return true; case '\t': return true; case '\n': return true; case '\v': return true; case '\f': return true; case '\r': return true; default: return false; } } class RootQueryParser : QueryParser { const string wild_card_error_message = "The wildcard must be used alone."; int parentheses; public RootQueryParser () { } protected override QueryParser OnCharacter (char character) { if (IsWhiteSpace (character)) { return this; } else if (character == '*') { if (parentheses == -1) { throw new QueryParsingException (wild_card_error_message); } else { parentheses = -1; return this; } } else if (character == '(') { if (parentheses == -1) { throw new QueryParsingException (wild_card_error_message); } else { parentheses++; return this; } } else if (character == ')') { if (parentheses > 0) { throw new QueryParsingException ("Empty expressions are not allowed."); } else { throw new QueryParsingException ("The parentheses are unbalanced."); } } else { if (parentheses == -1) { throw new QueryParsingException (wild_card_error_message); } else { return new PropertyParser (token => new RootPropertyOperatorParser (token, expression => new ExpressionParser (expression, parentheses))).OnCharacter (character); } } } protected override Expression OnDone () { if (parentheses == -1) { return visitor => visitor.VisitAllResults (); } else { throw new QueryParsingException ("The query is empty."); } } } class ExpressionParser : QueryParser { const int disjunction_priority = 1; const int conjunction_priority = 2; const int parenthetical_priority = 3; protected readonly Expression Expression; int parentheses; public ExpressionParser (Expression expression, int parentheses) { this.Expression = expression; this.parentheses = parentheses; } protected override QueryParser OnCharacter (char character) { if (IsWhiteSpace (character)) { return this; } else if (character == '(') { parentheses++; return this; } else if (character == ')') { parentheses--; if (parentheses < 0) { throw new QueryParsingException ("The parentheses are unbalanced."); } else { return this; } } else if (character == 'a') { var priority = GetPriority (conjunction_priority); return new OperatorParser ("and", new JunctionParser ("conjunction", parentheses, priority, MakeHandler (priority, (leftOperand, rightOperand) => visitor => visitor.VisitAnd (leftOperand, rightOperand)))) .OnCharacter ('a'); } else if (character == 'o') { var priority = GetPriority (disjunction_priority); return new OperatorParser ("or", new JunctionParser ("disjunction", parentheses, priority, MakeHandler (priority, (leftOperand, rightOperand) => visitor => visitor.VisitOr (leftOperand, rightOperand)))) .OnCharacter ('o'); } else { throw new QueryParsingException (string.Format ("Unexpected operator begining: {0}.", character)); } } int GetPriority (int priority) { if (parentheses > 0) { return parenthetical_priority + parentheses + priority; } else { return priority; } } protected virtual OperatorHandler MakeHandler (int priority, Func binaryOperator) { return (priorPriority, priorOperator) => { if (priorPriority < priority) { return priorOperand => priorOperator (binaryOperator (Expression, priorOperand)); } else { return priorOperand => binaryOperator (Expression, priorOperator (priorOperand)); } }; } protected override Expression OnDone () { if (parentheses == 0) { return Expression; } else { throw new QueryParsingException ("The parentheses are unbalanced."); } } } class JoinedExpressionParser : ExpressionParser { readonly OperatorHandler previous_handler; readonly int priority; public JoinedExpressionParser (Expression expression, int parentheses, int priority, OperatorHandler previousHandler) : base (expression, parentheses) { this.previous_handler = previousHandler; this.priority = priority; } protected override OperatorHandler MakeHandler (int priority, Func binaryOperator) { // An unintelligable but very slick operator priority algorithm. if (this.priority < priority) { return (priorPriority, priorOperator) => { if (this.priority < priorPriority) { return priorOperand => previous_handler (this.priority, operand => operand) ( priorOperator (binaryOperator (Expression, priorOperand))); } else { return priorOperand => previous_handler ( priorPriority, operand => priorOperator (operand)) ( binaryOperator (Expression, priorOperand)); } }; } else { return (priorPriority, priorOperator) => priorOperand => priorOperator (previous_handler ( priorPriority, operand => binaryOperator (operand, priorOperand)) (Expression)); } } protected override Expression OnDone () { return previous_handler (priority, operand => operand) (Expression); } } class JunctionParser : QueryParser { readonly string junction; readonly OperatorHandler previous_handler; readonly int priority; int parentheses; public JunctionParser (string junction, int parentheses, int priority, OperatorHandler previousHandler) { this.junction = junction; this.parentheses = parentheses; this.priority = priority; this.previous_handler = previousHandler; } protected override QueryParser OnCharacter (char character) { if (IsWhiteSpace (character)) { return this; } else if (character == '(') { parentheses++; return this; } else if (character == ')') { return Fail (); } else { return new PropertyParser (token => new RootPropertyOperatorParser ( token, expression => new JoinedExpressionParser ( expression, parentheses, priority, previous_handler))).OnCharacter (character); } } protected override Expression OnDone () { return Fail (); } T Fail () { throw new QueryParsingException (string.Format ( "Expecting an expression after the {0}.", junction)); } } class OperatorParser : QueryParser { readonly string @operator; readonly QueryParser next_parser; bool initialized; int position; public OperatorParser (string @operator, QueryParser nextParser) { this.@operator = @operator; this.next_parser = nextParser; } protected override QueryParser OnCharacter (char character) { if (initialized) { if (IsWhiteSpace (character)) { return this; } else { return next_parser.OnCharacter (character); } } else if (position == @operator.Length) { if (IsWhiteSpace (character)) { initialized = true; return this; } else { return OnFailure (@operator + character); } } else if (character != @operator[position]) { if (IsWhiteSpace (character)) { throw new QueryParsingException (string.Format ( "Unexpected operator: {0}.", @operator.Substring (0, position))); } else { return OnFailure (@operator.Substring (0, position) + character); } } else { position++; return this; } } protected virtual QueryParser OnFailure (string token) { throw new QueryParsingException (string.Format ( "Unexpected operator begining: {0}.", token)); } protected override Expression OnDone () { if (position == @operator.Length) { throw new QueryParsingException (string.Format ( "There is no operand for the operator: {0}.", @operator)); } else { throw new QueryParsingException (string.Format ( "Unexpected operator: {0}.", @operator.Substring (0, position))); } } public QueryParser Or (QueryParser otherParser) { return new DisjoinedTokenParser (@operator, next_parser, otherParser); } class DisjoinedTokenParser : OperatorParser { readonly QueryParser alternative_parser; public DisjoinedTokenParser (string @operator, QueryParser nextParser, QueryParser alternativeParser) : base (@operator, nextParser) { alternative_parser = alternativeParser; } protected override QueryParser OnFailure (string @operator) { var parser = alternative_parser; foreach (var character in @operator) { parser = parser.OnCharacter (character); } return parser; } } } class RootPropertyOperatorParser : QueryParser { readonly string property; readonly Func consumer; public RootPropertyOperatorParser (string property, Func consumer) { this.property = property; this.consumer = consumer; } protected override QueryParser OnCharacter (char character) { if (IsWhiteSpace (character)) { return this; } QueryParser parser; switch (character) { case '=': parser = Operator ("=", value => visitor => visitor.VisitEquals (property, value)); break; case '!': parser = Operator ("!=", value => visitor => visitor.VisitDoesNotEqual (property, value)); break; case '<': parser = Operator ("<", value => visitor => visitor.VisitLessThan (property, value)). Or ( Operator ("<=", value => visitor => visitor.VisitLessThanOrEqualTo (property, value))); break; case '>': parser = Operator (">", value => visitor => visitor.VisitGreaterThan (property, value)). Or ( Operator (">=", value => visitor => visitor.VisitGreaterThanOrEqualTo (property, value))); break; case 'c': parser = Operator ("contains", value => visitor => visitor.VisitContains (property, value)); break; case 'e': parser = new OperatorParser ("exists", new BooleanParser (value => consumer (visitor => visitor.VisitExists (property, value)))); break; case 'd': parser = Operator ("derivedfrom", value => visitor => visitor.VisitDerivedFrom (property, value)).Or ( Operator ("doesNotContain", value => visitor => visitor.VisitDoesNotContain (property, value))); break; default: throw new QueryParsingException (string.Format ("Unexpected operator begining: {0}.", character)); } return parser.OnCharacter (character); } protected override Expression OnDone () { throw new QueryParsingException (string.Format ( "No operator is applied to the property identifier: {0}.", property)); } OperatorParser Operator (string token, Func @operator) { return new OperatorParser (token, new StringParser (token, value => consumer (@operator (value)))); } } class PropertyParser : QueryParser { readonly Func consumer; StringBuilder builder = new StringBuilder (); public PropertyParser (Func consumer) { this.consumer = consumer; } protected override QueryParser OnCharacter (char character) { if (IsWhiteSpace (character)) { return consumer (builder.ToString ()); } else { builder.Append (character); return this; } } protected override Expression OnDone () { throw new QueryParsingException (string.Format ( @"The property identifier is not a part of an expression: {0}.", builder.ToString ())); } } class StringParser : QueryParser { readonly string @operator; readonly Func consumer; StringBuilder builder; bool escaped; public StringParser (string @operator, Func consumer) { this.@operator = @operator; this.consumer = consumer; } protected override QueryParser OnCharacter (char character) { if (builder == null) { if (character == '"') { builder = new StringBuilder (); return this; } else { throw new QueryParsingException (string.Format ( "Expecting double-quoted string operand with the operator: {0}.", @operator)); } } else if (escaped) { if (character == '\\') { builder.Append ('\\'); } else if (character == '"') { builder.Append ('"'); } else { throw new QueryParsingException (string.Format ( "Unexpected escape sequence: \\{0}.", character)); } escaped = false; return this; } else if (character == '\\') { escaped = true; return this; } else if (character == '"') { return consumer (builder.ToString ()); } else { builder.Append (character); return this; } } protected override Expression OnDone () { throw new QueryParsingException (string.Format ( @"The double-quoted string is not terminated: ""{0}"".", builder.ToString ())); } } class BooleanParser : QueryParser { readonly Func consumer; bool @true; int position; public BooleanParser (Func consumer) { this.consumer = consumer; } protected override QueryParser OnCharacter (char character) { if (position == 0) { if (IsWhiteSpace (character)) { return this; } else if (character == 't') { @true = true; return Check ("true", character); } else if (character == 'f') { return Check ("false", character); } else { return Fail (); } } else if (@true) { return Check ("true", character); } else { return Check ("false", character); } } protected override Expression OnDone () { if (@true) { if (position == "true".Length) { return consumer (true).OnDone (); } else { return Fail (); } } else { if (position == "false".Length) { return consumer (false).OnDone (); } else { return Fail (); } } } QueryParser Check (string expected, char character) { if (position == expected.Length) { if (IsWhiteSpace (character)) { return consumer (@true); } else if (character == ')' || character == '(') { return consumer (@true).OnCharacter (character); } else { return Fail (); } } else if (expected[position] == character) { position++; return this; } else { return Fail (); } } T Fail () { throw new QueryParsingException (@"Expecting either ""true"" or ""false""."); } } public static Expression Parse (string query) { QueryParser parser = new RootQueryParser (); foreach (var character in query) { parser = parser.OnCharacter (character); } return parser.OnDone (); } } } Reference.cs0000664000175000017500000000544511707010776044104 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1// // Reference.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using Mono.Upnp.Dcp.MediaServer1.Xml; using Mono.Upnp.Xml; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1 { public class Reference : IXmlSerializable where T : Item { T item; string id; string parent_id; public Reference (string id, string parentId, T item) { if (id == null) { throw new ArgumentNullException ("id"); } else if (parentId == null) { throw new ArgumentNullException ("parentId"); } else if (item == null) { throw new ArgumentNullException ("item"); } this.id = id; this.parent_id = parentId; this.item = item; } public void Serialize (XmlSerializationContext context) { if (context == null) { throw new ArgumentNullException ("context"); } context.AutoSerializeObjectStart (item); SerializeMembers (context); context.AutoSerializeObjectEnd (item); } public void SerializeMembers (XmlSerializationContext context) { if (context == null) { throw new ArgumentNullException ("context"); } context.AutoSerializeMembers (item, new VirtualContext ( new Override ("id", Schemas.DidlLiteSchema, id), new Override ("parentID", Schemas.DidlLiteSchema, parent_id), new Override ("refID", Schemas.DidlLiteSchema, item.Id) )); } } } ResultsSettings.cs0000664000175000017500000000445511707010776045370 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1// // ResultsSettings.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1 { public struct ResultsSettings { const int sort_criteria_mask = 1; const int filter_mask = 2; const int request_count_mask = 4; int field_mask; string sort_criteria; string filter; uint request_count; public string SortCriteria { get { return (field_mask & sort_criteria_mask) == 0 ? "" : sort_criteria; } set { field_mask |= sort_criteria_mask; sort_criteria = value; } } public string Filter { get { return (field_mask & filter_mask) == 0 ? "*" : filter; } set { field_mask |= filter_mask; filter = value; } } public uint RequestCount { get { return (field_mask & request_count_mask) == 0 ? 200 : request_count; } set { field_mask |= request_count_mask; request_count = value; } } public uint Offset { get; set; } } } ClassReference.cs0000664000175000017500000000525311733142461045063 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1// // ClassReference.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using Mono.Upnp.Xml; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1 { public class ClassReference : Class, IComparable, IEquatable { protected ClassReference () { } public ClassReference (bool includeDerived, string fullClassName) : this (includeDerived, fullClassName, null) { } public ClassReference (bool includeDerived, string fullClassName, string friendlyClassName) : base (fullClassName, friendlyClassName) { IncludeDerived = includeDerived; } [XmlAttribute ("includeDerived")] public virtual bool IncludeDerived { get; protected set; } int IComparable.CompareTo (ClassReference classReference) { return FullClassName.CompareTo (classReference.FullClassName); } public override bool Equals (object obj) { return Equals (obj as ClassReference); } public bool Equals (ClassReference classReference) { return base.Equals (classReference) && classReference.IncludeDerived == IncludeDerived; } public override int GetHashCode () { var hashCode = base.GetHashCode (); if (IncludeDerived) { return hashCode; } else { return ~hashCode; } } } } ContentDirectory.cs0000664000175000017500000000271511707010776045502 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1// // ContentDirectory.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1 { public static class ContentDirectory { public static readonly ServiceType ServiceType = new ServiceType ( "schemas-upnp-org", "ContentDirectory", new Version (1, 0)); } } QueryVisitor.cs0000664000175000017500000000720611707010776044670 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1// // QueryVisitor.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1 { public class QueryVisitor { public virtual void VisitAllResults () { } public virtual void VisitEquals (string property, string value) { VisitPropertyExpression (property, value); } public virtual void VisitDoesNotEqual (string property, string value) { VisitPropertyExpression (property, value); } public virtual void VisitLessThan (string property, string value) { VisitPropertyExpression (property, value); } public virtual void VisitLessThanOrEqualTo (string property, string value) { VisitPropertyExpression (property, value); } public virtual void VisitGreaterThan (string property, string value) { VisitPropertyExpression (property, value); } public virtual void VisitGreaterThanOrEqualTo (string property, string value) { VisitPropertyExpression (property, value); } public virtual void VisitContains (string property, string value) { VisitPropertyExpression (property, value); } public virtual void VisitDoesNotContain (string property, string value) { VisitPropertyExpression (property, value); } public virtual void VisitDerivedFrom (string property, string value) { VisitPropertyExpression (property, value); } public virtual void VisitExists (string property, bool value) { VisitExpression (); } public virtual void VisitAnd (Action leftOperand, Action rightOperand) { VisitBinaryExpression (leftOperand, rightOperand); } public virtual void VisitOr (Action leftOperand, Action rightOperand) { VisitBinaryExpression (leftOperand, rightOperand); } protected virtual void VisitPropertyExpression (string property, string value) { VisitExpression (); } protected virtual void VisitBinaryExpression (Action leftOperand, Action rightOperand) { VisitExpression (); } protected virtual void VisitExpression () { } } } ObjectQueryVisitor.cs0000664000175000017500000001304111707010776046011 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1// // ObjectQueryVisitor.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using System.Reflection; namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1 { public class ObjectQueryVisitor : QueryVisitor { readonly ObjectQueryContext context; readonly Object @object; Action consumer; public ObjectQueryVisitor (ObjectQueryContext context, Object @object, Action consumer) { if (context == null) { throw new ArgumentNullException ("context"); } else if (@object == null) { throw new ArgumentNullException ("object"); } else if (consumer == null) { throw new ArgumentNullException ("consumer"); } this.context = context; this.@object = @object; this.consumer = consumer; } void Yield () { if (consumer != null) { consumer (@object); consumer = null; } } public override void VisitAllResults () { Yield (); } public override void VisitAnd (Action leftOperand, Action rightOperand) { leftOperand (new ObjectQueryVisitor (context, @object, result => rightOperand (this))); } public override void VisitOr (Action leftOperand, Action rightOperand) { Object leftResult = null; leftOperand (new ObjectQueryVisitor (context, @object, result => leftResult = result)); if (leftResult == null) { rightOperand (this); } else { Yield (); } } public override void VisitExists (string property, bool value) { if (context.PropertyExists (property, @object) == value) { Yield (); } } public override void VisitEquals (string property, string value) { context.VisitProperty (property, @object, val => { if (val == null) { if (value == null) { Yield (); } } else if (val.ToString ().Equals (value)) { Yield (); } }); } public override void VisitDoesNotEqual (string property, string value) { context.VisitProperty (property, @object, val => { if (val == null) { if (value != null) { Yield (); } } else if (!val.ToString ().Equals (value)) { Yield (); } }); } public override void VisitLessThan (string property, string value) { context.CompareProperty (property, @object, value, val => { if (val < 0) { Yield (); } }); } public override void VisitLessThanOrEqualTo (string property, string value) { context.CompareProperty (property, @object, value, val => { if (val <= 0) { Yield (); } }); } public override void VisitGreaterThan (string property, string value) { context.CompareProperty (property, @object, value, val => { if (val > 0) { Yield (); } }); } public override void VisitGreaterThanOrEqualTo (string property, string value) { context.CompareProperty (property, @object, value, val => { if (val >= 0) { Yield (); } }); } public override void VisitContains (string property, string value) { context.VisitProperty (property, @object, val => { if (val != null && val.ToString ().Contains (value)) { Yield (); } }); } public override void VisitDoesNotContain (string property, string value) { context.VisitProperty (property, @object, val => { if (val == null || !val.ToString ().Contains (value)) { Yield (); } }); } } } AssemblyInfo.cs0000664000175000017500000000554011714307244034367 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1// // AssemblyInfo.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System.Reflection; using System.Runtime.CompilerServices; // Information about this assembly is defined by the following attributes. // Change them to the values specific to your project. [assembly: AssemblyTitle ("Mono.Upnp.Dcp.MediaServer1")] [assembly: AssemblyDescription ("A client and server UPnP Forum MediaServer1 stack.")] [assembly: AssemblyConfiguration ("")] [assembly: AssemblyCompany ("")] [assembly: AssemblyProduct ("")] [assembly: AssemblyCopyright ("")] [assembly: AssemblyTrademark ("")] [assembly: AssemblyCulture ("")] // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". // The form "{Major}.{Minor}.*" will automatically update the build and revision, // and "{Major}.{Minor}.{Build}.*" will update just the revision. [assembly: AssemblyVersion ("1.0.*")] // The following attributes are used to specify the signing key for the assembly, // if desired. See the Mono documentation for more information about signing. [assembly: AssemblyDelaySign (false)] [assembly: InternalsVisibleTo ("Mono.Upnp.Dcp.MediaServer1.Tests, PublicKey=" + "00240000048000009400000006020000002400005253" + "41310004000011000000C3030A2933D77BEDEF4CB040" + "07AF2DFBAEC11AB77693AD580B6B6900B1441006A8FE" + "CA691E010996573F3DF3E273F4589468125D446128DF" + "93A1CEEA9407A948990CE3DE2E5531BF4D3063ECA91E" + "10D4C84B6A77FCDC88F0FDEB9A0FED16D866687DACB8" + "5659DB48FD017FD94222433D9C453813A591F4E1CF25" + "CFD2ABFBFE94")] mono-upnp-dcp-mediaserver1.snk0000664000175000017500000000112411714307467037244 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1$RSA2Êq8Øxÿ´æŽ"Èý„U~6ôûvØ7tÌHÚ²œáKêeª´% ûŸ9ÌâY=ÂšÚø•N’/JcT¶Þ·‘7³=ê!+°O’ûßå v)tòåØ`I×ôGƒœ×lWúÀ.†ÉwÕ_]Û¨îFÊo@"O†S +ºþŸaí„ÒqiùÖÜsæ]Ò…^¢Ô- RÄPIÅGhKöœª£pý¼å*SȸZ;¥zçVüÄ£¬—Ñ.ºgHÄ÷S¸=x `Ti‡Íðe‹Ìé´7XPÑ Ü—õíá8ÂJõ{[µò—Wò6m3ˆ#;f«¡SíýÛ±ßK Iî³ >(G†„sİ©¾ÃndbëSiDÛ¢Ìª|I–p„}¾‹pÎÙ|ýÍ;&õ{P¦ócç¡Ùjfáa±¸l*‚«©ÀŽP÷¨Ñ:±Mê’ê|}5í°Ü”k©Uê6Å-û©D0NÐsKuˆ‡Yê¤M ŒQá(*.õ™Ýjq©;ü‘êyÒ…öv¢Ë«Uû&¡»ÉKã[*4 C-  ó9M’Çì5 J¯ ÝŸ1ÂYÆÙ¬K^¤!ñönß ˽·­á×&Ð9³§›7Ÿ2籊VRtÅÚÚMާЕ¡ýF Å:0©è8Ie+ýµ4!‘îQù:†çŽÖ@B91)Ë?à`N“~§Dj?\¿gÞ+ÜѹŽ8¨a…*æm‚ºwW¨Ç¾y ‘Õ9¯/Mono.Upnp.Dcp.MediaServer1.Xml/0000775000175000017500000000000011707010776037027 5ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1FilteringDelegateSerializationCompiler.cs0000664000175000017500000001006111707010776047163 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.Xml// // FilteringDelegateSerializationCompiler.cs // // Author: // Scott Peterson // // Copyright (c) 2010 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using System.Reflection; using Mono.Upnp.Xml; using Mono.Upnp.Xml.Compilation; namespace Mono.Upnp.Dcp.MediaServer1.Xml { public class FilteringDelegateSerializationCompiler : DelegateSerializationCompiler { public FilteringDelegateSerializationCompiler (XmlSerializer xmlSerializer, Type type) : base (xmlSerializer, type) { } protected override Serializer CreateAttributeSerializer (PropertyInfo property, XmlAttributeAttribute attributeAttribute) { var serializer = base.CreateAttributeSerializer (property, attributeAttribute); if (attributeAttribute.OmitIfNull) { var name = attributeAttribute.Name; var @namespace = attributeAttribute.Namespace; return (obj, context) => { string prefix; if (string.IsNullOrEmpty (@namespace)) { prefix = null; } else { prefix = context.Writer.LookupPrefix (@namespace); } var id = PropertyName.CreateForAttribute (name, prefix, context.Context.NestedPropertyName); if (context.Context.IncludesAttribute (id)) { serializer (obj, context); } }; } else { return serializer; } } protected override Serializer CreateElementSerializer (PropertyInfo property, XmlElementAttribute elementAttribute) { var serializer = base.CreateElementSerializer (property, elementAttribute); if (elementAttribute.OmitIfNull) { var name = elementAttribute.Name; var @namespace = elementAttribute.Namespace; return (obj, context) => { string prefix; if (string.IsNullOrEmpty (@namespace)) { prefix = null; } else { prefix = context.Writer.LookupPrefix (@namespace); } var id = PropertyName.CreateForElement (name, prefix); if (context.Context.IncludesElement (id)) { if (context.Context.Type == Type) { context = CreateContext (context.Writer, context.Context.GetNestedContext (id)); } serializer (obj, context); } }; } else { return serializer; } } } } UpdateTextWriter.cs0000664000175000017500000001147411707010776042651 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.Xml// // UpdateTextWriter.cs // // Author: // Scott Peterson // // Copyright (c) 2010 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.IO; using System.Text; namespace Mono.Upnp.Dcp.MediaServer1.Xml { public class UpdateTextWriter : TextWriter { readonly TextWriter text_writer; public UpdateTextWriter (TextWriter textWriter) { if (textWriter == null) { throw new ArgumentNullException ("textWriter"); } text_writer = textWriter; } public override Encoding Encoding { get { return text_writer.Encoding; } } public override void Write (char value) { if (value == ',') { text_writer.Write ('\\'); } text_writer.Write (value); } public override void Write (char[] buffer, int index, int count) { if (buffer == null) { throw new ArgumentNullException ("buffer"); } else if (index < 0) { throw new ArgumentOutOfRangeException ("index", "The index is less than zero."); } else if (count < 0) { throw new ArgumentOutOfRangeException ("count", "The count is less than zero."); } var limit = count + index; if (limit > buffer.Length) { throw new ArgumentException ("The index and count go beyond the length of the buffer."); } var comma_count = 0; for (var i = index; i < limit; i++) { if (buffer[i] == ',') { comma_count++; } } if (comma_count == 0) { text_writer.Write (buffer, index, count); } else { var new_buffer = new char[count + comma_count]; for (int i = index, j = 0; i < limit; i++, j++) { if (buffer[i] == ',') { new_buffer[j] = '\\'; j++; } new_buffer[j] = buffer[i]; } text_writer.Write (new_buffer); } } public override void Write (char[] buffer) { if (buffer == null) throw new ArgumentNullException ("buffer"); Write (buffer, 0, buffer.Length); } public override void Write (string value) { if (value != null) { text_writer.Write (Escape (value)); } } public override void Flush () { text_writer.Flush (); } public override void Close () { text_writer.Close (); } protected override void Dispose (bool disposing) { if (disposing) { text_writer.Dispose (); } } static string Escape (string source) { var tail = source.IndexOf (','); if (tail != -1) { var head = 0; var builder = new StringBuilder (source.Length + 1); do { builder.Append (source, head, tail - head); builder.Append (@"\,"); head = tail + 1; tail = source.IndexOf (',', head); } while (tail != -1); if (head != source.Length) { builder.Append (source, head, source.Length - head); } return builder.ToString (); } else { return source; } } } } UpdateContext.cs0000664000175000017500000000533211707010776042150 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.Xml// // UpdateContext.cs // // Author: // Scott Peterson // // Copyright (c) 2010 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.IO; using System.Text; using System.Xml; namespace Mono.Upnp.Dcp.MediaServer1.Xml { public class UpdateContext { readonly object other_value; readonly Stream stream; byte[] delineator; bool delineated; public UpdateContext () { } public UpdateContext (object otherValue, Stream stream, Encoding encoding) { if (otherValue == null) { throw new ArgumentNullException ("otherValue"); } else if (stream == null) { throw new ArgumentNullException ("stream"); } else if (encoding == null) { throw new ArgumentNullException ("encoding"); } this.other_value = otherValue; this.stream = stream; this.delineator = encoding.GetBytes (","); } public object OtherValue { get { return other_value; } } public bool Delineated { get { return delineated; } } public void DelineateUpdate () { if (stream == null) { throw new InvalidOperationException ( "You cannot call DelineateUpdate unless a Stream and Encoding were passed to the constructor."); } if (delineated) { stream.Write (delineator, 0, delineator.Length); } else { delineated = true; } } } } UpdateXmlSerializer.cs0000664000175000017500000000562011707010776043316 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.Xml// // UpdateXmlSerializer.cs // // Author: // Scott Peterson // // Copyright (c) 2010 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.IO; using System.Text; using System.Xml; using Mono.Upnp.Internal; using Mono.Upnp.Xml; using Mono.Upnp.Xml.Compilation; namespace Mono.Upnp.Dcp.MediaServer1.Xml { public class UpdateXmlSerializer { readonly XmlSerializer xml_serializer; public UpdateXmlSerializer () : this (null) { } public UpdateXmlSerializer (SerializationCompilerProvider compilerProvider) { if (compilerProvider == null) { compilerProvider = (serializer, type) => new UpdateDelegateSerializationCompiler (serializer, type); } this.xml_serializer = new XmlSerializer (compilerProvider); } public bool Serialize (T obj1, T obj2, Stream stream) { return Serialize (obj1, obj2, stream, null); } public bool Serialize (T obj1, T obj2, Stream stream, XmlSerializationOptions options) { if (stream == null) { throw new ArgumentNullException ("stream"); } var encoding = options != null ? options.Encoding ?? Helper.UTF8Unsigned : Helper.UTF8Unsigned; var update_writer = new UpdateTextWriter (new StreamWriter (stream, encoding)); var context = new UpdateContext (obj2, stream, encoding); using (var xml_writer = XmlWriter.Create (update_writer, new XmlWriterSettings { Encoding = encoding, OmitXmlDeclaration = true })) { xml_serializer.Serialize (obj1, xml_writer, context); } return context.Delineated; } } } FilteringContext.cs0000664000175000017500000000742111707010776042652 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.Xml// // FilteringContext.cs // // Author: // Scott Peterson // // Copyright (c) 2010 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; namespace Mono.Upnp.Dcp.MediaServer1.Xml { public class FilteringContext { readonly Type type; readonly ICollection elements; readonly ICollection attributes; readonly string nested_property_name; public FilteringContext (Type type, ICollection properties) { if (type == null) { throw new ArgumentNullException ("type"); } this.type = type; if (properties == null) { this.elements = new string[0]; this.attributes = new string[0]; } else if (!properties.Contains ("*")) { elements = new List (); attributes = new List (); foreach (var property in properties) { var aeropostal = property.IndexOf ('@'); if (aeropostal == -1) { elements.Add (property); } else { // TODO include the element if it's not present? attributes.Add (property); } } } } FilteringContext (Type type, ICollection elements, ICollection attributes, string nestedPropertyName) { this.type = type; this.elements = elements; this.attributes = attributes; this.nested_property_name = nestedPropertyName; } public bool IncludesElement (string element) { return IncludesProperty (elements, element); } public bool IncludesAttribute (string attribute) { return IncludesProperty (attributes, attribute); } static bool IncludesProperty (ICollection collection, string property) { if (collection == null) { return true; } else { return collection.Contains (property); } } internal Type Type { get { return type; } } internal bool IsNested { get { return nested_property_name != null; } } internal string NestedPropertyName { get { return nested_property_name; } } internal FilteringContext GetNestedContext (string nestedPropertyname) { return new FilteringContext (type, elements, attributes, nestedPropertyname); } } } VirtualDelegateSerializationCompiler.cs0000664000175000017500000000664311707010776046701 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.Xml// // VirtualDelegateSerializationCompiler.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using System.Reflection; using Mono.Upnp.Xml; using Mono.Upnp.Xml.Compilation; namespace Mono.Upnp.Dcp.MediaServer1.Xml { public class VirtualDelegateSerializationCompiler : DelegateSerializationCompiler { public VirtualDelegateSerializationCompiler (XmlSerializer xmlSerializer, Type type) : base (xmlSerializer, type) { } protected override Serializer CreateAttributeSerializer (PropertyInfo property, XmlAttributeAttribute attributeAttribute) { var name = string.IsNullOrEmpty (attributeAttribute.Name) ? property.Name : attributeAttribute.Name; var @namespace = attributeAttribute.Namespace; var serializer = base.CreateAttributeSerializer (property, attributeAttribute); return CreateSerializer (name, @namespace, serializer); } protected override Serializer CreateElementSerializer (PropertyInfo property, XmlElementAttribute elementAttribute) { var name = string.IsNullOrEmpty (elementAttribute.Name) ? property.Name : elementAttribute.Name; var @namespace = elementAttribute.Namespace; var serializer = base.CreateElementSerializer (property, elementAttribute); return CreateSerializer (name, @namespace, serializer); } static Serializer CreateSerializer (string name, string @namespace, Serializer serializer) { return (obj, context) => { foreach (var @override in context.Context.Overrides) { if (@override.Name == name && @override.Namespace == @namespace) { serializer (@override.Value, context); return; } } serializer (obj, context); }; } } } Override.cs0000664000175000017500000000341111707010776041134 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.Xml// // Override.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using Mono.Upnp.Xml; using Mono.Upnp.Xml.Compilation; namespace Mono.Upnp.Dcp.MediaServer1.Xml { public class Override { public Override (object value, string name) : this (value, name, null) { } public Override (object value, string name, string @namespace) { Value = value; Name = name; Namespace = @namespace; } public string Name { get; private set; } public string Namespace { get; private set; } public object Value { get; private set; } } } PropertyName.cs0000664000175000017500000000362111707010776042005 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.Xml// // PropertyName.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Reflection; namespace Mono.Upnp.Dcp.MediaServer1.Xml { public class PropertyName { public static string CreateForAttribute (string name, string prefix, string nestedName) { if (string.IsNullOrEmpty (prefix)) { return string.Concat (nestedName, "@", name); } else { return string.Concat (nestedName, "@", prefix, ":", name); } } public static string CreateForElement (string name, string prefix) { if (string.IsNullOrEmpty (prefix)) { return name; } else { return string.Concat (prefix, ":", name); } } } } UpdateDelegateSerializationCompiler.cs0000664000175000017500000002124411707010776046467 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.Xml// // UpdateDelegateSerializationCompiler.cs // // Author: // Scott Peterson // // Copyright (c) 2010 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections; using System.Collections.Generic; using System.Reflection; using Mono.Upnp.Xml; using Mono.Upnp.Xml.Compilation; namespace Mono.Upnp.Dcp.MediaServer1.Xml { public class UpdateDelegateSerializationCompiler : DelegateSerializationCompiler { static object[] empty_args = new object[0]; public UpdateDelegateSerializationCompiler (XmlSerializer xmlSerializer, Type type) : base (xmlSerializer, type) { } protected override Serializer CreateTypeStartAutoSerializer (string name, string @namespace, string prefix, IEnumerable namespaces) { var type_start_auto_serializer = base.CreateTypeStartAutoSerializer (name, @namespace, prefix, namespaces); return (obj, context) => { if (context.Context == null) { throw new InvalidOperationException ("You must provide an UpdateContext to the serializer."); } var other_obj = context.Context.OtherValue; if (other_obj != null) { if (!Type.IsAssignableFrom (other_obj.GetType ())) { throw new InvalidOperationException ( "Two object must be serialize as a common compatable type for an update."); } } else { type_start_auto_serializer (obj, context); } }; } protected override Serializer CreateTypeEndAutoSerializer () { var type_end_auto_serializer = base.CreateTypeEndAutoSerializer (); return (obj, context) => { if (context.Context.OtherValue == null) { type_end_auto_serializer (obj, context); } }; } protected override Serializer CreateSerializer (PropertyInfo property, Serializer serializer) { var serializerDelegate = base.CreateSerializer (property, serializer); if (property.GetCustomAttributes (typeof (XmlArrayItemAttribute), false).Length != 0) { return serializerDelegate; } return (obj, context) => { var other_obj = context.Context.OtherValue; if (other_obj != null) { if (!object.Equals (property.GetValue (obj, empty_args), property.GetValue (other_obj, empty_args))) { context.Writer.Flush (); context.Context.DelineateUpdate (); serializerDelegate (obj, CreateContext (context.Writer, new UpdateContext ())); } } else { serializerDelegate (obj, context); } }; } protected override Serializer CreateArrayItemSerializer (PropertyInfo property) { var item_type = GetIEnumerable (property.PropertyType).GetGenericArguments ()[0]; var serializer = GetCompilerForType (item_type).TypeSerializer; Serializer item_serializer = (obj, context) => serializer (obj, CreateContext (context.Writer, new UpdateContext ())); return CreateArrayItemSerializer (property, item_serializer); } protected override Serializer CreateArrayItemSerializer (PropertyInfo property, string name, string @namespace, string prefix) { var item_type = GetIEnumerable (property.PropertyType).GetGenericArguments ()[0]; var serializer = GetCompilerForType (item_type).MemberSerializer; Serializer item_serializer = (obj, context) => { context.Writer.WriteStartElement (prefix, name, @namespace); serializer (obj, CreateContext (context.Writer, new UpdateContext ())); context.Writer.WriteEndElement (); }; return CreateArrayItemSerializer (property, item_serializer); } static Serializer CreateArrayItemSerializer (PropertyInfo property, Serializer serializer) { return (obj, context) => { var other_obj = context.Context.OtherValue; if (other_obj != null) { var other_enumerable = property.GetValue (other_obj, empty_args) as IEnumerable; if (other_enumerable == null) { if (obj != null) { foreach (var item in (IEnumerable)obj) { context.Writer.Flush (); context.Context.DelineateUpdate (); serializer (item, context); } } } else if (obj == null) { context.Writer.Flush (); var other_enumerator = other_enumerable.GetEnumerator (); while (other_enumerator.MoveNext ()) { context.Context.DelineateUpdate (); } } else { var enumerator = ((IEnumerable)obj).GetEnumerator (); var other_enumerator = other_enumerable.GetEnumerator (); while (enumerator.MoveNext ()) { if (other_enumerator.MoveNext ()) { if (!Object.Equals (enumerator.Current, other_enumerator.Current)) { context.Writer.Flush (); context.Context.DelineateUpdate (); if (enumerator.Current != null) { serializer (enumerator.Current, context); } } } else { context.Writer.Flush (); context.Context.DelineateUpdate (); serializer (enumerator.Current, context); } } while (other_enumerator.MoveNext ()) { context.Writer.Flush (); context.Context.DelineateUpdate (); } } } else if (obj != null) { foreach (var item in (IEnumerable)obj) { context.Writer.Flush (); context.Context.DelineateUpdate (); serializer (item, context); } } }; } } } VirtualContext.cs0000664000175000017500000000346611707010776042362 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.Xml// // VirtualContext.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; namespace Mono.Upnp.Dcp.MediaServer1.Xml { public class VirtualContext { public VirtualContext () : this (null) { } public VirtualContext (params Override[] overrides) : this ((IEnumerable)overrides) { } public VirtualContext (IEnumerable overrides) { if (overrides == null) { overrides = new Override[0]; } Overrides = overrides; } public IEnumerable Overrides { get; private set; } } } Mono.Upnp.Dcp.MediaServer1.ConnectionManager1/0000775000175000017500000000000011714005363041734 5ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1ConnectionManager.cs0000664000175000017500000001010211707010776045655 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ConnectionManager1// // ConnectionManager.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using Mono.Upnp.Control; namespace Mono.Upnp.Dcp.MediaServer1.ConnectionManager1 { public abstract class ConnectionManager { public static readonly ServiceType ServiceType = new ServiceType ("schemas-upnp-org", "ConnectionManager", new Version (1, 0)); [UpnpAction] public virtual void GetProtocolInfo ([UpnpArgumentAttribute ("Source")] [UpnpRelatedStateVariable ("SourceProtocolInfo")] out string source, [UpnpArgument ("Sink")] [UpnpRelatedStateVariable ("SinkProtocolInfo")] out string sink) { GetProtocolInfoCore (out source, out sink); } protected abstract void GetProtocolInfoCore (out string source, out string sink); [UpnpAction] public virtual void GetCurrentConnectionIDs ([UpnpArgument ("ConnectionIDs"), UpnpRelatedStateVariable ("CurrentConnectionIDs")] out string connectionIds) { connectionIds = CurrentConnectionIDs; } protected abstract string CurrentConnectionIDs { get; } [UpnpAction] public virtual void GetCurrentConnectionInfo ([UpnpArgument ("ConnectionID")] int connectionId, [UpnpArgument ("ResID")] out int resId, [UpnpArgument ("AVTransportID")] out int avTransportId, [UpnpArgument ("ProtocolInfo")] out string protocolInfo, [UpnpArgument ("PeerConnectionManager")] [UpnpRelatedStateVariable ("A_ARG_TYPE_ConnectionManager")] out string peerConnectionManager, [UpnpArgument ("PeerConnectionID")] [UpnpRelatedStateVariable ("A_ARG_TYPE_ConnectionID")] out int peerConnectionId, [UpnpArgument ("Direction")] out Direction direction, [UpnpArgument ("Status")] out ConnectionStatus status) { GetCurrentConnectionInfoCore (connectionId, out resId, out avTransportId, out protocolInfo, out peerConnectionManager, out peerConnectionId, out direction, out status); } protected abstract void GetCurrentConnectionInfoCore (int connectionId, out int resId, out int avTransportId, out string protocolInfo, out string peerConnectionManager, out int peerConnectionId, out Direction direction, out ConnectionStatus status); } } Direction.cs0000664000175000017500000000031511707010776044210 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ConnectionManager1// Direction.cs auto-generated at 1/17/2009 8:08:37 PM by Sharpener namespace Mono.Upnp.Dcp.MediaServer1.ConnectionManager1 { public enum Direction { Input, Output } }ConnectionStatus.cs0000664000175000017500000000046511707010776045601 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ConnectionManager1// ConnectionStatus.cs auto-generated at 1/17/2009 8:08:37 PM by Sharpener namespace Mono.Upnp.Dcp.MediaServer1.ConnectionManager1 { public enum ConnectionStatus { OK, ContentFormatMismatch, InsufficientBandwidth, UnreliableChannel, Unknown } }ConnectionManagerController.cs0000664000175000017500000001466311707010776047741 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ConnectionManager1// ConnectionManagerController.cs auto-generated at 1/18/2009 9:31:12 PM by Sharpener using System; using System.Collections.Generic; using Mono.Upnp; using Mono.Upnp.Control; namespace Mono.Upnp.Dcp.MediaServer1.ConnectionManager1 { public class ConnectionManagerController { readonly ServiceController controller; public ConnectionManagerController (ServiceAnnouncement announcement) { if (announcement == null) throw new ArgumentNullException ("announcement"); controller = announcement.GetService ().GetController (); Verify (); } public void GetProtocolInfo (out string source, out string sink) { var action_result = controller.Actions["GetProtocolInfo"].Invoke (); source = action_result["Source"]; sink = action_result["Sink"]; } public bool CanPrepareForConnection { get { return controller.Actions.ContainsKey ("PrepareForConnection"); } } public void PrepareForConnection (string remoteProtocolInfo, string peerConnectionManager, int peerConnectionID, Direction direction, out string connectionID, out string aVTransportID, out string rcsID) { if (!CanPrepareForConnection) throw new NotImplementedException (); Dictionary in_arguments = new Dictionary (4); in_arguments.Add ("RemoteProtocolInfo", remoteProtocolInfo); in_arguments.Add ("PeerConnectionManager", peerConnectionManager); in_arguments.Add ("PeerConnectionID", peerConnectionID.ToString ()); in_arguments.Add ("Direction", direction.ToString ()); var action_result = controller.Actions["PrepareForConnection"].Invoke (in_arguments); connectionID = action_result["ConnectionID"]; aVTransportID = action_result["AVTransportID"]; rcsID = action_result["RcsID"]; } public bool CanConnectionComplete { get { return controller.Actions.ContainsKey ("ConnectionComplete"); } } public void ConnectionComplete (int connectionID) { if (!CanConnectionComplete) throw new NotImplementedException (); Dictionary in_arguments = new Dictionary (1); in_arguments.Add ("ConnectionID", connectionID.ToString ()); controller.Actions["ConnectionComplete"].Invoke (in_arguments); } public string GetCurrentConnectionIDs () { var action_result = controller.Actions["GetCurrentConnectionIDs"].Invoke (); return action_result["ConnectionIDs"]; } public void GetCurrentConnectionInfo (int connectionID, out string rcsID, out string aVTransportID, out string protocolInfo, out string peerConnectionManager, out string peerConnectionID, out string direction, out string status) { Dictionary in_arguments = new Dictionary (1); in_arguments.Add ("ConnectionID", connectionID.ToString ()); var action_result = controller.Actions["GetCurrentConnectionInfo"].Invoke (in_arguments); rcsID = action_result["RcsID"]; aVTransportID = action_result["AVTransportID"]; protocolInfo = action_result["ProtocolInfo"]; peerConnectionManager = action_result["PeerConnectionManager"]; peerConnectionID = action_result["PeerConnectionID"]; direction = action_result["Direction"]; status = action_result["Status"]; } // public event EventHandler> SourceProtocolInfoChanged // { // add { controller.StateVariables["SourceProtocolInfo"].Changed += value; } // remove { controller.StateVariables["SourceProtocolInfo"].Changed -= value; } // } // // public event EventHandler> SinkProtocolInfoChanged // { // add { controller.StateVariables["SinkProtocolInfo"].Changed += value; } // remove { controller.StateVariables["SinkProtocolInfo"].Changed -= value; } // } // // public event EventHandler> CurrentConnectionIDsChanged // { // add { controller.StateVariables["CurrentConnectionIDs"].Changed += value; } // remove { controller.StateVariables["CurrentConnectionIDs"].Changed -= value; } // } void Verify () { // if (!controller.Actions.ContainsKey ("GetProtocolInfo")) throw new UpnpDeserializationException (String.Format ("The service {0} claims to be of type urn:schemas-upnp-org:service:ConnectionManager:1 but it does not have the required action GetProtocolInfo.", controller.Description.Id)); // if (!controller.Actions.ContainsKey ("GetCurrentConnectionIDs")) throw new UpnpDeserializationException (String.Format ("The service {0} claims to be of type urn:schemas-upnp-org:service:ConnectionManager:1 but it does not have the required action GetCurrentConnectionIDs.", controller.Description.Id)); // if (!controller.Actions.ContainsKey ("GetCurrentConnectionInfo")) throw new UpnpDeserializationException (String.Format ("The service {0} claims to be of type urn:schemas-upnp-org:service:ConnectionManager:1 but it does not have the required action GetCurrentConnectionInfo.", controller.Description.Id)); // if (!controller.StateVariables.ContainsKey ("SourceProtocolInfo")) throw new UpnpDeserializationException (String.Format ("The service {0} claims to be of type urn:schemas-upnp-org:service:ConnectionManager:1 but it does not have the required state variable SourceProtocolInfo.", controller.Description.Id)); // if (!controller.StateVariables.ContainsKey ("SinkProtocolInfo")) throw new UpnpDeserializationException (String.Format ("The service {0} claims to be of type urn:schemas-upnp-org:service:ConnectionManager:1 but it does not have the required state variable SinkProtocolInfo.", controller.Description.Id)); // if (!controller.StateVariables.ContainsKey ("CurrentConnectionIDs")) throw new UpnpDeserializationException (String.Format ("The service {0} claims to be of type urn:schemas-upnp-org:service:ConnectionManager:1 but it does not have the required state variable CurrentConnectionIDs.", controller.Description.Id)); } } }ProtocolInfo.cs0000664000175000017500000000742711707010776044720 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ConnectionManager1// // ProtocolInfo.cs // // Author: // Yavor Georgiev // // Copyright (c) 2010 Yavor Georgiev // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; namespace Mono.Upnp.Dcp.MediaServer1.ConnectionManager1 { public class ProtocolInfo { public ProtocolInfo (string protocol) { if (string.IsNullOrEmpty (protocol) || protocol == "*") { throw new ArgumentException ("Protocol must be defined.", "protocol"); } this.Protocol = protocol; } public ProtocolInfo (string protocol, string contentFormat) : this (protocol) { ContentFormat = contentFormat; } public ProtocolInfo (string protocol, string network, string contentFormat, string additionalInfo) : this (protocol, contentFormat) { Network = network; AdditionalInfo = additionalInfo; } public string Protocol { get; private set; } public string Network { get; private set; } public string ContentFormat { get; private set; } public string AdditionalInfo { get; private set; } public override string ToString () { var network = string.IsNullOrEmpty (Network) ? "*" : Network; var content_format = string.IsNullOrEmpty (ContentFormat) ? "*" : ContentFormat; var additional_info = string.IsNullOrEmpty (AdditionalInfo) ? "*" : AdditionalInfo; return string.Format ("{0}:{1}:{2}:{3}", Protocol, network, content_format, additional_info); } public static ProtocolInfo Parse (string text) { if (text == null) { throw new ArgumentNullException ("text"); } var tokens = text.Split (':'); if (tokens.Length != 4) { throw new ArgumentException ("text", @"The string must be of the form ""protocol:network:contentFormat:additionalInfo""."); } var result = new ProtocolInfo (tokens [0]); if (!string.IsNullOrEmpty (tokens [1]) && tokens [1] != "*") { result.Network = tokens [1]; } if (!string.IsNullOrEmpty (tokens [2]) && tokens [2] != "*") { result.ContentFormat = tokens [2]; } if (!string.IsNullOrEmpty (tokens [3]) && tokens [3] != "*") { result.AdditionalInfo = tokens [3]; } return result; } } public static class Protocols { public const string HttpGet = "http-get"; public const string RtspUdp = "rtsp-rtp-udp"; public const string Internal = "internal"; public const string IEC61883 = "iec61883"; } } ConnectionManagerClient.cs0000664000175000017500000000274611714005363047025 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ConnectionManager1// ConnectionManager1.cs auto-generated at 1/17/2009 8:08:37 PM by Sharpener using System; namespace Mono.Upnp.Dcp.MediaServer1.ConnectionManager1 { public class ConnectionManagerClient { readonly Client client; public ConnectionManagerClient () : this (new Client ()) { } public ConnectionManagerClient (Client client) { if (client == null) throw new ArgumentNullException ("client"); this.client = client; client.ServiceAdded += ClientServiceAdded; } public Client Client { get { return client; } } void ClientServiceAdded (object sender, ServiceEventArgs args) { if (args.Service.Type != ConnectionManager.ServiceType) return; try { //ConnectionManager service = new ConnectionManager (args.Service); //OnConnectionManagerAdded (service); } catch { } } public void Browse () { client.Browse (ConnectionManager.ServiceType); } /*void OnConnectionManagerAdded (ConnectionManager service) { EventHandler> handler = ConnectionManagerAdded; if (handler != null) { handler (this, new DiscoveryEventArgs (service)); } }*/ } }Mono.Upnp.Dcp.MediaServer1.Internal/0000775000175000017500000000000011761734020040036 5ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1StripedCollection.cs0000664000175000017500000000627311707010776044030 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.Internal// // StripedCollection.cs // // Author: // Scott Peterson // // Copyright (c) 2010 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections; using System.Collections.Generic; namespace Mono.Upnp.Dcp.MediaServer1.Internal { abstract class StripedCollection : ICollection { protected string[] StripedArray; protected StripedCollection (string[] striped_array) { StripedArray = striped_array; } protected abstract T GetValue (KeyValuePair keyValuePair); public IEnumerator GetEnumerator () { for (var i = 0; i < StripedArray.Length; i += 2) { yield return GetValue (new KeyValuePair (StripedArray[i], StripedArray[i + 1])); } } IEnumerator IEnumerable.GetEnumerator () { return GetEnumerator(); } public void Add (T item) { throw new NotSupportedException (); } public void Clear () { throw new NotSupportedException (); } public bool Contains (T item) { foreach (var keyValuePair in this) { if (keyValuePair.Equals (item)) { return true; } } return false; } public void CopyTo (T[] array, int arrayIndex) { if (arrayIndex + Count >= array.Length) { throw new ArgumentException ("The array is too small."); } foreach (var keyValuePair in this) { array[arrayIndex] = keyValuePair; arrayIndex++; } } public bool Remove (T item) { throw new NotSupportedException (); } public int Count { get { return StripedArray.Length / 2; } } public bool IsReadOnly { get { return true; } } } } Arguments.cs0000664000175000017500000000753711707010776042353 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.Internal// // Arguments.cs // // Author: // Scott Peterson // // Copyright (c) 2010 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections; using System.Collections.Generic; namespace Mono.Upnp.Dcp.MediaServer1.Internal { class Arguments : StripedCollection>, IDictionary { public Arguments (params string[] keyValuePairs) : base (keyValuePairs) { } public void Add (string key, string value) { throw new NotSupportedException (); } public bool ContainsKey (string key) { string value; return TryGetValue (key, out value); } public bool Remove (string key) { return false; } public bool TryGetValue (string key, out string value) { for (var i = 0; i < StripedArray.Length; i += 2) { if (StripedArray[i] == key) { value = StripedArray[i + 1]; return true; } } value = null; return false; } public string this[string key] { get { string value; if (TryGetValue (key, out value)) { return value; } else { throw new KeyNotFoundException (); } } set { throw new NotSupportedException (); } } public ICollection Keys { get { return new KeyCollection (StripedArray); } } public ICollection Values { get { return new ValueCollection (StripedArray); } } protected override KeyValuePair GetValue (KeyValuePair keyValuePair) { return keyValuePair; } class KeyCollection : StripedCollection { public KeyCollection (string[] stripedArray) : base (stripedArray) { } protected override string GetValue (KeyValuePair keyValuePair) { return keyValuePair.Key; } } class ValueCollection : StripedCollection { public ValueCollection (string[] stripedArray) : base (stripedArray) { } protected override string GetValue (KeyValuePair keyValuePair) { return keyValuePair.Value; } } } } QueryStringifier.cs0000664000175000017500000001017611761734020043705 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.Internal// // QueryStringifier.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System.Text; using Mono.Upnp.Dcp.MediaServer1.ContentDirectory1; namespace Mono.Upnp.Dcp.MediaServer1.Internal { using Query = System.Action; class QueryStringifier : QueryVisitor { StringBuilder builder; public QueryStringifier (StringBuilder builder) { this.builder = builder; } public override void VisitEquals (string property, string value) { VisitPropertyOperator (property, "=", value); } public override void VisitDoesNotEqual (string property, string value) { VisitPropertyOperator (property, "!=", value); } public override void VisitLessThan (string property, string value) { VisitPropertyOperator (property, "<", value); } public override void VisitLessThanOrEqualTo (string property, string value) { VisitPropertyOperator (property, "<=", value); } public override void VisitGreaterThan (string property, string value) { VisitPropertyOperator (property, ">", value); } public override void VisitGreaterThanOrEqualTo (string property, string value) { VisitPropertyOperator (property, ">=", value); } public override void VisitContains (string property, string value) { VisitPropertyOperator (property, "contains", value); } public override void VisitDoesNotContain (string property, string value) { VisitPropertyOperator (property, "doesNotContain", value); } public override void VisitDerivedFrom (string property, string value) { VisitPropertyOperator (property, "derivedfrom", value); } public override void VisitExists (string property, bool value) { VisitPropertyOperator (property, "exists", value ? "true" : "false"); } public override void VisitAnd (Query leftOperand, Query rightOperand) { VisitBinaryOperator (leftOperand, "and", rightOperand); } public override void VisitOr (Query leftOperand, Query rightOperand) { VisitBinaryOperator (leftOperand, "or", rightOperand); } void VisitPropertyOperator (string property, string @operator, string value) { builder.Append (property); builder.Append (' '); builder.Append (@operator); builder.Append (@" """); builder.Append (value); builder.Append ('"'); } void VisitBinaryOperator (Query leftOperand, string @operator, Query rightOperand) { builder.Append ('('); leftOperand (this); builder.Append (' '); builder.Append (@operator); builder.Append (' '); rightOperand (this); builder.Append (')'); } } } BrowseResults.cs0000664000175000017500000000430711707010776043221 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.Internal// // BrowseResults.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using Mono.Upnp.Dcp.MediaServer1.ContentDirectory1; namespace Mono.Upnp.Dcp.MediaServer1.Internal { sealed class BrowseResults : Results { public BrowseResults (Container container, string sortCriteria, string filter, uint requestCount, uint offset, uint totalCount, IList results) : base (container, sortCriteria, filter, requestCount, offset, totalCount, results) { } protected override Results GetMoreResults (RemoteContentDirectory contentDirectory, ResultsSettings settings) { if (contentDirectory == null) { throw new ArgumentNullException ("contentDirectory"); } return contentDirectory.GetChildren (Container, settings); } } } SearchResults.cs0000664000175000017500000000457611707010776043175 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.Internal// // SearchResults.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using Mono.Upnp.Dcp.MediaServer1.ContentDirectory1; namespace Mono.Upnp.Dcp.MediaServer1.Internal { sealed class SearchResults : Results { public SearchResults (Container container, Action query, string sortCriteria, string filter, uint requestCount, uint offset, uint totalCount, IList results) : base (container, sortCriteria, filter, requestCount, offset, totalCount, results) { Query = query; } public Action Query { get; private set; } protected override Results GetMoreResults (RemoteContentDirectory contentDirectory, ResultsSettings settings) { if (contentDirectory == null) { throw new ArgumentNullException ("contentDirectory"); } return contentDirectory.Search (Container, Query, settings); } } } Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer/0000775000175000017500000000000011761740037036317 5ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1Makefile.am0000664000175000017500000001360411715013277040355 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer EXTRA_DIST = # Warning: This is an automatically generated file, do not edit! if ENABLE_DEBUG ASSEMBLY_COMPILER_COMMAND = gmcs ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug "-define:DEBUG" ASSEMBLY = ../../../../bin/Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer.exe ASSEMBLY_MDB = $(ASSEMBLY).mdb COMPILE_TARGET = exe PROJECT_REFERENCES = \ ../../../../bin/Mono.Upnp.Dcp.MediaServer1.FileSystem.dll \ ../../../../bin/Mono.Upnp.Dcp.MediaServer1.dll \ ../../../../bin/Mono.Upnp.dll \ ../../../../bin/Mono.Upnp.Dcp.MSMediaReceiverRegistrar1.dll BUILD_DIR = ../../../../bin MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_CONSOLESERVER_EXE_MDB_SOURCE=../../../../bin/Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer.exe.mdb MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_CONSOLESERVER_EXE_MDB=$(BUILD_DIR)/Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer.exe.mdb MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_DLL_SOURCE=../../../../bin/Mono.Upnp.Dcp.MediaServer1.FileSystem.dll MONO_UPNP_DCP_MEDIASERVER1_DLL_SOURCE=../../../../bin/Mono.Upnp.Dcp.MediaServer1.dll MONO_UPNP_DLL_SOURCE=../../../../bin/Mono.Upnp.dll MONO_SSDP_DLL_SOURCE=../../../../bin/Mono.Ssdp.dll MONO_SSDP_DLL_MDB_SOURCE=../../../../bin/Mono.Ssdp.dll.mdb MONO_SSDP_DLL_MDB=$(BUILD_DIR)/Mono.Ssdp.dll.mdb MONO_UPNP_DLL_MDB_SOURCE=../../../../bin/Mono.Upnp.dll.mdb MONO_UPNP_DLL_MDB=$(BUILD_DIR)/Mono.Upnp.dll.mdb MONO_UPNP_DCP_MEDIASERVER1_DLL_MDB_SOURCE=../../../../bin/Mono.Upnp.Dcp.MediaServer1.dll.mdb MONO_UPNP_DCP_MEDIASERVER1_DLL_MDB=$(BUILD_DIR)/Mono.Upnp.Dcp.MediaServer1.dll.mdb MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_DLL_MDB_SOURCE=../../../../bin/Mono.Upnp.Dcp.MediaServer1.FileSystem.dll.mdb MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_DLL_MDB=$(BUILD_DIR)/Mono.Upnp.Dcp.MediaServer1.FileSystem.dll.mdb MONO_UPNP_DCP_MSMEDIARECEIVERREGISTRAR1_DLL_SOURCE=../../../../bin/Mono.Upnp.Dcp.MSMediaReceiverRegistrar1.dll MONO_UPNP_DCP_MSMEDIARECEIVERREGISTRAR1_DLL=$(BUILD_DIR)/Mono.Upnp.Dcp.MSMediaReceiverRegistrar1.dll MONO_UPNP_DCP_MSMEDIARECEIVERREGISTRAR1_DLL_MDB_SOURCE=../../../../bin/Mono.Upnp.Dcp.MSMediaReceiverRegistrar1.dll.mdb MONO_UPNP_DCP_MSMEDIARECEIVERREGISTRAR1_DLL_MDB=$(BUILD_DIR)/Mono.Upnp.Dcp.MSMediaReceiverRegistrar1.dll.mdb MSMEDIASERVERREGISTRAR1_DLL= endif if ENABLE_RELEASE ASSEMBLY_COMPILER_COMMAND = gmcs ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ ASSEMBLY = ../../../../bin/Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer.exe ASSEMBLY_MDB = COMPILE_TARGET = exe PROJECT_REFERENCES = \ ../../../../bin/Mono.Upnp.Dcp.MediaServer1.FileSystem.dll \ ../../../../bin/Mono.Upnp.Dcp.MediaServer1.dll \ ../../../../bin/Mono.Upnp.dll \ ../Mono.Upnp.Dcp.MSMediaReceiverRegistrar1/MSMediaServerRegistrar1.dll BUILD_DIR = ../../../../bin MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_CONSOLESERVER_EXE_MDB= MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_DLL_SOURCE=../../../../bin/Mono.Upnp.Dcp.MediaServer1.FileSystem.dll MONO_UPNP_DCP_MEDIASERVER1_DLL_SOURCE=../../../../bin/Mono.Upnp.Dcp.MediaServer1.dll MONO_UPNP_DLL_SOURCE=../../../../bin/Mono.Upnp.dll MONO_SSDP_DLL_SOURCE=../../../../bin/Mono.Ssdp.dll MONO_SSDP_DLL_MDB= MONO_UPNP_DLL_MDB= MONO_UPNP_DCP_MEDIASERVER1_DLL_MDB= MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_DLL_MDB= MONO_UPNP_DCP_MSMEDIARECEIVERREGISTRAR1_DLL= MONO_UPNP_DCP_MSMEDIARECEIVERREGISTRAR1_DLL_MDB= MSMEDIASERVERREGISTRAR1_DLL_SOURCE=../Mono.Upnp.Dcp.MSMediaReceiverRegistrar1/MSMediaServerRegistrar1.dll MSMEDIASERVERREGISTRAR1_DLL=$(BUILD_DIR)/MSMediaServerRegistrar1.dll endif AL=al2 SATELLITE_ASSEMBLY_NAME=$(notdir $(basename $(ASSEMBLY))).resources.dll PROGRAMFILES = \ $(MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_CONSOLESERVER_EXE_MDB) \ $(MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_DLL) \ $(MONO_UPNP_DCP_MEDIASERVER1_DLL) \ $(MONO_UPNP_DLL) \ $(MONO_SSDP_DLL) \ $(MONO_SSDP_DLL_MDB) \ $(MONO_UPNP_DLL_MDB) \ $(MONO_UPNP_DCP_MEDIASERVER1_DLL_MDB) \ $(MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_DLL_MDB) \ $(MONO_UPNP_DCP_MSMEDIARECEIVERREGISTRAR1_DLL) \ $(MONO_UPNP_DCP_MSMEDIARECEIVERREGISTRAR1_DLL_MDB) \ $(MSMEDIASERVERREGISTRAR1_DLL) BINARIES = \ $(MONO_UPNP_SIMPLE_MEDIA_SERVER) RESGEN=resgen2 all: $(ASSEMBLY) $(PROGRAMFILES) $(BINARIES) FILES = \ AssemblyInfo.cs \ Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer/ConsoleServer.cs \ Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer/DummyConnectionManager.cs \ Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer/DummyMSMediaReceiverRegistrar.cs \ Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer/Options.cs DATA_FILES = RESOURCES = EXTRAS = \ Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer \ mono-upnp-simple-media-server.in REFERENCES = \ ../../../../bin/Mono.Upnp.Dcp.MediaServer1.dll \ ../../../../bin/Mono.Upnp.Dcp.MediaServer1.FileSystem.dll \ ../../../../bin/Mono.Upnp.Dcp.MSMediaReceiverRegistrar1.dll \ ../../../../bin/Mono.Upnp.dll \ System DLL_REFERENCES = CLEANFILES = $(PROGRAMFILES) $(BINARIES) include $(top_srcdir)/Makefile.include MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_DLL = $(BUILD_DIR)/Mono.Upnp.Dcp.MediaServer1.FileSystem.dll MONO_UPNP_DCP_MEDIASERVER1_DLL = $(BUILD_DIR)/Mono.Upnp.Dcp.MediaServer1.dll MONO_UPNP_DLL = $(BUILD_DIR)/Mono.Upnp.dll MONO_SSDP_DLL = $(BUILD_DIR)/Mono.Ssdp.dll MONO_UPNP_SIMPLE_MEDIA_SERVER = $(BUILD_DIR)/mono-upnp-simple-media-server $(eval $(call emit-deploy-wrapper,MONO_UPNP_SIMPLE_MEDIA_SERVER,mono-upnp-simple-media-server,x)) $(eval $(call emit-deploy-target,MSMEDIASERVERREGISTRAR1_DLL)) $(eval $(call emit_resgen_targets)) $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(ASSEMBLY_MDB): $(ASSEMBLY) $(ASSEMBLY): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(shell dirname $(ASSEMBLY)) $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) Makefile.in0000664000175000017500000007171711761736755040415 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/mono-upnp-simple-media-server.in \ $(top_srcdir)/Makefile.include subdir = src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/expansions.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = mono-upnp-simple-media-server CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(bindir)" \ "$(DESTDIR)$(assemblyfilesdir)" \ "$(DESTDIR)$(linuxpkgconfigdir)" \ "$(DESTDIR)$(programfilesdir)" SCRIPTS = $(bin_SCRIPTS) SOURCES = DIST_SOURCES = DATA = $(assemblyfiles_DATA) $(linuxpkgconfig_DATA) \ $(programfiles_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ GLADE_SHARP_20_CFLAGS = @GLADE_SHARP_20_CFLAGS@ GLADE_SHARP_20_LIBS = @GLADE_SHARP_20_LIBS@ GLIB_SHARP_20_CFLAGS = @GLIB_SHARP_20_CFLAGS@ GLIB_SHARP_20_LIBS = @GLIB_SHARP_20_LIBS@ GMCS = @GMCS@ GTK_SHARP_20_CFLAGS = @GTK_SHARP_20_CFLAGS@ GTK_SHARP_20_LIBS = @GTK_SHARP_20_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MONO_ADDINS_CFLAGS = @MONO_ADDINS_CFLAGS@ MONO_ADDINS_LIBS = @MONO_ADDINS_LIBS@ NUNIT_CFLAGS = @NUNIT_CFLAGS@ NUNIT_CMD = @NUNIT_CMD@ NUNIT_LIBS = @NUNIT_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TAGLIB_SHARP_CFLAGS = @TAGLIB_SHARP_CFLAGS@ TAGLIB_SHARP_LIBS = @TAGLIB_SHARP_LIBS@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_bindir = @expanded_bindir@ expanded_datadir = @expanded_datadir@ expanded_libdir = @expanded_libdir@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = $(build_sources) $(build_resx_files) \ $(build_others_files) $(ASSEMBLY_WRAPPER_IN) $(EXTRAS) \ $(DATA_FILES) $(build_culture_res_files) # Warning: This is an automatically generated file, do not edit! @ENABLE_DEBUG_TRUE@ASSEMBLY_COMPILER_COMMAND = gmcs @ENABLE_RELEASE_TRUE@ASSEMBLY_COMPILER_COMMAND = gmcs @ENABLE_DEBUG_TRUE@ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug "-define:DEBUG" @ENABLE_RELEASE_TRUE@ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ @ENABLE_DEBUG_TRUE@ASSEMBLY = ../../../../bin/Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer.exe @ENABLE_RELEASE_TRUE@ASSEMBLY = ../../../../bin/Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer.exe @ENABLE_DEBUG_TRUE@ASSEMBLY_MDB = $(ASSEMBLY).mdb @ENABLE_RELEASE_TRUE@ASSEMBLY_MDB = @ENABLE_DEBUG_TRUE@COMPILE_TARGET = exe @ENABLE_RELEASE_TRUE@COMPILE_TARGET = exe @ENABLE_DEBUG_TRUE@PROJECT_REFERENCES = \ @ENABLE_DEBUG_TRUE@ ../../../../bin/Mono.Upnp.Dcp.MediaServer1.FileSystem.dll \ @ENABLE_DEBUG_TRUE@ ../../../../bin/Mono.Upnp.Dcp.MediaServer1.dll \ @ENABLE_DEBUG_TRUE@ ../../../../bin/Mono.Upnp.dll \ @ENABLE_DEBUG_TRUE@ ../../../../bin/Mono.Upnp.Dcp.MSMediaReceiverRegistrar1.dll @ENABLE_RELEASE_TRUE@PROJECT_REFERENCES = \ @ENABLE_RELEASE_TRUE@ ../../../../bin/Mono.Upnp.Dcp.MediaServer1.FileSystem.dll \ @ENABLE_RELEASE_TRUE@ ../../../../bin/Mono.Upnp.Dcp.MediaServer1.dll \ @ENABLE_RELEASE_TRUE@ ../../../../bin/Mono.Upnp.dll \ @ENABLE_RELEASE_TRUE@ ../Mono.Upnp.Dcp.MSMediaReceiverRegistrar1/MSMediaServerRegistrar1.dll @ENABLE_DEBUG_TRUE@BUILD_DIR = ../../../../bin @ENABLE_RELEASE_TRUE@BUILD_DIR = ../../../../bin @ENABLE_DEBUG_TRUE@MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_CONSOLESERVER_EXE_MDB_SOURCE = ../../../../bin/Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer.exe.mdb @ENABLE_DEBUG_TRUE@MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_CONSOLESERVER_EXE_MDB = $(BUILD_DIR)/Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer.exe.mdb @ENABLE_RELEASE_TRUE@MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_CONSOLESERVER_EXE_MDB = @ENABLE_DEBUG_TRUE@MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_DLL_SOURCE = ../../../../bin/Mono.Upnp.Dcp.MediaServer1.FileSystem.dll @ENABLE_RELEASE_TRUE@MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_DLL_SOURCE = ../../../../bin/Mono.Upnp.Dcp.MediaServer1.FileSystem.dll @ENABLE_DEBUG_TRUE@MONO_UPNP_DCP_MEDIASERVER1_DLL_SOURCE = ../../../../bin/Mono.Upnp.Dcp.MediaServer1.dll @ENABLE_RELEASE_TRUE@MONO_UPNP_DCP_MEDIASERVER1_DLL_SOURCE = ../../../../bin/Mono.Upnp.Dcp.MediaServer1.dll @ENABLE_DEBUG_TRUE@MONO_UPNP_DLL_SOURCE = ../../../../bin/Mono.Upnp.dll @ENABLE_RELEASE_TRUE@MONO_UPNP_DLL_SOURCE = ../../../../bin/Mono.Upnp.dll @ENABLE_DEBUG_TRUE@MONO_SSDP_DLL_SOURCE = ../../../../bin/Mono.Ssdp.dll @ENABLE_RELEASE_TRUE@MONO_SSDP_DLL_SOURCE = ../../../../bin/Mono.Ssdp.dll @ENABLE_DEBUG_TRUE@MONO_SSDP_DLL_MDB_SOURCE = ../../../../bin/Mono.Ssdp.dll.mdb @ENABLE_DEBUG_TRUE@MONO_SSDP_DLL_MDB = $(BUILD_DIR)/Mono.Ssdp.dll.mdb @ENABLE_RELEASE_TRUE@MONO_SSDP_DLL_MDB = @ENABLE_DEBUG_TRUE@MONO_UPNP_DLL_MDB_SOURCE = ../../../../bin/Mono.Upnp.dll.mdb @ENABLE_DEBUG_TRUE@MONO_UPNP_DLL_MDB = $(BUILD_DIR)/Mono.Upnp.dll.mdb @ENABLE_RELEASE_TRUE@MONO_UPNP_DLL_MDB = @ENABLE_DEBUG_TRUE@MONO_UPNP_DCP_MEDIASERVER1_DLL_MDB_SOURCE = ../../../../bin/Mono.Upnp.Dcp.MediaServer1.dll.mdb @ENABLE_DEBUG_TRUE@MONO_UPNP_DCP_MEDIASERVER1_DLL_MDB = $(BUILD_DIR)/Mono.Upnp.Dcp.MediaServer1.dll.mdb @ENABLE_RELEASE_TRUE@MONO_UPNP_DCP_MEDIASERVER1_DLL_MDB = @ENABLE_DEBUG_TRUE@MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_DLL_MDB_SOURCE = ../../../../bin/Mono.Upnp.Dcp.MediaServer1.FileSystem.dll.mdb @ENABLE_DEBUG_TRUE@MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_DLL_MDB = $(BUILD_DIR)/Mono.Upnp.Dcp.MediaServer1.FileSystem.dll.mdb @ENABLE_RELEASE_TRUE@MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_DLL_MDB = @ENABLE_DEBUG_TRUE@MONO_UPNP_DCP_MSMEDIARECEIVERREGISTRAR1_DLL_SOURCE = ../../../../bin/Mono.Upnp.Dcp.MSMediaReceiverRegistrar1.dll @ENABLE_DEBUG_TRUE@MONO_UPNP_DCP_MSMEDIARECEIVERREGISTRAR1_DLL = $(BUILD_DIR)/Mono.Upnp.Dcp.MSMediaReceiverRegistrar1.dll @ENABLE_RELEASE_TRUE@MONO_UPNP_DCP_MSMEDIARECEIVERREGISTRAR1_DLL = @ENABLE_DEBUG_TRUE@MONO_UPNP_DCP_MSMEDIARECEIVERREGISTRAR1_DLL_MDB_SOURCE = ../../../../bin/Mono.Upnp.Dcp.MSMediaReceiverRegistrar1.dll.mdb @ENABLE_DEBUG_TRUE@MONO_UPNP_DCP_MSMEDIARECEIVERREGISTRAR1_DLL_MDB = $(BUILD_DIR)/Mono.Upnp.Dcp.MSMediaReceiverRegistrar1.dll.mdb @ENABLE_RELEASE_TRUE@MONO_UPNP_DCP_MSMEDIARECEIVERREGISTRAR1_DLL_MDB = @ENABLE_DEBUG_TRUE@MSMEDIASERVERREGISTRAR1_DLL = @ENABLE_RELEASE_TRUE@MSMEDIASERVERREGISTRAR1_DLL = $(BUILD_DIR)/MSMediaServerRegistrar1.dll @ENABLE_RELEASE_TRUE@MSMEDIASERVERREGISTRAR1_DLL_SOURCE = ../Mono.Upnp.Dcp.MSMediaReceiverRegistrar1/MSMediaServerRegistrar1.dll AL = al2 SATELLITE_ASSEMBLY_NAME = $(notdir $(basename $(ASSEMBLY))).resources.dll PROGRAMFILES = \ $(MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_CONSOLESERVER_EXE_MDB) \ $(MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_DLL) \ $(MONO_UPNP_DCP_MEDIASERVER1_DLL) \ $(MONO_UPNP_DLL) \ $(MONO_SSDP_DLL) \ $(MONO_SSDP_DLL_MDB) \ $(MONO_UPNP_DLL_MDB) \ $(MONO_UPNP_DCP_MEDIASERVER1_DLL_MDB) \ $(MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_DLL_MDB) \ $(MONO_UPNP_DCP_MSMEDIARECEIVERREGISTRAR1_DLL) \ $(MONO_UPNP_DCP_MSMEDIARECEIVERREGISTRAR1_DLL_MDB) \ $(MSMEDIASERVERREGISTRAR1_DLL) BINARIES = \ $(MONO_UPNP_SIMPLE_MEDIA_SERVER) RESGEN = resgen2 FILES = \ AssemblyInfo.cs \ Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer/ConsoleServer.cs \ Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer/DummyConnectionManager.cs \ Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer/DummyMSMediaReceiverRegistrar.cs \ Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer/Options.cs DATA_FILES = RESOURCES = EXTRAS = \ Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer \ mono-upnp-simple-media-server.in REFERENCES = \ ../../../../bin/Mono.Upnp.Dcp.MediaServer1.dll \ ../../../../bin/Mono.Upnp.Dcp.MediaServer1.FileSystem.dll \ ../../../../bin/Mono.Upnp.Dcp.MSMediaReceiverRegistrar1.dll \ ../../../../bin/Mono.Upnp.dll \ System DLL_REFERENCES = CLEANFILES = $(PROGRAMFILES) $(BINARIES) $(ASSEMBLY) $(ASSEMBLY).mdb \ $(BINARIES) $(build_resx_resources) \ $(build_satellite_assembly_list) VALID_CULTURES = ar bg ca zh-CHS cs da de el en es fi fr he hu is it ja ko nl no pl pt ro ru hr sk sq sv th tr id uk be sl et lv lt fa vi hy eu mk af ka fo hi sw gu ta te kn mr gl kok ar-SA bg-BG ca-ES zh-TW cs-CZ da-DK de-DE el-GR en-US fi-FI fr-FR he-IL hu-HU is-IS it-IT ja-JP ko-KR nl-NL nb-NO pl-PL pt-BR ro-RO ru-RU hr-HR sk-SK sq-AL sv-SE th-TH tr-TR id-ID uk-UA be-BY sl-SI et-EE lv-LV lt-LT fa-IR vi-VN hy-AM eu-ES mk-MK af-ZA ka-GE fo-FO hi-IN sw-KE gu-IN ta-IN te-IN kn-IN mr-IN gl-ES kok-IN ar-IQ zh-CN de-CH en-GB es-MX fr-BE it-CH nl-BE nn-NO pt-PT sv-FI ar-EG zh-HK de-AT en-AU es-ES fr-CA ar-LY zh-SG de-LU en-CA es-GT fr-CH ar-DZ zh-MO en-NZ es-CR fr-LU ar-MA en-IE es-PA ar-TN en-ZA es-DO ar-OM es-VE ar-YE es-CO ar-SY es-PE ar-JO en-TT es-AR ar-LB en-ZW es-EC ar-KW en-PH es-CL ar-AE es-UY ar-BH es-PY ar-QA es-BO es-SV es-HN es-NI es-PR zh-CHT s2q = $(subst \ ,?,$1) q2s = $(subst ?,\ ,$1) # use this when result will be quoted unesc2 = $(subst ?, ,$1) build_sources = $(FILES) $(GENERATED_FILES) build_sources_esc = $(call s2q,$(build_sources)) # use unesc2, as build_sources_embed is quoted build_sources_embed = $(call unesc2,$(build_sources_esc:%='$(srcdir)/%')) comma__ = , get_resource_name = $(firstword $(subst $(comma__), ,$1)) get_culture = $(lastword $(subst ., ,$(basename $1))) is_cultured_resource = $(and $(word 3,$(subst ., ,$1)), $(filter $(VALID_CULTURES),$(lastword $(subst ., ,$(basename $1))))) RESOURCES_ESC = $(call s2q,$(RESOURCES)) build_resx_list = $(foreach res, $(RESOURCES_ESC), $(if $(filter %.resx, $(call get_resource_name,$(res))),$(res),)) build_non_culture_resx_list = $(foreach res, $(build_resx_list),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_non_culture_others_list = $(foreach res, $(filter-out $(build_resx_list),$(RESOURCES_ESC)),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_others_list = $(build_non_culture_others_list) build_xamlg_list = $(filter %.xaml.g.cs, $(FILES)) # resgen all .resx resources build_resx_files = $(foreach res, $(build_resx_list), $(call get_resource_name,$(res))) build_resx_resources_esc = $(build_resx_files:.resx=.resources) build_resx_resources = $(call q2s,$(build_resx_resources_esc)) # embed resources for the main assembly build_resx_resources_hack = $(subst .resx,.resources, $(build_non_culture_resx_list)) # use unesc2, as build_resx_resources_embed is quoted build_resx_resources_embed = $(call unesc2,$(build_resx_resources_hack:%='-resource:%')) build_others_files = $(call q2s,$(foreach res, $(build_others_list),$(call get_resource_name,$(res)))) build_others_resources = $(build_others_files) # use unesc2, as build_others_resources_embed is quoted build_others_resources_embed = $(call unesc2,$(build_others_list:%='-resource:$(srcdir)/%')) build_resources = $(build_resx_resources) $(build_others_resources) build_resources_embed = $(build_resx_resources_embed) $(build_others_resources_embed) # -usesourcepath is available only for resgen2 emit_resgen_target_1 = $(call q2s,$1) : $(call q2s,$(subst .resources,.resx,$1)); cd '$$(shell dirname '$$<')' && MONO_IOMAP=drive $$(RESGEN) '$$(shell basename '$$<')' '$$(shell basename '$$@')' emit_resgen_target_2 = $(call q2s,$1) : $(call q2s,$(subst .resources,.resx,$1)); MONO_IOMAP=drive $$(RESGEN) -usesourcepath '$$<' '$$@' emit_resgen_target = $(if $(filter resgen2,$(RESGEN)),$(emit_resgen_target_2),$(emit_resgen_target_1)) emit_resgen_targets = $(foreach res,$(build_resx_resources_esc),$(eval $(call emit_resgen_target,$(res)))) build_references_ref = $(call q2s,$(foreach ref, $(call \ s2q,$(REFERENCES)), $(if $(filter -pkg:%, $(ref)), $(ref), \ $(if $(filter -r:%, $(ref)), $(ref), -r:$(ref))))) $(call \ q2s,$(foreach ref, $(call s2q,$(DLL_REFERENCES)), -r:$(ref))) \ $(call q2s,$(foreach ref, $(call s2q,$(PROJECT_REFERENCES)), \ -r:$(ref))) s2q2s = $(call unesc2,$(call s2q,$1)) cp_actual = test -z $1 || cp $1 $2 cp = $(call cp_actual,'$(call s2q2s,$1)','$(call s2q2s,$2)') rm_actual = test -z '$1' || rm -f '$2' rm = $(call rm_actual,$(call s2q2s,$1),$(call s2q2s,$2)/$(shell basename '$(call s2q2s,$1)')) DISTCLEANFILES = $(GENERATED_FILES) $(pc_files) $(BUILD_DIR)/* assemblyfilesdir = $(pkglibdir) assemblyfiles_DATA = $(ASSEMBLY) bin_SCRIPTS = $(BINARIES) programfilesdir = @libdir@/@PACKAGE@ programfiles_DATA = $(PROGRAMFILES) linuxpkgconfigdir = @libdir@/pkgconfig linuxpkgconfig_DATA = $(LINUX_PKGCONFIG) # generating satellite assemblies culture_resources = $(foreach res, $(RESOURCES_ESC), $(if $(call is_cultured_resource,$(call get_resource_name, $(res))),$(res))) cultures = $(sort $(foreach res, $(culture_resources), $(call get_culture,$(call get_resource_name,$(res))))) culture_resource_dependencies = $(call q2s,$(BUILD_DIR)/$1/$(SATELLITE_ASSEMBLY_NAME): $(subst .resx,.resources,$2)) culture_resource_commandlines = $(call unesc2,cmd_line_satellite_$1 += '/embed:$(subst .resx,.resources,$2)') build_satellite_assembly_list = $(call q2s,$(cultures:%=$(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME))) build_culture_res_files = $(call q2s,$(foreach res, $(culture_resources),$(call get_resource_name,$(res)))) install_satellite_assembly_list = $(subst $(BUILD_DIR),$(DESTDIR)$(libdir)/$(PACKAGE),$(build_satellite_assembly_list)) MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_DLL = $(BUILD_DIR)/Mono.Upnp.Dcp.MediaServer1.FileSystem.dll MONO_UPNP_DCP_MEDIASERVER1_DLL = $(BUILD_DIR)/Mono.Upnp.Dcp.MediaServer1.dll MONO_UPNP_DLL = $(BUILD_DIR)/Mono.Upnp.dll MONO_SSDP_DLL = $(BUILD_DIR)/Mono.Ssdp.dll MONO_UPNP_SIMPLE_MEDIA_SERVER = $(BUILD_DIR)/mono-upnp-simple-media-server all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.include $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/Makefile.include: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mono-upnp-simple-media-server: $(top_builddir)/config.status $(srcdir)/mono-upnp-simple-media-server.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) install-assemblyfilesDATA: $(assemblyfiles_DATA) @$(NORMAL_INSTALL) test -z "$(assemblyfilesdir)" || $(MKDIR_P) "$(DESTDIR)$(assemblyfilesdir)" @list='$(assemblyfiles_DATA)'; test -n "$(assemblyfilesdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(assemblyfilesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(assemblyfilesdir)" || exit $$?; \ done uninstall-assemblyfilesDATA: @$(NORMAL_UNINSTALL) @list='$(assemblyfiles_DATA)'; test -n "$(assemblyfilesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(assemblyfilesdir)'; $(am__uninstall_files_from_dir) install-linuxpkgconfigDATA: $(linuxpkgconfig_DATA) @$(NORMAL_INSTALL) test -z "$(linuxpkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(linuxpkgconfigdir)" @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(linuxpkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(linuxpkgconfigdir)" || exit $$?; \ done uninstall-linuxpkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(linuxpkgconfigdir)'; $(am__uninstall_files_from_dir) install-programfilesDATA: $(programfiles_DATA) @$(NORMAL_INSTALL) test -z "$(programfilesdir)" || $(MKDIR_P) "$(DESTDIR)$(programfilesdir)" @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(programfilesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(programfilesdir)" || exit $$?; \ done uninstall-programfilesDATA: @$(NORMAL_UNINSTALL) @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(programfilesdir)'; $(am__uninstall_files_from_dir) tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(assemblyfilesdir)" "$(DESTDIR)$(linuxpkgconfigdir)" "$(DESTDIR)$(programfilesdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-assemblyfilesDATA install-linuxpkgconfigDATA \ install-programfilesDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binSCRIPTS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-assemblyfilesDATA uninstall-binSCRIPTS \ uninstall-linuxpkgconfigDATA uninstall-programfilesDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-assemblyfilesDATA \ install-binSCRIPTS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-linuxpkgconfigDATA install-man install-pdf \ install-pdf-am install-programfilesDATA install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \ uninstall-am uninstall-assemblyfilesDATA uninstall-binSCRIPTS \ uninstall-linuxpkgconfigDATA uninstall-programfilesDATA all: $(ASSEMBLY) $(PROGRAMFILES) $(BINARIES) # macros # $(call emit-deploy-target,deploy-variable-name) define emit-deploy-target $($1): $($1_SOURCE) mkdir -p '$$(shell dirname '$$@')' cp '$$<' '$$@' endef # $(call emit-deploy-wrapper,wrapper-variable-name,wrapper-sourcefile,x) # assumes that for a wrapper foo.pc its source template is foo.pc.in # if $3 is non-empty then wrapper is marked exec define emit-deploy-wrapper $($1): $2 mkdir -p '$$(shell dirname '$$@')' cp '$$<' '$$@' $(if $3,chmod +x '$$@') endef $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_dependencies,$(call get_culture,$(call get_resource_name,$(res))),$(call get_resource_name,$(res)))))) $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_commandlines,$(call get_culture,$(call get_resource_name,$(res))),$(res))))) $(build_satellite_assembly_list): $(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME): mkdir -p '$(@D)' $(AL) -out:'$@' -culture:$* -t:lib $(cmd_line_satellite_$*) $(install_satellite_assembly_list): mkdir -p '$(@D)' cp $(subst $(DESTDIR)$(libdir)/$(PACKAGE), $(BUILD_DIR), $@) $@ install-satellite-assemblies: $(install_satellite_assembly_list) uninstall-satellite-assemblies: rm -rf $(install_satellite_assembly_list) $(eval $(call emit-deploy-wrapper,MONO_UPNP_SIMPLE_MEDIA_SERVER,mono-upnp-simple-media-server,x)) $(eval $(call emit-deploy-target,MSMEDIASERVERREGISTRAR1_DLL)) $(eval $(call emit_resgen_targets)) $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(ASSEMBLY_MDB): $(ASSEMBLY) $(ASSEMBLY): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(shell dirname $(ASSEMBLY)) $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer/0000775000175000017500000000000011707010776050016 5ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServerMono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer/Options.cs0000664000175000017500000011745611707010776052016 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer// // Options.cs // // Authors: // Jonathan Pryor // // Copyright (C) 2008 Novell (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // // Compile With: // gmcs -debug+ -r:System.Core Options.cs -o:NDesk.Options.dll // gmcs -debug+ -d:LINQ -r:System.Core Options.cs -o:NDesk.Options.dll // // The LINQ version just changes the implementation of // OptionSet.Parse(IEnumerable), and confers no semantic changes. // // A Getopt::Long-inspired option parsing library for C#. // // NDesk.Options.OptionSet is built upon a key/value table, where the // key is a option format string and the value is a delegate that is // invoked when the format string is matched. // // Option format strings: // Regex-like BNF Grammar: // name: .+ // type: [=:] // sep: ( [^{}]+ | '{' .+ '}' )? // aliases: ( name type sep ) ( '|' name type sep )* // // Each '|'-delimited name is an alias for the associated action. If the // format string ends in a '=', it has a required value. If the format // string ends in a ':', it has an optional value. If neither '=' or ':' // is present, no value is supported. `=' or `:' need only be defined on one // alias, but if they are provided on more than one they must be consistent. // // Each alias portion may also end with a "key/value separator", which is used // to split option values if the option accepts > 1 value. If not specified, // it defaults to '=' and ':'. If specified, it can be any character except // '{' and '}' OR the *string* between '{' and '}'. If no separator should be // used (i.e. the separate values should be distinct arguments), then "{}" // should be used as the separator. // // Options are extracted either from the current option by looking for // the option name followed by an '=' or ':', or is taken from the // following option IFF: // - The current option does not contain a '=' or a ':' // - The current option requires a value (i.e. not a Option type of ':') // // The `name' used in the option format string does NOT include any leading // option indicator, such as '-', '--', or '/'. All three of these are // permitted/required on any named option. // // Option bundling is permitted so long as: // - '-' is used to start the option group // - all of the bundled options are a single character // - at most one of the bundled options accepts a value, and the value // provided starts from the next character to the end of the string. // // This allows specifying '-a -b -c' as '-abc', and specifying '-D name=value' // as '-Dname=value'. // // Option processing is disabled by specifying "--". All options after "--" // are returned by OptionSet.Parse() unchanged and unprocessed. // // Unprocessed options are returned from OptionSet.Parse(). // // Examples: // int verbose = 0; // OptionSet p = new OptionSet () // .Add ("v", v => ++verbose) // .Add ("name=|value=", v => Console.WriteLine (v)); // p.Parse (new string[]{"-v", "--v", "/v", "-name=A", "/name", "B", "extra"}); // // The above would parse the argument string array, and would invoke the // lambda expression three times, setting `verbose' to 3 when complete. // It would also print out "A" and "B" to standard output. // The returned array would contain the string "extra". // // C# 3.0 collection initializers are supported and encouraged: // var p = new OptionSet () { // { "h|?|help", v => ShowHelp () }, // }; // // System.ComponentModel.TypeConverter is also supported, allowing the use of // custom data types in the callback type; TypeConverter.ConvertFromString() // is used to convert the value option to an instance of the specified // type: // // var p = new OptionSet () { // { "foo=", (Foo f) => Console.WriteLine (f.ToString ()) }, // }; // // Random other tidbits: // - Boolean options (those w/o '=' or ':' in the option format string) // are explicitly enabled if they are followed with '+', and explicitly // disabled if they are followed with '-': // string a = null; // var p = new OptionSet () { // { "a", s => a = s }, // }; // p.Parse (new string[]{"-a"}); // sets v != null // p.Parse (new string[]{"-a+"}); // sets v != null // p.Parse (new string[]{"-a-"}); // sets v == null // using System; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using System.Globalization; using System.IO; using System.Runtime.Serialization; using System.Security.Permissions; using System.Text; using System.Text.RegularExpressions; #if LINQ using System.Linq; #endif #if TEST using NDesk.Options; #endif namespace NDesk.Options { public class OptionValueCollection : IList, IList { List values = new List (); OptionContext c; internal OptionValueCollection (OptionContext c) { this.c = c; } #region ICollection void ICollection.CopyTo (Array array, int index) {(values as ICollection).CopyTo (array, index);} bool ICollection.IsSynchronized {get {return (values as ICollection).IsSynchronized;}} object ICollection.SyncRoot {get {return (values as ICollection).SyncRoot;}} #endregion #region ICollection public void Add (string item) {values.Add (item);} public void Clear () {values.Clear ();} public bool Contains (string item) {return values.Contains (item);} public void CopyTo (string[] array, int arrayIndex) {values.CopyTo (array, arrayIndex);} public bool Remove (string item) {return values.Remove (item);} public int Count {get {return values.Count;}} public bool IsReadOnly {get {return false;}} #endregion #region IEnumerable IEnumerator IEnumerable.GetEnumerator () {return values.GetEnumerator ();} #endregion #region IEnumerable public IEnumerator GetEnumerator () {return values.GetEnumerator ();} #endregion #region IList int IList.Add (object value) {return (values as IList).Add (value);} bool IList.Contains (object value) {return (values as IList).Contains (value);} int IList.IndexOf (object value) {return (values as IList).IndexOf (value);} void IList.Insert (int index, object value) {(values as IList).Insert (index, value);} void IList.Remove (object value) {(values as IList).Remove (value);} void IList.RemoveAt (int index) {(values as IList).RemoveAt (index);} bool IList.IsFixedSize {get {return false;}} object IList.this [int index] {get {return this [index];} set {(values as IList)[index] = value;}} #endregion #region IList public int IndexOf (string item) {return values.IndexOf (item);} public void Insert (int index, string item) {values.Insert (index, item);} public void RemoveAt (int index) {values.RemoveAt (index);} private void AssertValid (int index) { if (c.Option == null) throw new InvalidOperationException ("OptionContext.Option is null."); if (index >= c.Option.MaxValueCount) throw new ArgumentOutOfRangeException ("index"); if (c.Option.OptionValueType == OptionValueType.Required && index >= values.Count) throw new OptionException (string.Format ( c.OptionSet.MessageLocalizer ("Missing required value for option '{0}'."), c.OptionName), c.OptionName); } public string this [int index] { get { AssertValid (index); return index >= values.Count ? null : values [index]; } set { values [index] = value; } } #endregion public List ToList () { return new List (values); } public string[] ToArray () { return values.ToArray (); } public override string ToString () { return string.Join (", ", values.ToArray ()); } } public class OptionContext { private Option option; private string name; private int index; private OptionSet set; private OptionValueCollection c; public OptionContext (OptionSet set) { this.set = set; this.c = new OptionValueCollection (this); } public Option Option { get {return option;} set {option = value;} } public string OptionName { get {return name;} set {name = value;} } public int OptionIndex { get {return index;} set {index = value;} } public OptionSet OptionSet { get {return set;} } public OptionValueCollection OptionValues { get {return c;} } } public enum OptionValueType { None, Optional, Required, } public abstract class Option { string prototype, description; string[] names; OptionValueType type; int count; string[] separators; protected Option (string prototype, string description) : this (prototype, description, 1) { } protected Option (string prototype, string description, int maxValueCount) { if (prototype == null) throw new ArgumentNullException ("prototype"); if (prototype.Length == 0) throw new ArgumentException ("Cannot be the empty string.", "prototype"); if (maxValueCount < 0) throw new ArgumentOutOfRangeException ("maxValueCount"); this.prototype = prototype; this.names = prototype.Split ('|'); this.description = description; this.count = maxValueCount; this.type = ParsePrototype (); if (this.count == 0 && type != OptionValueType.None) throw new ArgumentException ( "Cannot provide maxValueCount of 0 for OptionValueType.Required or " + "OptionValueType.Optional.", "maxValueCount"); if (this.type == OptionValueType.None && maxValueCount > 1) throw new ArgumentException ( string.Format ("Cannot provide maxValueCount of {0} for OptionValueType.None.", maxValueCount), "maxValueCount"); if (Array.IndexOf (names, "<>") >= 0 && ((names.Length == 1 && this.type != OptionValueType.None) || (names.Length > 1 && this.MaxValueCount > 1))) throw new ArgumentException ( "The default option handler '<>' cannot require values.", "prototype"); } public string Prototype {get {return prototype;}} public string Description {get {return description;}} public OptionValueType OptionValueType {get {return type;}} public int MaxValueCount {get {return count;}} public string[] GetNames () { return (string[]) names.Clone (); } public string[] GetValueSeparators () { if (separators == null) return new string [0]; return (string[]) separators.Clone (); } protected static T Parse (string value, OptionContext c) { TypeConverter conv = TypeDescriptor.GetConverter (typeof (T)); T t = default (T); try { if (value != null) t = (T) conv.ConvertFromString (value); } catch (Exception e) { throw new OptionException ( string.Format ( c.OptionSet.MessageLocalizer ("Could not convert string `{0}' to type {1} for option `{2}'."), value, typeof (T).Name, c.OptionName), c.OptionName, e); } return t; } internal string[] Names {get {return names;}} internal string[] ValueSeparators {get {return separators;}} static readonly char[] NameTerminator = new char[]{'=', ':'}; private OptionValueType ParsePrototype () { char type = '\0'; List seps = new List (); for (int i = 0; i < names.Length; ++i) { string name = names [i]; if (name.Length == 0) throw new ArgumentException ("Empty option names are not supported.", "prototype"); int end = name.IndexOfAny (NameTerminator); if (end == -1) continue; names [i] = name.Substring (0, end); if (type == '\0' || type == name [end]) type = name [end]; else throw new ArgumentException ( string.Format ("Conflicting option types: '{0}' vs. '{1}'.", type, name [end]), "prototype"); AddSeparators (name, end, seps); } if (type == '\0') return OptionValueType.None; if (count <= 1 && seps.Count != 0) throw new ArgumentException ( string.Format ("Cannot provide key/value separators for Options taking {0} value(s).", count), "prototype"); if (count > 1) { if (seps.Count == 0) this.separators = new string[]{":", "="}; else if (seps.Count == 1 && seps [0].Length == 0) this.separators = null; else this.separators = seps.ToArray (); } return type == '=' ? OptionValueType.Required : OptionValueType.Optional; } private static void AddSeparators (string name, int end, ICollection seps) { int start = -1; for (int i = end+1; i < name.Length; ++i) { switch (name [i]) { case '{': if (start != -1) throw new ArgumentException ( string.Format ("Ill-formed name/value separator found in \"{0}\".", name), "prototype"); start = i+1; break; case '}': if (start == -1) throw new ArgumentException ( string.Format ("Ill-formed name/value separator found in \"{0}\".", name), "prototype"); seps.Add (name.Substring (start, i-start)); start = -1; break; default: if (start == -1) seps.Add (name [i].ToString ()); break; } } if (start != -1) throw new ArgumentException ( string.Format ("Ill-formed name/value separator found in \"{0}\".", name), "prototype"); } public void Invoke (OptionContext c) { OnParseComplete (c); c.OptionName = null; c.Option = null; c.OptionValues.Clear (); } protected abstract void OnParseComplete (OptionContext c); public override string ToString () { return Prototype; } } [Serializable] public class OptionException : Exception { private string option; public OptionException () { } public OptionException (string message, string optionName) : base (message) { this.option = optionName; } public OptionException (string message, string optionName, Exception innerException) : base (message, innerException) { this.option = optionName; } protected OptionException (SerializationInfo info, StreamingContext context) : base (info, context) { this.option = info.GetString ("OptionName"); } public string OptionName { get {return this.option;} } [SecurityPermission (SecurityAction.LinkDemand, SerializationFormatter = true)] public override void GetObjectData (SerializationInfo info, StreamingContext context) { base.GetObjectData (info, context); info.AddValue ("OptionName", option); } } public delegate void OptionAction (TKey key, TValue value); public class OptionSet : KeyedCollection { public OptionSet () : this (delegate (string f) {return f;}) { } public OptionSet (Converter localizer) { this.localizer = localizer; } Converter localizer; public Converter MessageLocalizer { get {return localizer;} } protected override string GetKeyForItem (Option item) { if (item == null) throw new ArgumentNullException ("option"); if (item.Names != null && item.Names.Length > 0) return item.Names [0]; // This should never happen, as it's invalid for Option to be // constructed w/o any names. throw new InvalidOperationException ("Option has no names!"); } [Obsolete ("Use KeyedCollection.this[string]")] protected Option GetOptionForName (string option) { if (option == null) throw new ArgumentNullException ("option"); try { return base [option]; } catch (KeyNotFoundException) { return null; } } protected override void InsertItem (int index, Option item) { base.InsertItem (index, item); AddImpl (item); } protected override void RemoveItem (int index) { base.RemoveItem (index); Option p = Items [index]; // KeyedCollection.RemoveItem() handles the 0th item for (int i = 1; i < p.Names.Length; ++i) { Dictionary.Remove (p.Names [i]); } } protected override void SetItem (int index, Option item) { base.SetItem (index, item); RemoveItem (index); AddImpl (item); } private void AddImpl (Option option) { if (option == null) throw new ArgumentNullException ("option"); List added = new List (option.Names.Length); try { // KeyedCollection.InsertItem/SetItem handle the 0th name. for (int i = 1; i < option.Names.Length; ++i) { Dictionary.Add (option.Names [i], option); added.Add (option.Names [i]); } } catch (Exception) { foreach (string name in added) Dictionary.Remove (name); throw; } } public new OptionSet Add (Option option) { base.Add (option); return this; } sealed class ActionOption : Option { Action action; public ActionOption (string prototype, string description, int count, Action action) : base (prototype, description, count) { if (action == null) throw new ArgumentNullException ("action"); this.action = action; } protected override void OnParseComplete (OptionContext c) { action (c.OptionValues); } } public OptionSet Add (string prototype, Action action) { return Add (prototype, null, action); } public OptionSet Add (string prototype, string description, Action action) { if (action == null) throw new ArgumentNullException ("action"); Option p = new ActionOption (prototype, description, 1, delegate (OptionValueCollection v) { action (v [0]); }); base.Add (p); return this; } public OptionSet Add (string prototype, OptionAction action) { return Add (prototype, null, action); } public OptionSet Add (string prototype, string description, OptionAction action) { if (action == null) throw new ArgumentNullException ("action"); Option p = new ActionOption (prototype, description, 2, delegate (OptionValueCollection v) {action (v [0], v [1]);}); base.Add (p); return this; } sealed class ActionOption : Option { Action action; public ActionOption (string prototype, string description, Action action) : base (prototype, description, 1) { if (action == null) throw new ArgumentNullException ("action"); this.action = action; } protected override void OnParseComplete (OptionContext c) { action (Parse (c.OptionValues [0], c)); } } sealed class ActionOption : Option { OptionAction action; public ActionOption (string prototype, string description, OptionAction action) : base (prototype, description, 2) { if (action == null) throw new ArgumentNullException ("action"); this.action = action; } protected override void OnParseComplete (OptionContext c) { action ( Parse (c.OptionValues [0], c), Parse (c.OptionValues [1], c)); } } public OptionSet Add (string prototype, Action action) { return Add (prototype, null, action); } public OptionSet Add (string prototype, string description, Action action) { return Add (new ActionOption (prototype, description, action)); } public OptionSet Add (string prototype, OptionAction action) { return Add (prototype, null, action); } public OptionSet Add (string prototype, string description, OptionAction action) { return Add (new ActionOption (prototype, description, action)); } protected virtual OptionContext CreateOptionContext () { return new OptionContext (this); } #if LINQ public List Parse (IEnumerable arguments) { bool process = true; OptionContext c = CreateOptionContext (); c.OptionIndex = -1; var def = GetOptionForName ("<>"); var unprocessed = from argument in arguments where ++c.OptionIndex >= 0 && (process || def != null) ? process ? argument == "--" ? (process = false) : !Parse (argument, c) ? def != null ? Unprocessed (null, def, c, argument) : true : false : def != null ? Unprocessed (null, def, c, argument) : true : true select argument; List r = unprocessed.ToList (); if (c.Option != null) c.Option.Invoke (c); return r; } #else public List Parse (IEnumerable arguments) { OptionContext c = CreateOptionContext (); c.OptionIndex = -1; bool process = true; List unprocessed = new List (); Option def = Contains ("<>") ? this ["<>"] : null; foreach (string argument in arguments) { ++c.OptionIndex; if (argument == "--") { process = false; continue; } if (!process) { Unprocessed (unprocessed, def, c, argument); continue; } if (!Parse (argument, c)) Unprocessed (unprocessed, def, c, argument); } if (c.Option != null) c.Option.Invoke (c); return unprocessed; } #endif private static bool Unprocessed (ICollection extra, Option def, OptionContext c, string argument) { if (def == null) { extra.Add (argument); return false; } c.OptionValues.Add (argument); c.Option = def; c.Option.Invoke (c); return false; } private readonly Regex ValueOption = new Regex ( @"^(?--|-|/)(?[^:=]+)((?[:=])(?.*))?$"); protected bool GetOptionParts (string argument, out string flag, out string name, out string sep, out string value) { if (argument == null) throw new ArgumentNullException ("argument"); flag = name = sep = value = null; Match m = ValueOption.Match (argument); if (!m.Success) { return false; } flag = m.Groups ["flag"].Value; name = m.Groups ["name"].Value; if (m.Groups ["sep"].Success && m.Groups ["value"].Success) { sep = m.Groups ["sep"].Value; value = m.Groups ["value"].Value; } return true; } protected virtual bool Parse (string argument, OptionContext c) { if (c.Option != null) { ParseValue (argument, c); return true; } string f, n, s, v; if (!GetOptionParts (argument, out f, out n, out s, out v)) return false; Option p; if (Contains (n)) { p = this [n]; c.OptionName = f + n; c.Option = p; switch (p.OptionValueType) { case OptionValueType.None: c.OptionValues.Add (n); c.Option.Invoke (c); break; case OptionValueType.Optional: case OptionValueType.Required: ParseValue (v, c); break; } return true; } // no match; is it a bool option? if (ParseBool (argument, n, c)) return true; // is it a bundled option? if (ParseBundledValue (f, string.Concat (n + s + v), c)) return true; return false; } private void ParseValue (string option, OptionContext c) { if (option != null) foreach (string o in c.Option.ValueSeparators != null ? option.Split (c.Option.ValueSeparators, StringSplitOptions.None) : new string[]{option}) { c.OptionValues.Add (o); } if (c.OptionValues.Count == c.Option.MaxValueCount || c.Option.OptionValueType == OptionValueType.Optional) c.Option.Invoke (c); else if (c.OptionValues.Count > c.Option.MaxValueCount) { throw new OptionException (localizer (string.Format ( "Error: Found {0} option values when expecting {1}.", c.OptionValues.Count, c.Option.MaxValueCount)), c.OptionName); } } private bool ParseBool (string option, string n, OptionContext c) { Option p; string rn; if (n.Length >= 1 && (n [n.Length-1] == '+' || n [n.Length-1] == '-') && Contains ((rn = n.Substring (0, n.Length-1)))) { p = this [rn]; string v = n [n.Length-1] == '+' ? option : null; c.OptionName = option; c.Option = p; c.OptionValues.Add (v); p.Invoke (c); return true; } return false; } private bool ParseBundledValue (string f, string n, OptionContext c) { if (f != "-") return false; for (int i = 0; i < n.Length; ++i) { Option p; string opt = f + n [i].ToString (); string rn = n [i].ToString (); if (!Contains (rn)) { if (i == 0) return false; throw new OptionException (string.Format (localizer ( "Cannot bundle unregistered option '{0}'."), opt), opt); } p = this [rn]; switch (p.OptionValueType) { case OptionValueType.None: Invoke (c, opt, n, p); break; case OptionValueType.Optional: case OptionValueType.Required: { string v = n.Substring (i+1); c.Option = p; c.OptionName = opt; ParseValue (v.Length != 0 ? v : null, c); return true; } default: throw new InvalidOperationException ("Unknown OptionValueType: " + p.OptionValueType); } } return true; } private static void Invoke (OptionContext c, string name, string value, Option option) { c.OptionName = name; c.Option = option; c.OptionValues.Add (value); option.Invoke (c); } private const int OptionWidth = 29; public void WriteOptionDescriptions (TextWriter o) { foreach (Option p in this) { int written = 0; if (!WriteOptionPrototype (o, p, ref written)) continue; if (written < OptionWidth) o.Write (new string (' ', OptionWidth - written)); else { o.WriteLine (); o.Write (new string (' ', OptionWidth)); } List lines = GetLines (localizer (GetDescription (p.Description))); o.WriteLine (lines [0]); string prefix = new string (' ', OptionWidth+2); for (int i = 1; i < lines.Count; ++i) { o.Write (prefix); o.WriteLine (lines [i]); } } } bool WriteOptionPrototype (TextWriter o, Option p, ref int written) { string[] names = p.Names; int i = GetNextOptionIndex (names, 0); if (i == names.Length) return false; if (names [i].Length == 1) { Write (o, ref written, " -"); Write (o, ref written, names [0]); } else { Write (o, ref written, " --"); Write (o, ref written, names [0]); } for ( i = GetNextOptionIndex (names, i+1); i < names.Length; i = GetNextOptionIndex (names, i+1)) { Write (o, ref written, ", "); Write (o, ref written, names [i].Length == 1 ? "-" : "--"); Write (o, ref written, names [i]); } if (p.OptionValueType == OptionValueType.Optional || p.OptionValueType == OptionValueType.Required) { if (p.OptionValueType == OptionValueType.Optional) { Write (o, ref written, localizer ("[")); } Write (o, ref written, localizer ("=" + GetArgumentName (0, p.MaxValueCount, p.Description))); string sep = p.ValueSeparators != null && p.ValueSeparators.Length > 0 ? p.ValueSeparators [0] : " "; for (int c = 1; c < p.MaxValueCount; ++c) { Write (o, ref written, localizer (sep + GetArgumentName (c, p.MaxValueCount, p.Description))); } if (p.OptionValueType == OptionValueType.Optional) { Write (o, ref written, localizer ("]")); } } return true; } static int GetNextOptionIndex (string[] names, int i) { while (i < names.Length && names [i] == "<>") { ++i; } return i; } static void Write (TextWriter o, ref int n, string s) { n += s.Length; o.Write (s); } private static string GetArgumentName (int index, int maxIndex, string description) { if (description == null) return maxIndex == 1 ? "VALUE" : "VALUE" + (index + 1); string[] nameStart; if (maxIndex == 1) nameStart = new string[]{"{0:", "{"}; else nameStart = new string[]{"{" + index + ":"}; for (int i = 0; i < nameStart.Length; ++i) { int start, j = 0; do { start = description.IndexOf (nameStart [i], j); } while (start >= 0 && j != 0 ? description [j++ - 1] == '{' : false); if (start == -1) continue; int end = description.IndexOf ("}", start); if (end == -1) continue; return description.Substring (start + nameStart [i].Length, end - start - nameStart [i].Length); } return maxIndex == 1 ? "VALUE" : "VALUE" + (index + 1); } private static string GetDescription (string description) { if (description == null) return string.Empty; StringBuilder sb = new StringBuilder (description.Length); int start = -1; for (int i = 0; i < description.Length; ++i) { switch (description [i]) { case '{': if (i == start) { sb.Append ('{'); start = -1; } else if (start < 0) start = i + 1; break; case '}': if (start < 0) { if ((i+1) == description.Length || description [i+1] != '}') throw new InvalidOperationException ("Invalid option description: " + description); ++i; sb.Append ("}"); } else { sb.Append (description.Substring (start, i - start)); start = -1; } break; case ':': if (start < 0) goto default; start = i + 1; break; default: if (start < 0) sb.Append (description [i]); break; } } return sb.ToString (); } private static List GetLines (string description) { List lines = new List (); if (string.IsNullOrEmpty (description)) { lines.Add (string.Empty); return lines; } int length = 80 - OptionWidth - 2; int start = 0, end; do { end = GetLineEnd (start, length, description); bool cont = false; if (end < description.Length) { char c = description [end]; if (c == '-' || (char.IsWhiteSpace (c) && c != '\n')) ++end; else if (c != '\n') { cont = true; --end; } } lines.Add (description.Substring (start, end - start)); if (cont) { lines [lines.Count-1] += "-"; } start = end; if (start < description.Length && description [start] == '\n') ++start; } while (end < description.Length); return lines; } private static int GetLineEnd (int start, int length, string description) { int end = Math.Min (start + length, description.Length); int sep = -1; for (int i = start; i < end; ++i) { switch (description [i]) { case ' ': case '\t': case '\v': case '-': case ',': case '.': case ';': sep = i; break; case '\n': return i; } } if (sep == -1 || end == description.Length) return end; return sep; } } } Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer/DummyConnectionManager.cs0000664000175000017500000000416411707010776054760 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer// // DummyConnectionManager.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using Mono.Upnp.Dcp.MediaServer1.ConnectionManager1; namespace Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer { public class DummyConnectionManager : ConnectionManager { protected override string CurrentConnectionIDs { get { throw new NotImplementedException (); } } protected override void GetProtocolInfoCore (out string source, out string sink) { throw new NotImplementedException (); } protected override void GetCurrentConnectionInfoCore (int connectionId, out int resId, out int avTransportId, out string protocolInfo, out string peerConnectionManager, out int peerConnectionId, out Mono.Upnp.Dcp.MediaServer1.ConnectionManager1.Direction direction, out Mono.Upnp.Dcp.MediaServer1.ConnectionManager1.ConnectionStatus status) { throw new NotImplementedException (); } } } Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer/DummyMSMediaReceiverRegistrar.cs0000664000175000017500000000336011707010776056212 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer// // DummyMSMediaServerRegistrar.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using Mono.Upnp.Dcp.MSMediaReceiverRegistrar1; namespace Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer { public class DummyMSMediaReceiverRegistrar : MSMediaReceiverRegistrar { protected override long IsAuthorized (string deviceId) { return 1; } protected override byte[] RegisterDevice (byte[] registrationRequestMessage) { return null; } protected override long IsValidated (string deviceId) { return 1; } } } Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer/ConsoleServer.cs0000664000175000017500000002016011707010776053135 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer// // ConsoleServer.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using System.IO; using System.Net; using System.Net.Sockets; using NDesk.Options; using Mono.Upnp.Control; using Mono.Upnp.Dcp.MediaServer1.FileSystem.Wmp11; using Mono.Upnp.Dcp.MSMediaReceiverRegistrar1; namespace Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer { class ConsoleServer { public static void Main (string[] args) { string path = null; var udn = "uuid:" + Guid.NewGuid ().ToString (); var friendly_name = "Mono.Upnp File System MediaServer"; var manufacturer = "Mono Project"; var model_name = "Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleClient"; var manufacturer_url = new Uri ("http://www.mono-project.org/"); var model_description = "A console client for sharing file system folders over the MediaServer1 spec."; var model_number = "1"; var model_url = new Uri ("http://www.mono-project.org/Mono.Upnp"); var serial_number = "MONO-UPNP-MEDIA-SERVER-1"; string upc = null; var help = false; var options = new OptionSet { { "p|path=", "the path of the directory to share.", v => path = v }, { "u|udn=", "the Unique Device Name of the MediaServer device.", v => udn = v }, { "f|friendly-name=", "the friendly name of the MediaServer device.", v => friendly_name = v }, { "m|manufacturer=", "The name of the MediaServer device manufacturer.", v => manufacturer = v }, { "n|name=", "the name of the MediaServer device model.", v => model_name = v }, { "manufacturer-url=", "the URL for the MediaServer device manufacturer.", v => manufacturer_url = new Uri (v) }, { "d|description=", "a description of the MediaServer device.", v => model_description = v }, { "model-number=", "the model number of the MediaServer device.", v => model_number = v }, { "model_url=", "the URL for the MediaServer device.", v => model_url = new Uri (v) }, { "serial-number=", "the serial number for the MediaServer device.", v => serial_number = v }, { "upc=", "the Universal Product Code for the MediaServer device.", v => upc = v }, { "h|?|help", "show this help message and exit.", v => help = v != null } }; List extras; try { extras = options.Parse (args); } catch (Exception e) { Console.WriteLine ("mono-upnp-simple-media-server:"); Console.WriteLine (e.Message); Console.WriteLine ("Try mono-upnp-simple-media-server --help for more info."); return; } if (extras.Count == 0) { if (path == null) { path = Directory.GetCurrentDirectory (); } } else if (extras.Count == 1) { if (path != null) { Console.WriteLine ("mono-upnp-simple-media-server:"); Console.WriteLine ("You can only specify one path. You specified 2:"); Console.WriteLine ("\t" + path); Console.WriteLine ("\t" + extras[0]); Console.WriteLine ("Try mono-upnp-simple-media-server --help for more info."); return; } else { path = extras[0]; } } else { Console.WriteLine ("mono-upnp-simple-media-server:"); Console.WriteLine (string.Format ("You can only specify one path. You specified {0}:", extras.Count)); foreach (var extra in extras) { Console.WriteLine ("\t" + extra); } Console.WriteLine ("Try mono-upnp-simple-media-server --help for more info."); return; } if (help) { ShowHelp (options); return; } Console.WriteLine ("Serving " + path); var connection_manager = new DummyConnectionManager (); var content_directory = BuildContentDirectory (path); var ms_media_server_registrar = new Service ( MSMediaReceiverRegistrar.ServiceType, "urn:microsoft.com:serviceId:X_MS_MediaReceiverRegistrar", new DummyMSMediaReceiverRegistrar ()); var media_server = new MediaServer ( udn, friendly_name, manufacturer, model_name, new DeviceOptions { Services = new[] { ms_media_server_registrar }, ManufacturerUrl = manufacturer_url, ModelDescription = model_description, ModelNumber = model_number, ModelUrl = model_url, SerialNumber = serial_number, Upc = upc }, connection_manager, content_directory ); using (media_server) { media_server.Start (); Console.WriteLine ("Press ENTER to exit."); Console.ReadLine (); } } static FileSystemContentDirectory BuildContentDirectory (string path) { var builder = new Wmp11ContentDirectoryBuilder (GenerateUrl ()); OnDirectory (path, builder); return builder.Build (); } static void OnDirectory (string path, Wmp11ContentDirectoryBuilder builder) { foreach (var file in Directory.GetFiles (path)) { builder.OnFile (file); } foreach (var directory in Directory.GetDirectories (path)) { OnDirectory (directory, builder); } } static Uri GenerateUrl () { foreach (var address in Dns.GetHostAddresses (Dns.GetHostName ())) { if (address.AddressFamily == AddressFamily.InterNetwork) { return new Uri (string.Format ( "http://{0}:{1}/upnp/media-server/", address, new Random ().Next (1024, 5000))); } } return null; } static void ShowHelp (OptionSet options) { Console.WriteLine ("Usage: mono-upnp-simple-media-server [OPTIONS] [CONTENT_DIRECTORY_PATH]"); Console.WriteLine ("Shares the contents of the specified directory (and sub-directories) over UPnP."); Console.WriteLine ("If no directory is specified, the current directory is used."); Console.WriteLine (); Console.WriteLine ("Options:"); options.WriteOptionDescriptions (Console.Out); } } } AssemblyInfo.cs0000664000175000017500000000436411714307244041245 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer// // AssemblyInfo.cs // // Author: // scott <${AuthorEmail}> // // Copyright (c) 2009 scott // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System.Reflection; using System.Runtime.CompilerServices; // Information about this assembly is defined by the following attributes. // Change them to the values specific to your project. [assembly: AssemblyTitle ("Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer")] [assembly: AssemblyDescription ("A console application for server media via the MediaServer1 spec from the file system.")] [assembly: AssemblyConfiguration ("")] [assembly: AssemblyCompany ("")] [assembly: AssemblyProduct ("")] [assembly: AssemblyCopyright ("")] [assembly: AssemblyTrademark ("")] [assembly: AssemblyCulture ("")] // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". // The form "{Major}.{Minor}.*" will automatically update the build and revision, // and "{Major}.{Minor}.{Build}.*" will update just the revision. [assembly: AssemblyVersion ("1.0.*")] // The following attributes are used to specify the signing key for the assembly, // if desired. See the Mono documentation for more information about signing. //[assembly: AssemblyDelaySign(false)] //[assembly: AssemblyKeyFile("")] mono-upnp-simple-media-server.in0000664000175000017500000000016011715002253044432 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer#!/bin/sh exec mono "@expanded_libdir@/@PACKAGE@/Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer.exe" "$@" Mono.Upnp.Dcp.MSMediaReceiverRegistrar1/0000775000175000017500000000000011761740037034065 5ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1Makefile.am0000664000175000017500000000611011715013277036115 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MSMediaReceiverRegistrar1 EXTRA_DIST = # Warning: This is an automatically generated file, do not edit! if ENABLE_DEBUG ASSEMBLY_COMPILER_COMMAND = gmcs ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug "-define:DEBUG" ASSEMBLY = ../../../../bin/Mono.Upnp.Dcp.MSMediaReceiverRegistrar1.dll ASSEMBLY_MDB = $(ASSEMBLY).mdb COMPILE_TARGET = library PROJECT_REFERENCES = \ ../../../../bin/Mono.Upnp.dll BUILD_DIR = ../../../../bin MONO_UPNP_DCP_MSMEDIARECEIVERREGISTRAR1_DLL_MDB_SOURCE=../../../../bin/Mono.Upnp.Dcp.MSMediaReceiverRegistrar1.dll.mdb MONO_UPNP_DCP_MSMEDIARECEIVERREGISTRAR1_DLL_MDB=$(BUILD_DIR)/Mono.Upnp.Dcp.MSMediaReceiverRegistrar1.dll.mdb MONO_UPNP_DLL_SOURCE=../../../../bin/Mono.Upnp.dll MONO_SSDP_DLL_SOURCE=../../../../bin/Mono.Ssdp.dll MONO_SSDP_DLL_MDB_SOURCE=../../../../bin/Mono.Ssdp.dll.mdb MONO_SSDP_DLL_MDB=$(BUILD_DIR)/Mono.Ssdp.dll.mdb MONO_UPNP_DLL_MDB_SOURCE=../../../../bin/Mono.Upnp.dll.mdb MONO_UPNP_DLL_MDB=$(BUILD_DIR)/Mono.Upnp.dll.mdb endif if ENABLE_RELEASE ASSEMBLY_COMPILER_COMMAND = gmcs ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ ASSEMBLY = MSMediaServerRegistrar1.dll ASSEMBLY_MDB = COMPILE_TARGET = library PROJECT_REFERENCES = \ ../../../../bin/Mono.Upnp.dll BUILD_DIR = . MONO_UPNP_DCP_MSMEDIARECEIVERREGISTRAR1_DLL_MDB= MONO_UPNP_DLL_SOURCE=../../../../bin/Mono.Upnp.dll MONO_SSDP_DLL_SOURCE=../../../../bin/Mono.Ssdp.dll MONO_SSDP_DLL_MDB= MONO_UPNP_DLL_MDB= endif AL=al2 SATELLITE_ASSEMBLY_NAME=$(notdir $(basename $(ASSEMBLY))).resources.dll PROGRAMFILES = \ $(MONO_UPNP_DCP_MSMEDIARECEIVERREGISTRAR1_DLL_MDB) \ $(MONO_UPNP_DLL) \ $(MONO_SSDP_DLL) \ $(MONO_SSDP_DLL_MDB) \ $(MONO_UPNP_DLL_MDB) LINUX_PKGCONFIG = \ $(MONO_UPNP_DCP_MSMEDIARECEIVERREGISTRAR1_PC) RESGEN=resgen2 all: $(ASSEMBLY) $(PROGRAMFILES) $(LINUX_PKGCONFIG) FILES = \ AssemblyInfo.cs \ Mono.Upnp.Dcp.MSMediaReceiverRegistrar1/MSMediaReceiverRegistrar.cs DATA_FILES = RESOURCES = EXTRAS = \ Mono.Upnp.Dcp.MSMediaReceiverRegistrar1 \ mono.upnp.dcp.msmediareceiverregistrar1.pc.in REFERENCES = \ ../../../../bin/Mono.Upnp.dll \ System DLL_REFERENCES = CLEANFILES = $(PROGRAMFILES) $(LINUX_PKGCONFIG) include $(top_srcdir)/Makefile.include MONO_UPNP_DLL = $(BUILD_DIR)/Mono.Upnp.dll MONO_SSDP_DLL = $(BUILD_DIR)/Mono.Ssdp.dll MONO_UPNP_DCP_MSMEDIARECEIVERREGISTRAR1_PC = $(BUILD_DIR)/mono.upnp.dcp.msmediareceiverregistrar1.pc $(eval $(call emit-deploy-target,MONO_UPNP_DLL)) $(eval $(call emit-deploy-target,MONO_SSDP_DLL)) $(eval $(call emit-deploy-wrapper,MONO_UPNP_DCP_MSMEDIARECEIVERREGISTRAR1_PC,mono.upnp.dcp.msmediareceiverregistrar1.pc)) $(eval $(call emit_resgen_targets)) $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(ASSEMBLY_MDB): $(ASSEMBLY) $(ASSEMBLY): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(shell dirname $(ASSEMBLY)) $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) Makefile.in0000664000175000017500000006321411761736755036154 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MSMediaReceiverRegistrar1# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/mono.upnp.dcp.msmediareceiverregistrar1.pc.in \ $(top_srcdir)/Makefile.include subdir = src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MSMediaReceiverRegistrar1 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/expansions.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = mono.upnp.dcp.msmediareceiverregistrar1.pc CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(bindir)" \ "$(DESTDIR)$(assemblyfilesdir)" \ "$(DESTDIR)$(linuxpkgconfigdir)" \ "$(DESTDIR)$(programfilesdir)" SCRIPTS = $(bin_SCRIPTS) SOURCES = DIST_SOURCES = DATA = $(assemblyfiles_DATA) $(linuxpkgconfig_DATA) \ $(programfiles_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ GLADE_SHARP_20_CFLAGS = @GLADE_SHARP_20_CFLAGS@ GLADE_SHARP_20_LIBS = @GLADE_SHARP_20_LIBS@ GLIB_SHARP_20_CFLAGS = @GLIB_SHARP_20_CFLAGS@ GLIB_SHARP_20_LIBS = @GLIB_SHARP_20_LIBS@ GMCS = @GMCS@ GTK_SHARP_20_CFLAGS = @GTK_SHARP_20_CFLAGS@ GTK_SHARP_20_LIBS = @GTK_SHARP_20_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MONO_ADDINS_CFLAGS = @MONO_ADDINS_CFLAGS@ MONO_ADDINS_LIBS = @MONO_ADDINS_LIBS@ NUNIT_CFLAGS = @NUNIT_CFLAGS@ NUNIT_CMD = @NUNIT_CMD@ NUNIT_LIBS = @NUNIT_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TAGLIB_SHARP_CFLAGS = @TAGLIB_SHARP_CFLAGS@ TAGLIB_SHARP_LIBS = @TAGLIB_SHARP_LIBS@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_bindir = @expanded_bindir@ expanded_datadir = @expanded_datadir@ expanded_libdir = @expanded_libdir@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = $(build_sources) $(build_resx_files) \ $(build_others_files) $(ASSEMBLY_WRAPPER_IN) $(EXTRAS) \ $(DATA_FILES) $(build_culture_res_files) # Warning: This is an automatically generated file, do not edit! @ENABLE_DEBUG_TRUE@ASSEMBLY_COMPILER_COMMAND = gmcs @ENABLE_RELEASE_TRUE@ASSEMBLY_COMPILER_COMMAND = gmcs @ENABLE_DEBUG_TRUE@ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug "-define:DEBUG" @ENABLE_RELEASE_TRUE@ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ @ENABLE_DEBUG_TRUE@ASSEMBLY = ../../../../bin/Mono.Upnp.Dcp.MSMediaReceiverRegistrar1.dll @ENABLE_RELEASE_TRUE@ASSEMBLY = MSMediaServerRegistrar1.dll @ENABLE_DEBUG_TRUE@ASSEMBLY_MDB = $(ASSEMBLY).mdb @ENABLE_RELEASE_TRUE@ASSEMBLY_MDB = @ENABLE_DEBUG_TRUE@COMPILE_TARGET = library @ENABLE_RELEASE_TRUE@COMPILE_TARGET = library @ENABLE_DEBUG_TRUE@PROJECT_REFERENCES = \ @ENABLE_DEBUG_TRUE@ ../../../../bin/Mono.Upnp.dll @ENABLE_RELEASE_TRUE@PROJECT_REFERENCES = \ @ENABLE_RELEASE_TRUE@ ../../../../bin/Mono.Upnp.dll @ENABLE_DEBUG_TRUE@BUILD_DIR = ../../../../bin @ENABLE_RELEASE_TRUE@BUILD_DIR = . @ENABLE_DEBUG_TRUE@MONO_UPNP_DCP_MSMEDIARECEIVERREGISTRAR1_DLL_MDB_SOURCE = ../../../../bin/Mono.Upnp.Dcp.MSMediaReceiverRegistrar1.dll.mdb @ENABLE_DEBUG_TRUE@MONO_UPNP_DCP_MSMEDIARECEIVERREGISTRAR1_DLL_MDB = $(BUILD_DIR)/Mono.Upnp.Dcp.MSMediaReceiverRegistrar1.dll.mdb @ENABLE_RELEASE_TRUE@MONO_UPNP_DCP_MSMEDIARECEIVERREGISTRAR1_DLL_MDB = @ENABLE_DEBUG_TRUE@MONO_UPNP_DLL_SOURCE = ../../../../bin/Mono.Upnp.dll @ENABLE_RELEASE_TRUE@MONO_UPNP_DLL_SOURCE = ../../../../bin/Mono.Upnp.dll @ENABLE_DEBUG_TRUE@MONO_SSDP_DLL_SOURCE = ../../../../bin/Mono.Ssdp.dll @ENABLE_RELEASE_TRUE@MONO_SSDP_DLL_SOURCE = ../../../../bin/Mono.Ssdp.dll @ENABLE_DEBUG_TRUE@MONO_SSDP_DLL_MDB_SOURCE = ../../../../bin/Mono.Ssdp.dll.mdb @ENABLE_DEBUG_TRUE@MONO_SSDP_DLL_MDB = $(BUILD_DIR)/Mono.Ssdp.dll.mdb @ENABLE_RELEASE_TRUE@MONO_SSDP_DLL_MDB = @ENABLE_DEBUG_TRUE@MONO_UPNP_DLL_MDB_SOURCE = ../../../../bin/Mono.Upnp.dll.mdb @ENABLE_DEBUG_TRUE@MONO_UPNP_DLL_MDB = $(BUILD_DIR)/Mono.Upnp.dll.mdb @ENABLE_RELEASE_TRUE@MONO_UPNP_DLL_MDB = AL = al2 SATELLITE_ASSEMBLY_NAME = $(notdir $(basename $(ASSEMBLY))).resources.dll PROGRAMFILES = \ $(MONO_UPNP_DCP_MSMEDIARECEIVERREGISTRAR1_DLL_MDB) \ $(MONO_UPNP_DLL) \ $(MONO_SSDP_DLL) \ $(MONO_SSDP_DLL_MDB) \ $(MONO_UPNP_DLL_MDB) LINUX_PKGCONFIG = \ $(MONO_UPNP_DCP_MSMEDIARECEIVERREGISTRAR1_PC) RESGEN = resgen2 FILES = \ AssemblyInfo.cs \ Mono.Upnp.Dcp.MSMediaReceiverRegistrar1/MSMediaReceiverRegistrar.cs DATA_FILES = RESOURCES = EXTRAS = \ Mono.Upnp.Dcp.MSMediaReceiverRegistrar1 \ mono.upnp.dcp.msmediareceiverregistrar1.pc.in REFERENCES = \ ../../../../bin/Mono.Upnp.dll \ System DLL_REFERENCES = CLEANFILES = $(PROGRAMFILES) $(LINUX_PKGCONFIG) $(ASSEMBLY) \ $(ASSEMBLY).mdb $(BINARIES) $(build_resx_resources) \ $(build_satellite_assembly_list) VALID_CULTURES = ar bg ca zh-CHS cs da de el en es fi fr he hu is it ja ko nl no pl pt ro ru hr sk sq sv th tr id uk be sl et lv lt fa vi hy eu mk af ka fo hi sw gu ta te kn mr gl kok ar-SA bg-BG ca-ES zh-TW cs-CZ da-DK de-DE el-GR en-US fi-FI fr-FR he-IL hu-HU is-IS it-IT ja-JP ko-KR nl-NL nb-NO pl-PL pt-BR ro-RO ru-RU hr-HR sk-SK sq-AL sv-SE th-TH tr-TR id-ID uk-UA be-BY sl-SI et-EE lv-LV lt-LT fa-IR vi-VN hy-AM eu-ES mk-MK af-ZA ka-GE fo-FO hi-IN sw-KE gu-IN ta-IN te-IN kn-IN mr-IN gl-ES kok-IN ar-IQ zh-CN de-CH en-GB es-MX fr-BE it-CH nl-BE nn-NO pt-PT sv-FI ar-EG zh-HK de-AT en-AU es-ES fr-CA ar-LY zh-SG de-LU en-CA es-GT fr-CH ar-DZ zh-MO en-NZ es-CR fr-LU ar-MA en-IE es-PA ar-TN en-ZA es-DO ar-OM es-VE ar-YE es-CO ar-SY es-PE ar-JO en-TT es-AR ar-LB en-ZW es-EC ar-KW en-PH es-CL ar-AE es-UY ar-BH es-PY ar-QA es-BO es-SV es-HN es-NI es-PR zh-CHT s2q = $(subst \ ,?,$1) q2s = $(subst ?,\ ,$1) # use this when result will be quoted unesc2 = $(subst ?, ,$1) build_sources = $(FILES) $(GENERATED_FILES) build_sources_esc = $(call s2q,$(build_sources)) # use unesc2, as build_sources_embed is quoted build_sources_embed = $(call unesc2,$(build_sources_esc:%='$(srcdir)/%')) comma__ = , get_resource_name = $(firstword $(subst $(comma__), ,$1)) get_culture = $(lastword $(subst ., ,$(basename $1))) is_cultured_resource = $(and $(word 3,$(subst ., ,$1)), $(filter $(VALID_CULTURES),$(lastword $(subst ., ,$(basename $1))))) RESOURCES_ESC = $(call s2q,$(RESOURCES)) build_resx_list = $(foreach res, $(RESOURCES_ESC), $(if $(filter %.resx, $(call get_resource_name,$(res))),$(res),)) build_non_culture_resx_list = $(foreach res, $(build_resx_list),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_non_culture_others_list = $(foreach res, $(filter-out $(build_resx_list),$(RESOURCES_ESC)),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_others_list = $(build_non_culture_others_list) build_xamlg_list = $(filter %.xaml.g.cs, $(FILES)) # resgen all .resx resources build_resx_files = $(foreach res, $(build_resx_list), $(call get_resource_name,$(res))) build_resx_resources_esc = $(build_resx_files:.resx=.resources) build_resx_resources = $(call q2s,$(build_resx_resources_esc)) # embed resources for the main assembly build_resx_resources_hack = $(subst .resx,.resources, $(build_non_culture_resx_list)) # use unesc2, as build_resx_resources_embed is quoted build_resx_resources_embed = $(call unesc2,$(build_resx_resources_hack:%='-resource:%')) build_others_files = $(call q2s,$(foreach res, $(build_others_list),$(call get_resource_name,$(res)))) build_others_resources = $(build_others_files) # use unesc2, as build_others_resources_embed is quoted build_others_resources_embed = $(call unesc2,$(build_others_list:%='-resource:$(srcdir)/%')) build_resources = $(build_resx_resources) $(build_others_resources) build_resources_embed = $(build_resx_resources_embed) $(build_others_resources_embed) # -usesourcepath is available only for resgen2 emit_resgen_target_1 = $(call q2s,$1) : $(call q2s,$(subst .resources,.resx,$1)); cd '$$(shell dirname '$$<')' && MONO_IOMAP=drive $$(RESGEN) '$$(shell basename '$$<')' '$$(shell basename '$$@')' emit_resgen_target_2 = $(call q2s,$1) : $(call q2s,$(subst .resources,.resx,$1)); MONO_IOMAP=drive $$(RESGEN) -usesourcepath '$$<' '$$@' emit_resgen_target = $(if $(filter resgen2,$(RESGEN)),$(emit_resgen_target_2),$(emit_resgen_target_1)) emit_resgen_targets = $(foreach res,$(build_resx_resources_esc),$(eval $(call emit_resgen_target,$(res)))) build_references_ref = $(call q2s,$(foreach ref, $(call \ s2q,$(REFERENCES)), $(if $(filter -pkg:%, $(ref)), $(ref), \ $(if $(filter -r:%, $(ref)), $(ref), -r:$(ref))))) $(call \ q2s,$(foreach ref, $(call s2q,$(DLL_REFERENCES)), -r:$(ref))) \ $(call q2s,$(foreach ref, $(call s2q,$(PROJECT_REFERENCES)), \ -r:$(ref))) s2q2s = $(call unesc2,$(call s2q,$1)) cp_actual = test -z $1 || cp $1 $2 cp = $(call cp_actual,'$(call s2q2s,$1)','$(call s2q2s,$2)') rm_actual = test -z '$1' || rm -f '$2' rm = $(call rm_actual,$(call s2q2s,$1),$(call s2q2s,$2)/$(shell basename '$(call s2q2s,$1)')) DISTCLEANFILES = $(GENERATED_FILES) $(pc_files) $(BUILD_DIR)/* assemblyfilesdir = $(pkglibdir) assemblyfiles_DATA = $(ASSEMBLY) bin_SCRIPTS = $(BINARIES) programfilesdir = @libdir@/@PACKAGE@ programfiles_DATA = $(PROGRAMFILES) linuxpkgconfigdir = @libdir@/pkgconfig linuxpkgconfig_DATA = $(LINUX_PKGCONFIG) # generating satellite assemblies culture_resources = $(foreach res, $(RESOURCES_ESC), $(if $(call is_cultured_resource,$(call get_resource_name, $(res))),$(res))) cultures = $(sort $(foreach res, $(culture_resources), $(call get_culture,$(call get_resource_name,$(res))))) culture_resource_dependencies = $(call q2s,$(BUILD_DIR)/$1/$(SATELLITE_ASSEMBLY_NAME): $(subst .resx,.resources,$2)) culture_resource_commandlines = $(call unesc2,cmd_line_satellite_$1 += '/embed:$(subst .resx,.resources,$2)') build_satellite_assembly_list = $(call q2s,$(cultures:%=$(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME))) build_culture_res_files = $(call q2s,$(foreach res, $(culture_resources),$(call get_resource_name,$(res)))) install_satellite_assembly_list = $(subst $(BUILD_DIR),$(DESTDIR)$(libdir)/$(PACKAGE),$(build_satellite_assembly_list)) MONO_UPNP_DLL = $(BUILD_DIR)/Mono.Upnp.dll MONO_SSDP_DLL = $(BUILD_DIR)/Mono.Ssdp.dll MONO_UPNP_DCP_MSMEDIARECEIVERREGISTRAR1_PC = $(BUILD_DIR)/mono.upnp.dcp.msmediareceiverregistrar1.pc all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.include $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MSMediaReceiverRegistrar1/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MSMediaReceiverRegistrar1/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/Makefile.include: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mono.upnp.dcp.msmediareceiverregistrar1.pc: $(top_builddir)/config.status $(srcdir)/mono.upnp.dcp.msmediareceiverregistrar1.pc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) install-assemblyfilesDATA: $(assemblyfiles_DATA) @$(NORMAL_INSTALL) test -z "$(assemblyfilesdir)" || $(MKDIR_P) "$(DESTDIR)$(assemblyfilesdir)" @list='$(assemblyfiles_DATA)'; test -n "$(assemblyfilesdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(assemblyfilesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(assemblyfilesdir)" || exit $$?; \ done uninstall-assemblyfilesDATA: @$(NORMAL_UNINSTALL) @list='$(assemblyfiles_DATA)'; test -n "$(assemblyfilesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(assemblyfilesdir)'; $(am__uninstall_files_from_dir) install-linuxpkgconfigDATA: $(linuxpkgconfig_DATA) @$(NORMAL_INSTALL) test -z "$(linuxpkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(linuxpkgconfigdir)" @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(linuxpkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(linuxpkgconfigdir)" || exit $$?; \ done uninstall-linuxpkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(linuxpkgconfigdir)'; $(am__uninstall_files_from_dir) install-programfilesDATA: $(programfiles_DATA) @$(NORMAL_INSTALL) test -z "$(programfilesdir)" || $(MKDIR_P) "$(DESTDIR)$(programfilesdir)" @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(programfilesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(programfilesdir)" || exit $$?; \ done uninstall-programfilesDATA: @$(NORMAL_UNINSTALL) @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(programfilesdir)'; $(am__uninstall_files_from_dir) tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(assemblyfilesdir)" "$(DESTDIR)$(linuxpkgconfigdir)" "$(DESTDIR)$(programfilesdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-assemblyfilesDATA install-linuxpkgconfigDATA \ install-programfilesDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binSCRIPTS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-assemblyfilesDATA uninstall-binSCRIPTS \ uninstall-linuxpkgconfigDATA uninstall-programfilesDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-assemblyfilesDATA \ install-binSCRIPTS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-linuxpkgconfigDATA install-man install-pdf \ install-pdf-am install-programfilesDATA install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \ uninstall-am uninstall-assemblyfilesDATA uninstall-binSCRIPTS \ uninstall-linuxpkgconfigDATA uninstall-programfilesDATA all: $(ASSEMBLY) $(PROGRAMFILES) $(LINUX_PKGCONFIG) # macros # $(call emit-deploy-target,deploy-variable-name) define emit-deploy-target $($1): $($1_SOURCE) mkdir -p '$$(shell dirname '$$@')' cp '$$<' '$$@' endef # $(call emit-deploy-wrapper,wrapper-variable-name,wrapper-sourcefile,x) # assumes that for a wrapper foo.pc its source template is foo.pc.in # if $3 is non-empty then wrapper is marked exec define emit-deploy-wrapper $($1): $2 mkdir -p '$$(shell dirname '$$@')' cp '$$<' '$$@' $(if $3,chmod +x '$$@') endef $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_dependencies,$(call get_culture,$(call get_resource_name,$(res))),$(call get_resource_name,$(res)))))) $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_commandlines,$(call get_culture,$(call get_resource_name,$(res))),$(res))))) $(build_satellite_assembly_list): $(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME): mkdir -p '$(@D)' $(AL) -out:'$@' -culture:$* -t:lib $(cmd_line_satellite_$*) $(install_satellite_assembly_list): mkdir -p '$(@D)' cp $(subst $(DESTDIR)$(libdir)/$(PACKAGE), $(BUILD_DIR), $@) $@ install-satellite-assemblies: $(install_satellite_assembly_list) uninstall-satellite-assemblies: rm -rf $(install_satellite_assembly_list) $(eval $(call emit-deploy-target,MONO_UPNP_DLL)) $(eval $(call emit-deploy-target,MONO_SSDP_DLL)) $(eval $(call emit-deploy-wrapper,MONO_UPNP_DCP_MSMEDIARECEIVERREGISTRAR1_PC,mono.upnp.dcp.msmediareceiverregistrar1.pc)) $(eval $(call emit_resgen_targets)) $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(ASSEMBLY_MDB): $(ASSEMBLY) $(ASSEMBLY): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(shell dirname $(ASSEMBLY)) $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: mono.upnp.dcp.msmediareceiverregistrar1.pc.in0000664000175000017500000000043511761736724044675 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MSMediaReceiverRegistrar1assemblies_dir=@expanded_libdir@/@PACKAGE@ Libraries=${assemblies_dir}/MSMediaServerRegistrar1.dll Name: Mono.Upnp.Dcp.MSMediaReceiverRegistrar1 Description: Mono.Upnp.Dcp.MSMediaReceiverRegistrar1 Version: @VERSION@ Requires: Libs: -r:${assemblies_dir}/MSMediaServerRegistrar1.dll Mono.Upnp.Dcp.MSMediaReceiverRegistrar1/0000775000175000017500000000000011707010776043332 5ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MSMediaReceiverRegistrar1MSMediaReceiverRegistrar.cs0000664000175000017500000000547411707010776050522 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MSMediaReceiverRegistrar1/Mono.Upnp.Dcp.MSMediaReceiverRegistrar1// // MSMediaReceiverRegistrar.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using Mono.Upnp.Control; namespace Mono.Upnp.Dcp.MSMediaReceiverRegistrar1 { public abstract class MSMediaReceiverRegistrar { public static readonly ServiceType ServiceType = new ServiceType ("microsoft.com", "X_MS_MediaReceiverRegistrar", new Version (1, 0)); [UpnpAction] public virtual void IsAuthorized ([UpnpArgument ("DeviceId")] string deviceId, [UpnpArgument ("Result")] out long result) { result = IsAuthorized (deviceId); } protected abstract long IsAuthorized (string deviceId); [UpnpAction] public virtual void RegisterDevice ([UpnpArgument ("RegistrationRegMsg")] [UpnpRelatedStateVariable (DataType = "bin.base64")] byte[] registrationRequestMessage, [UpnpArgument ("RegistrationRespMsg")] [UpnpRelatedStateVariable (DataType = "bin.base64")] out byte [] registrationResponseMessage) { registrationResponseMessage = RegisterDevice (registrationRequestMessage); } protected abstract byte[] RegisterDevice (byte[] registrationRequestMessage); [UpnpAction] public virtual void IsValidated ([UpnpArgument ("DeviceId")] string deviceId, [UpnpArgument ("Result")] out long result) { result = IsAuthorized (deviceId); } protected abstract long IsValidated (string deviceId); } } AssemblyInfo.cs0000664000175000017500000000443411714307244037011 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MSMediaReceiverRegistrar1// // AssemblyInfo.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System.Reflection; using System.Runtime.CompilerServices; // Information about this assembly is defined by the following attributes. // Change them to the values specific to your project. [assembly: AssemblyTitle ("MSMediaReceiverRegistrar1")] [assembly: AssemblyDescription ("A client and server implementation of the MS MediaReceiverRegistrar1 service used by Microsoft MediaReceiver devices.")] [assembly: AssemblyConfiguration ("")] [assembly: AssemblyCompany ("")] [assembly: AssemblyProduct ("")] [assembly: AssemblyCopyright ("Scott Thomas")] [assembly: AssemblyTrademark ("")] [assembly: AssemblyCulture ("")] // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". // The form "{Major}.{Minor}.*" will automatically update the build and revision, // and "{Major}.{Minor}.{Build}.*" will update just the revision. [assembly: AssemblyVersion ("1.0.*")] // The following attributes are used to specify the signing key for the assembly, // if desired. See the Mono documentation for more information about signing. //[assembly: AssemblyDelaySign(false)] //[assembly: AssemblyKeyFile("")] mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.GtkClient/0000775000175000017500000000000011761740037033406 5ustar00lorentzlorentz00000000000000Makefile.am0000664000175000017500000001062411715013277035364 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.GtkClient EXTRA_DIST = # Warning: This is an automatically generated file, do not edit! if ENABLE_DEBUG ASSEMBLY_COMPILER_COMMAND = gmcs ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug "-define:DEBUG" ASSEMBLY = ../../../../bin/Mono.Upnp.Dcp.MediaServer1.GtkClient.dll ASSEMBLY_MDB = $(ASSEMBLY).mdb COMPILE_TARGET = library PROJECT_REFERENCES = \ ../../../../bin/Mono.Upnp.Dcp.MediaServer1.dll \ ../../../../bin/Mono.Upnp.GtkClient.exe \ ../../../../bin/Mono.Upnp.dll BUILD_DIR = ../../../../bin MONO_UPNP_DCP_MEDIASERVER1_GTKCLIENT_DLL_MDB_SOURCE=../../../../bin/Mono.Upnp.Dcp.MediaServer1.GtkClient.dll.mdb MONO_UPNP_DCP_MEDIASERVER1_GTKCLIENT_DLL_MDB=$(BUILD_DIR)/Mono.Upnp.Dcp.MediaServer1.GtkClient.dll.mdb MONO_UPNP_DCP_MEDIASERVER1_DLL_SOURCE=../../../../bin/Mono.Upnp.Dcp.MediaServer1.dll MONO_UPNP_DLL_SOURCE=../../../../bin/Mono.Upnp.dll MONO_SSDP_DLL_SOURCE=../../../../bin/Mono.Ssdp.dll MONO_SSDP_DLL_MDB_SOURCE=../../../../bin/Mono.Ssdp.dll.mdb MONO_SSDP_DLL_MDB=$(BUILD_DIR)/Mono.Ssdp.dll.mdb MONO_UPNP_DLL_MDB_SOURCE=../../../../bin/Mono.Upnp.dll.mdb MONO_UPNP_DLL_MDB=$(BUILD_DIR)/Mono.Upnp.dll.mdb MONO_UPNP_DCP_MEDIASERVER1_DLL_MDB_SOURCE=../../../../bin/Mono.Upnp.Dcp.MediaServer1.dll.mdb MONO_UPNP_DCP_MEDIASERVER1_DLL_MDB=$(BUILD_DIR)/Mono.Upnp.Dcp.MediaServer1.dll.mdb MONO_UPNP_GTKCLIENT_EXE_SOURCE=../../../../bin/Mono.Upnp.GtkClient.exe MONO_UPNP_GTKCLIENT_EXE_MDB_SOURCE=../../../../bin/Mono.Upnp.GtkClient.exe.mdb MONO_UPNP_GTKCLIENT_EXE_MDB=$(BUILD_DIR)/Mono.Upnp.GtkClient.exe.mdb endif if ENABLE_RELEASE ASSEMBLY_COMPILER_COMMAND = gmcs ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- ASSEMBLY = ../../../../bin/Mono.Upnp.Dcp.MediaServer1.GtkClient.dll ASSEMBLY_MDB = COMPILE_TARGET = library PROJECT_REFERENCES = \ ../../../../bin/Mono.Upnp.Dcp.MediaServer1.dll \ ../../../../bin/Mono.Upnp.GtkClient.exe \ ../../../../bin/Mono.Upnp.dll BUILD_DIR = ../../../../bin MONO_UPNP_DCP_MEDIASERVER1_GTKCLIENT_DLL_MDB= MONO_UPNP_DCP_MEDIASERVER1_DLL_SOURCE=../../../../bin/Mono.Upnp.Dcp.MediaServer1.dll MONO_UPNP_DLL_SOURCE=../../../../bin/Mono.Upnp.dll MONO_SSDP_DLL_SOURCE=../../../../bin/Mono.Ssdp.dll MONO_SSDP_DLL_MDB= MONO_UPNP_DLL_MDB= MONO_UPNP_DCP_MEDIASERVER1_DLL_MDB= MONO_UPNP_GTKCLIENT_EXE_SOURCE=../../../../bin/Mono.Upnp.GtkClient.exe MONO_UPNP_GTKCLIENT_EXE_MDB= endif AL=al2 SATELLITE_ASSEMBLY_NAME=$(notdir $(basename $(ASSEMBLY))).resources.dll PROGRAMFILES = \ $(MONO_UPNP_DCP_MEDIASERVER1_GTKCLIENT_DLL_MDB) \ $(MONO_UPNP_DCP_MEDIASERVER1_DLL) \ $(MONO_UPNP_DLL) \ $(MONO_SSDP_DLL) \ $(MONO_SSDP_DLL_MDB) \ $(MONO_UPNP_DLL_MDB) \ $(MONO_UPNP_DCP_MEDIASERVER1_DLL_MDB) \ $(MONO_UPNP_GTKCLIENT_EXE) \ $(MONO_UPNP_GTKCLIENT_EXE_MDB) LINUX_PKGCONFIG = \ $(MONO_UPNP_DCP_MEDIASERVER1_GTKCLIENT_PC) RESGEN=resgen2 all: $(ASSEMBLY) $(PROGRAMFILES) $(LINUX_PKGCONFIG) FILES = \ AssemblyInfo.cs \ Mono.Upnp.Dcp.MediaServer1.GtkClient/ContentDirectoryInfo.cs \ Mono.Upnp.Dcp.MediaServer1.GtkClient/ContentDirectoryServiceInfoProvider.cs \ Mono.Upnp.Dcp.MediaServer1.GtkClient/ObjectInfo.cs DATA_FILES = RESOURCES = EXTRAS = \ Mono.Upnp.Dcp.MediaServer1.GtkClient \ mono.upnp.dcp.mediaserver1.gtkclient.pc.in REFERENCES = \ ../../../../bin/Mono.Upnp.Dcp.MediaServer1.dll \ ../../../../bin/Mono.Upnp.dll \ ../../../../bin/Mono.Upnp.GtkClient.exe \ -pkg:glib-sharp-2.0 \ -pkg:gtk-sharp-2.0 \ -pkg:mono-addins \ System DLL_REFERENCES = CLEANFILES = $(PROGRAMFILES) $(LINUX_PKGCONFIG) include $(top_srcdir)/Makefile.include MONO_UPNP_DCP_MEDIASERVER1_DLL = $(BUILD_DIR)/Mono.Upnp.Dcp.MediaServer1.dll MONO_UPNP_DLL = $(BUILD_DIR)/Mono.Upnp.dll MONO_SSDP_DLL = $(BUILD_DIR)/Mono.Ssdp.dll MONO_UPNP_GTKCLIENT_EXE = $(BUILD_DIR)/Mono.Upnp.GtkClient.exe MONO_UPNP_DCP_MEDIASERVER1_GTKCLIENT_PC = $(BUILD_DIR)/mono.upnp.dcp.mediaserver1.gtkclient.pc $(eval $(call emit-deploy-wrapper,MONO_UPNP_DCP_MEDIASERVER1_GTKCLIENT_PC,mono.upnp.dcp.mediaserver1.gtkclient.pc)) $(eval $(call emit_resgen_targets)) $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(ASSEMBLY_MDB): $(ASSEMBLY) $(ASSEMBLY): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(shell dirname $(ASSEMBLY)) $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) Makefile.in0000664000175000017500000006635511761736755035427 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.GtkClient# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/mono.upnp.dcp.mediaserver1.gtkclient.pc.in \ $(top_srcdir)/Makefile.include subdir = src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.GtkClient ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/expansions.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = mono.upnp.dcp.mediaserver1.gtkclient.pc CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(bindir)" \ "$(DESTDIR)$(assemblyfilesdir)" \ "$(DESTDIR)$(linuxpkgconfigdir)" \ "$(DESTDIR)$(programfilesdir)" SCRIPTS = $(bin_SCRIPTS) SOURCES = DIST_SOURCES = DATA = $(assemblyfiles_DATA) $(linuxpkgconfig_DATA) \ $(programfiles_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ GLADE_SHARP_20_CFLAGS = @GLADE_SHARP_20_CFLAGS@ GLADE_SHARP_20_LIBS = @GLADE_SHARP_20_LIBS@ GLIB_SHARP_20_CFLAGS = @GLIB_SHARP_20_CFLAGS@ GLIB_SHARP_20_LIBS = @GLIB_SHARP_20_LIBS@ GMCS = @GMCS@ GTK_SHARP_20_CFLAGS = @GTK_SHARP_20_CFLAGS@ GTK_SHARP_20_LIBS = @GTK_SHARP_20_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MONO_ADDINS_CFLAGS = @MONO_ADDINS_CFLAGS@ MONO_ADDINS_LIBS = @MONO_ADDINS_LIBS@ NUNIT_CFLAGS = @NUNIT_CFLAGS@ NUNIT_CMD = @NUNIT_CMD@ NUNIT_LIBS = @NUNIT_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TAGLIB_SHARP_CFLAGS = @TAGLIB_SHARP_CFLAGS@ TAGLIB_SHARP_LIBS = @TAGLIB_SHARP_LIBS@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_bindir = @expanded_bindir@ expanded_datadir = @expanded_datadir@ expanded_libdir = @expanded_libdir@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = $(build_sources) $(build_resx_files) \ $(build_others_files) $(ASSEMBLY_WRAPPER_IN) $(EXTRAS) \ $(DATA_FILES) $(build_culture_res_files) # Warning: This is an automatically generated file, do not edit! @ENABLE_DEBUG_TRUE@ASSEMBLY_COMPILER_COMMAND = gmcs @ENABLE_RELEASE_TRUE@ASSEMBLY_COMPILER_COMMAND = gmcs @ENABLE_DEBUG_TRUE@ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug "-define:DEBUG" @ENABLE_RELEASE_TRUE@ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- @ENABLE_DEBUG_TRUE@ASSEMBLY = ../../../../bin/Mono.Upnp.Dcp.MediaServer1.GtkClient.dll @ENABLE_RELEASE_TRUE@ASSEMBLY = ../../../../bin/Mono.Upnp.Dcp.MediaServer1.GtkClient.dll @ENABLE_DEBUG_TRUE@ASSEMBLY_MDB = $(ASSEMBLY).mdb @ENABLE_RELEASE_TRUE@ASSEMBLY_MDB = @ENABLE_DEBUG_TRUE@COMPILE_TARGET = library @ENABLE_RELEASE_TRUE@COMPILE_TARGET = library @ENABLE_DEBUG_TRUE@PROJECT_REFERENCES = \ @ENABLE_DEBUG_TRUE@ ../../../../bin/Mono.Upnp.Dcp.MediaServer1.dll \ @ENABLE_DEBUG_TRUE@ ../../../../bin/Mono.Upnp.GtkClient.exe \ @ENABLE_DEBUG_TRUE@ ../../../../bin/Mono.Upnp.dll @ENABLE_RELEASE_TRUE@PROJECT_REFERENCES = \ @ENABLE_RELEASE_TRUE@ ../../../../bin/Mono.Upnp.Dcp.MediaServer1.dll \ @ENABLE_RELEASE_TRUE@ ../../../../bin/Mono.Upnp.GtkClient.exe \ @ENABLE_RELEASE_TRUE@ ../../../../bin/Mono.Upnp.dll @ENABLE_DEBUG_TRUE@BUILD_DIR = ../../../../bin @ENABLE_RELEASE_TRUE@BUILD_DIR = ../../../../bin @ENABLE_DEBUG_TRUE@MONO_UPNP_DCP_MEDIASERVER1_GTKCLIENT_DLL_MDB_SOURCE = ../../../../bin/Mono.Upnp.Dcp.MediaServer1.GtkClient.dll.mdb @ENABLE_DEBUG_TRUE@MONO_UPNP_DCP_MEDIASERVER1_GTKCLIENT_DLL_MDB = $(BUILD_DIR)/Mono.Upnp.Dcp.MediaServer1.GtkClient.dll.mdb @ENABLE_RELEASE_TRUE@MONO_UPNP_DCP_MEDIASERVER1_GTKCLIENT_DLL_MDB = @ENABLE_DEBUG_TRUE@MONO_UPNP_DCP_MEDIASERVER1_DLL_SOURCE = ../../../../bin/Mono.Upnp.Dcp.MediaServer1.dll @ENABLE_RELEASE_TRUE@MONO_UPNP_DCP_MEDIASERVER1_DLL_SOURCE = ../../../../bin/Mono.Upnp.Dcp.MediaServer1.dll @ENABLE_DEBUG_TRUE@MONO_UPNP_DLL_SOURCE = ../../../../bin/Mono.Upnp.dll @ENABLE_RELEASE_TRUE@MONO_UPNP_DLL_SOURCE = ../../../../bin/Mono.Upnp.dll @ENABLE_DEBUG_TRUE@MONO_SSDP_DLL_SOURCE = ../../../../bin/Mono.Ssdp.dll @ENABLE_RELEASE_TRUE@MONO_SSDP_DLL_SOURCE = ../../../../bin/Mono.Ssdp.dll @ENABLE_DEBUG_TRUE@MONO_SSDP_DLL_MDB_SOURCE = ../../../../bin/Mono.Ssdp.dll.mdb @ENABLE_DEBUG_TRUE@MONO_SSDP_DLL_MDB = $(BUILD_DIR)/Mono.Ssdp.dll.mdb @ENABLE_RELEASE_TRUE@MONO_SSDP_DLL_MDB = @ENABLE_DEBUG_TRUE@MONO_UPNP_DLL_MDB_SOURCE = ../../../../bin/Mono.Upnp.dll.mdb @ENABLE_DEBUG_TRUE@MONO_UPNP_DLL_MDB = $(BUILD_DIR)/Mono.Upnp.dll.mdb @ENABLE_RELEASE_TRUE@MONO_UPNP_DLL_MDB = @ENABLE_DEBUG_TRUE@MONO_UPNP_DCP_MEDIASERVER1_DLL_MDB_SOURCE = ../../../../bin/Mono.Upnp.Dcp.MediaServer1.dll.mdb @ENABLE_DEBUG_TRUE@MONO_UPNP_DCP_MEDIASERVER1_DLL_MDB = $(BUILD_DIR)/Mono.Upnp.Dcp.MediaServer1.dll.mdb @ENABLE_RELEASE_TRUE@MONO_UPNP_DCP_MEDIASERVER1_DLL_MDB = @ENABLE_DEBUG_TRUE@MONO_UPNP_GTKCLIENT_EXE_SOURCE = ../../../../bin/Mono.Upnp.GtkClient.exe @ENABLE_RELEASE_TRUE@MONO_UPNP_GTKCLIENT_EXE_SOURCE = ../../../../bin/Mono.Upnp.GtkClient.exe @ENABLE_DEBUG_TRUE@MONO_UPNP_GTKCLIENT_EXE_MDB_SOURCE = ../../../../bin/Mono.Upnp.GtkClient.exe.mdb @ENABLE_DEBUG_TRUE@MONO_UPNP_GTKCLIENT_EXE_MDB = $(BUILD_DIR)/Mono.Upnp.GtkClient.exe.mdb @ENABLE_RELEASE_TRUE@MONO_UPNP_GTKCLIENT_EXE_MDB = AL = al2 SATELLITE_ASSEMBLY_NAME = $(notdir $(basename $(ASSEMBLY))).resources.dll PROGRAMFILES = \ $(MONO_UPNP_DCP_MEDIASERVER1_GTKCLIENT_DLL_MDB) \ $(MONO_UPNP_DCP_MEDIASERVER1_DLL) \ $(MONO_UPNP_DLL) \ $(MONO_SSDP_DLL) \ $(MONO_SSDP_DLL_MDB) \ $(MONO_UPNP_DLL_MDB) \ $(MONO_UPNP_DCP_MEDIASERVER1_DLL_MDB) \ $(MONO_UPNP_GTKCLIENT_EXE) \ $(MONO_UPNP_GTKCLIENT_EXE_MDB) LINUX_PKGCONFIG = \ $(MONO_UPNP_DCP_MEDIASERVER1_GTKCLIENT_PC) RESGEN = resgen2 FILES = \ AssemblyInfo.cs \ Mono.Upnp.Dcp.MediaServer1.GtkClient/ContentDirectoryInfo.cs \ Mono.Upnp.Dcp.MediaServer1.GtkClient/ContentDirectoryServiceInfoProvider.cs \ Mono.Upnp.Dcp.MediaServer1.GtkClient/ObjectInfo.cs DATA_FILES = RESOURCES = EXTRAS = \ Mono.Upnp.Dcp.MediaServer1.GtkClient \ mono.upnp.dcp.mediaserver1.gtkclient.pc.in REFERENCES = \ ../../../../bin/Mono.Upnp.Dcp.MediaServer1.dll \ ../../../../bin/Mono.Upnp.dll \ ../../../../bin/Mono.Upnp.GtkClient.exe \ -pkg:glib-sharp-2.0 \ -pkg:gtk-sharp-2.0 \ -pkg:mono-addins \ System DLL_REFERENCES = CLEANFILES = $(PROGRAMFILES) $(LINUX_PKGCONFIG) $(ASSEMBLY) \ $(ASSEMBLY).mdb $(BINARIES) $(build_resx_resources) \ $(build_satellite_assembly_list) VALID_CULTURES = ar bg ca zh-CHS cs da de el en es fi fr he hu is it ja ko nl no pl pt ro ru hr sk sq sv th tr id uk be sl et lv lt fa vi hy eu mk af ka fo hi sw gu ta te kn mr gl kok ar-SA bg-BG ca-ES zh-TW cs-CZ da-DK de-DE el-GR en-US fi-FI fr-FR he-IL hu-HU is-IS it-IT ja-JP ko-KR nl-NL nb-NO pl-PL pt-BR ro-RO ru-RU hr-HR sk-SK sq-AL sv-SE th-TH tr-TR id-ID uk-UA be-BY sl-SI et-EE lv-LV lt-LT fa-IR vi-VN hy-AM eu-ES mk-MK af-ZA ka-GE fo-FO hi-IN sw-KE gu-IN ta-IN te-IN kn-IN mr-IN gl-ES kok-IN ar-IQ zh-CN de-CH en-GB es-MX fr-BE it-CH nl-BE nn-NO pt-PT sv-FI ar-EG zh-HK de-AT en-AU es-ES fr-CA ar-LY zh-SG de-LU en-CA es-GT fr-CH ar-DZ zh-MO en-NZ es-CR fr-LU ar-MA en-IE es-PA ar-TN en-ZA es-DO ar-OM es-VE ar-YE es-CO ar-SY es-PE ar-JO en-TT es-AR ar-LB en-ZW es-EC ar-KW en-PH es-CL ar-AE es-UY ar-BH es-PY ar-QA es-BO es-SV es-HN es-NI es-PR zh-CHT s2q = $(subst \ ,?,$1) q2s = $(subst ?,\ ,$1) # use this when result will be quoted unesc2 = $(subst ?, ,$1) build_sources = $(FILES) $(GENERATED_FILES) build_sources_esc = $(call s2q,$(build_sources)) # use unesc2, as build_sources_embed is quoted build_sources_embed = $(call unesc2,$(build_sources_esc:%='$(srcdir)/%')) comma__ = , get_resource_name = $(firstword $(subst $(comma__), ,$1)) get_culture = $(lastword $(subst ., ,$(basename $1))) is_cultured_resource = $(and $(word 3,$(subst ., ,$1)), $(filter $(VALID_CULTURES),$(lastword $(subst ., ,$(basename $1))))) RESOURCES_ESC = $(call s2q,$(RESOURCES)) build_resx_list = $(foreach res, $(RESOURCES_ESC), $(if $(filter %.resx, $(call get_resource_name,$(res))),$(res),)) build_non_culture_resx_list = $(foreach res, $(build_resx_list),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_non_culture_others_list = $(foreach res, $(filter-out $(build_resx_list),$(RESOURCES_ESC)),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_others_list = $(build_non_culture_others_list) build_xamlg_list = $(filter %.xaml.g.cs, $(FILES)) # resgen all .resx resources build_resx_files = $(foreach res, $(build_resx_list), $(call get_resource_name,$(res))) build_resx_resources_esc = $(build_resx_files:.resx=.resources) build_resx_resources = $(call q2s,$(build_resx_resources_esc)) # embed resources for the main assembly build_resx_resources_hack = $(subst .resx,.resources, $(build_non_culture_resx_list)) # use unesc2, as build_resx_resources_embed is quoted build_resx_resources_embed = $(call unesc2,$(build_resx_resources_hack:%='-resource:%')) build_others_files = $(call q2s,$(foreach res, $(build_others_list),$(call get_resource_name,$(res)))) build_others_resources = $(build_others_files) # use unesc2, as build_others_resources_embed is quoted build_others_resources_embed = $(call unesc2,$(build_others_list:%='-resource:$(srcdir)/%')) build_resources = $(build_resx_resources) $(build_others_resources) build_resources_embed = $(build_resx_resources_embed) $(build_others_resources_embed) # -usesourcepath is available only for resgen2 emit_resgen_target_1 = $(call q2s,$1) : $(call q2s,$(subst .resources,.resx,$1)); cd '$$(shell dirname '$$<')' && MONO_IOMAP=drive $$(RESGEN) '$$(shell basename '$$<')' '$$(shell basename '$$@')' emit_resgen_target_2 = $(call q2s,$1) : $(call q2s,$(subst .resources,.resx,$1)); MONO_IOMAP=drive $$(RESGEN) -usesourcepath '$$<' '$$@' emit_resgen_target = $(if $(filter resgen2,$(RESGEN)),$(emit_resgen_target_2),$(emit_resgen_target_1)) emit_resgen_targets = $(foreach res,$(build_resx_resources_esc),$(eval $(call emit_resgen_target,$(res)))) build_references_ref = $(call q2s,$(foreach ref, $(call \ s2q,$(REFERENCES)), $(if $(filter -pkg:%, $(ref)), $(ref), \ $(if $(filter -r:%, $(ref)), $(ref), -r:$(ref))))) $(call \ q2s,$(foreach ref, $(call s2q,$(DLL_REFERENCES)), -r:$(ref))) \ $(call q2s,$(foreach ref, $(call s2q,$(PROJECT_REFERENCES)), \ -r:$(ref))) s2q2s = $(call unesc2,$(call s2q,$1)) cp_actual = test -z $1 || cp $1 $2 cp = $(call cp_actual,'$(call s2q2s,$1)','$(call s2q2s,$2)') rm_actual = test -z '$1' || rm -f '$2' rm = $(call rm_actual,$(call s2q2s,$1),$(call s2q2s,$2)/$(shell basename '$(call s2q2s,$1)')) DISTCLEANFILES = $(GENERATED_FILES) $(pc_files) $(BUILD_DIR)/* assemblyfilesdir = $(pkglibdir) assemblyfiles_DATA = $(ASSEMBLY) bin_SCRIPTS = $(BINARIES) programfilesdir = @libdir@/@PACKAGE@ programfiles_DATA = $(PROGRAMFILES) linuxpkgconfigdir = @libdir@/pkgconfig linuxpkgconfig_DATA = $(LINUX_PKGCONFIG) # generating satellite assemblies culture_resources = $(foreach res, $(RESOURCES_ESC), $(if $(call is_cultured_resource,$(call get_resource_name, $(res))),$(res))) cultures = $(sort $(foreach res, $(culture_resources), $(call get_culture,$(call get_resource_name,$(res))))) culture_resource_dependencies = $(call q2s,$(BUILD_DIR)/$1/$(SATELLITE_ASSEMBLY_NAME): $(subst .resx,.resources,$2)) culture_resource_commandlines = $(call unesc2,cmd_line_satellite_$1 += '/embed:$(subst .resx,.resources,$2)') build_satellite_assembly_list = $(call q2s,$(cultures:%=$(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME))) build_culture_res_files = $(call q2s,$(foreach res, $(culture_resources),$(call get_resource_name,$(res)))) install_satellite_assembly_list = $(subst $(BUILD_DIR),$(DESTDIR)$(libdir)/$(PACKAGE),$(build_satellite_assembly_list)) MONO_UPNP_DCP_MEDIASERVER1_DLL = $(BUILD_DIR)/Mono.Upnp.Dcp.MediaServer1.dll MONO_UPNP_DLL = $(BUILD_DIR)/Mono.Upnp.dll MONO_SSDP_DLL = $(BUILD_DIR)/Mono.Ssdp.dll MONO_UPNP_GTKCLIENT_EXE = $(BUILD_DIR)/Mono.Upnp.GtkClient.exe MONO_UPNP_DCP_MEDIASERVER1_GTKCLIENT_PC = $(BUILD_DIR)/mono.upnp.dcp.mediaserver1.gtkclient.pc all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.include $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.GtkClient/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.GtkClient/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/Makefile.include: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mono.upnp.dcp.mediaserver1.gtkclient.pc: $(top_builddir)/config.status $(srcdir)/mono.upnp.dcp.mediaserver1.gtkclient.pc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) install-assemblyfilesDATA: $(assemblyfiles_DATA) @$(NORMAL_INSTALL) test -z "$(assemblyfilesdir)" || $(MKDIR_P) "$(DESTDIR)$(assemblyfilesdir)" @list='$(assemblyfiles_DATA)'; test -n "$(assemblyfilesdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(assemblyfilesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(assemblyfilesdir)" || exit $$?; \ done uninstall-assemblyfilesDATA: @$(NORMAL_UNINSTALL) @list='$(assemblyfiles_DATA)'; test -n "$(assemblyfilesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(assemblyfilesdir)'; $(am__uninstall_files_from_dir) install-linuxpkgconfigDATA: $(linuxpkgconfig_DATA) @$(NORMAL_INSTALL) test -z "$(linuxpkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(linuxpkgconfigdir)" @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(linuxpkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(linuxpkgconfigdir)" || exit $$?; \ done uninstall-linuxpkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(linuxpkgconfigdir)'; $(am__uninstall_files_from_dir) install-programfilesDATA: $(programfiles_DATA) @$(NORMAL_INSTALL) test -z "$(programfilesdir)" || $(MKDIR_P) "$(DESTDIR)$(programfilesdir)" @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(programfilesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(programfilesdir)" || exit $$?; \ done uninstall-programfilesDATA: @$(NORMAL_UNINSTALL) @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(programfilesdir)'; $(am__uninstall_files_from_dir) tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(assemblyfilesdir)" "$(DESTDIR)$(linuxpkgconfigdir)" "$(DESTDIR)$(programfilesdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-assemblyfilesDATA install-linuxpkgconfigDATA \ install-programfilesDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binSCRIPTS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-assemblyfilesDATA uninstall-binSCRIPTS \ uninstall-linuxpkgconfigDATA uninstall-programfilesDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-assemblyfilesDATA \ install-binSCRIPTS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-linuxpkgconfigDATA install-man install-pdf \ install-pdf-am install-programfilesDATA install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \ uninstall-am uninstall-assemblyfilesDATA uninstall-binSCRIPTS \ uninstall-linuxpkgconfigDATA uninstall-programfilesDATA all: $(ASSEMBLY) $(PROGRAMFILES) $(LINUX_PKGCONFIG) # macros # $(call emit-deploy-target,deploy-variable-name) define emit-deploy-target $($1): $($1_SOURCE) mkdir -p '$$(shell dirname '$$@')' cp '$$<' '$$@' endef # $(call emit-deploy-wrapper,wrapper-variable-name,wrapper-sourcefile,x) # assumes that for a wrapper foo.pc its source template is foo.pc.in # if $3 is non-empty then wrapper is marked exec define emit-deploy-wrapper $($1): $2 mkdir -p '$$(shell dirname '$$@')' cp '$$<' '$$@' $(if $3,chmod +x '$$@') endef $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_dependencies,$(call get_culture,$(call get_resource_name,$(res))),$(call get_resource_name,$(res)))))) $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_commandlines,$(call get_culture,$(call get_resource_name,$(res))),$(res))))) $(build_satellite_assembly_list): $(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME): mkdir -p '$(@D)' $(AL) -out:'$@' -culture:$* -t:lib $(cmd_line_satellite_$*) $(install_satellite_assembly_list): mkdir -p '$(@D)' cp $(subst $(DESTDIR)$(libdir)/$(PACKAGE), $(BUILD_DIR), $@) $@ install-satellite-assemblies: $(install_satellite_assembly_list) uninstall-satellite-assemblies: rm -rf $(install_satellite_assembly_list) $(eval $(call emit-deploy-wrapper,MONO_UPNP_DCP_MEDIASERVER1_GTKCLIENT_PC,mono.upnp.dcp.mediaserver1.gtkclient.pc)) $(eval $(call emit_resgen_targets)) $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(ASSEMBLY_MDB): $(ASSEMBLY) $(ASSEMBLY): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(shell dirname $(ASSEMBLY)) $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: mono.upnp.dcp.mediaserver1.gtkclient.pc.in0000664000175000017500000000046111761736722043336 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.GtkClientassemblies_dir=@expanded_libdir@/@PACKAGE@ Libraries=${assemblies_dir}/Mono.Upnp.Dcp.MediaServer1.GtkClient.dll Name: Mono.Upnp.Dcp.MediaServer1.GtkClient Description: Mono.Upnp.Dcp.MediaServer1.GtkClient Version: @VERSION@ Requires: Libs: -r:${assemblies_dir}/Mono.Upnp.Dcp.MediaServer1.GtkClient.dll AssemblyInfo.cs0000664000175000017500000000440011707010776036247 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.GtkClient// // AssemblyInfo.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System.Reflection; using System.Runtime.CompilerServices; using Mono.Addins; // Information about this assembly is defined by the following attributes. // Change them to the values specific to your project. [assembly: AssemblyTitle("Mono.Upnp.Dcp.MediaServer1.GtkClient")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("")] [assembly: AssemblyCopyright("")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". // The form "{Major}.{Minor}.*" will automatically update the build and revision, // and "{Major}.{Minor}.{Build}.*" will update just the revision. [assembly: AssemblyVersion("1.0.*")] // The following attributes are used to specify the signing key for the assembly, // if desired. See the Mono documentation for more information about signing. //[assembly: AssemblyDelaySign(false)] //[assembly: AssemblyKeyFile("")] [assembly: Addin] [assembly: AddinDependency ("Mono.Upnp.GtkClient", "1.0")] Mono.Upnp.Dcp.MediaServer1.GtkClient/0000775000175000017500000000000011707010776042036 5ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.GtkClientObjectInfo.cs0000664000175000017500000000431211707010776044407 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.GtkClient/Mono.Upnp.Dcp.MediaServer1.GtkClient// // ObjectInfo.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Reflection; using Gtk; using Object = Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.Object; namespace Mono.Upnp.Dcp.MediaServer1.GtkClient { public class ObjectInfo : VBox { public ObjectInfo (Object @object) { if (@object == null) { throw new ArgumentNullException ("object"); } var properties = @object.GetType ().GetProperties (BindingFlags.Instance | BindingFlags.Public); var table = new Table ((uint)properties.Length, 2, false); uint row = 0; foreach (var property in properties) { table.Attach (new Label (property.Name), 0, 1, row, row + 1); var value = property.GetValue (@object, null); if (value == null) { value = ""; } table.Attach (new Label (value.ToString ()), 1, 2, row, row + 1); row++; } Add (table); ShowAll (); } } } ContentDirectoryInfo.cs0000664000175000017500000001566211707010776046512 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.GtkClient/Mono.Upnp.Dcp.MediaServer1.GtkClient// // ContentDirectoryInfo.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using System.Threading; using Gtk; using Mono.Upnp.Dcp.MediaServer1.ContentDirectory1; using Object = Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.Object; using Container = Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.Container; using Item = Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.Item; namespace Mono.Upnp.Dcp.MediaServer1.GtkClient { public class ContentDirectoryInfo : HBox { ObjectRow loading = new ObjectRow (new Object ("0", "-1", new ObjectOptions { Title = "Loading..." })); RemoteContentDirectory content_directry; TreeStore store; ObjectInfo object_info; public ContentDirectoryInfo (RemoteContentDirectory contentDirectory) { if (contentDirectory == null) { throw new ArgumentNullException ("contentDirectory"); } this.content_directry = contentDirectory; this.store = new TreeStore (typeof (ObjectRow)); var objects = new TreeView (); var column = new TreeViewColumn (); var cell = new CellRendererText (); column.PackStart (cell, true); column.SetCellDataFunc (cell, RenderObject); column.Title = "Objects"; objects.AppendColumn (column); objects.Selection.Changed += HandleObjectsSelectionChanged; objects.RowExpanded += HandleObjectsRowExpanded; objects.Model = store; var root = contentDirectory.GetRootObject (); store.AppendValues (new ObjectRow (root)); TreeIter iter; store.GetIterFirst (out iter); store.AppendValues (iter, loading); Add (objects); } void HandleObjectsRowExpanded (object o, RowExpandedArgs args) { var container = GetContainer (args.Iter); if (container == null) { return; } var path = args.Path.Copy (); ThreadPool.QueueUserWorkItem (state => { try { var children = content_directry.GetChildren (container); Application.Invoke ((s, a) => { TreeIter iter, loading_iter; store.GetIter (out iter, path); store.IterNthChild (out loading_iter, iter, 0); List items = null; var position = -1; foreach (var child in children) { position++; var item = child as Item; if (item != null && item.IsReference) { if (items == null) { items = new List (); } items.Add (new ItemRow (item, store.GetPath (store.InsertWithValues (iter, position, loading)))); continue; } var child_iter = store.InsertWithValues (iter, position, new ObjectRow (child)); var c = child as Container; if (c != null && c.ChildCount > 0) { store.AppendValues (child_iter, loading); } } store.Remove (ref loading_iter); if (items != null) { Load (items); } }); } catch (Exception e) { Console.WriteLine (e); } }); } void Load (IEnumerable items) { ThreadPool.QueueUserWorkItem (state => { foreach (var item in items) { var @object = content_directry.GetObject (item.Item.RefId); Load (@object, item.Path); } }); } void Load (Item item, TreePath path) { Application.Invoke ((sender, args) => { TreeIter iter; if (store.GetIter (out iter, path)) { store.SetValue (iter, 0, new ObjectRow (item)); } }); } Container GetContainer (TreeIter iter) { var row = ((ObjectRow)store.GetValue (iter, 0)); if (row.Expanded) { return null; } row.Expanded = true; return (Container)row.Object; } void RenderObject (TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter) { var @object = ((ObjectRow)model.GetValue (iter, 0)).Object; ((CellRendererText)cell).Text = @object.Title; } void HandleObjectsSelectionChanged (object sender, EventArgs e) { if (object_info != null) { Remove (object_info); } var selection = (TreeSelection)sender; TreeIter iter; if (!selection.GetSelected (out iter)) { return; } object_info = new ObjectInfo (((ObjectRow)store.GetValue (iter, 0)).Object); Add (object_info); } } class ItemRow { public ItemRow (Item item, TreePath path) { Item = item; Path = path; } public Item Item { get; private set; } public TreePath Path { get; private set; } } class ObjectRow { public ObjectRow (Object @object) { Object = @object; } public Object Object { get; private set; } public bool Expanded { get; set; } } } ContentDirectoryServiceInfoProvider.cs0000664000175000017500000000402611707010776051536 0ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.GtkClient/Mono.Upnp.Dcp.MediaServer1.GtkClient// // ContentDirectoryServiceInfo.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using Mono.Addins; using Mono.Upnp.Dcp.MediaServer1.ContentDirectory1; using Mono.Upnp.GtkClient; namespace Mono.Upnp.Dcp.MediaServer1.GtkClient { [Extension] public class ContentDirectoryServiceInfoProvider : IServiceInfoProvider { public bool CanProvideInfo (ServiceType type) { return ContentDirectory.ServiceType.Equals (type); } public Gtk.Widget ProvideInfo (ServiceAnnouncement service) { var controller = service.GetService ().GetController (); var content_directory = new RemoteContentDirectory (new ContentDirectoryController (controller)); return new ContentDirectoryInfo (content_directory); } public string Name { get { return "Content Directory"; } } } } mono-upnp-0.1.2/README.md0000664000175000017500000000246411726647303016216 0ustar00lorentzlorentz00000000000000# Mono.Upnp Mono.Upnp is set of client/server libraries for the Universal Plug 'n Play specifications. See . To build with Visual Studio or MonoDevelop, open Mono.Upnp.sln and build the solution. To build with from the command line with Mono: xbuild Mono.Upnp.sln To build with from the command line with .NET: msbuild Mono.Upnp.sln Alternatively, on Unix, you can use the Autotools infrastructure: ./configure # or ./autogen.sh if working on a cloned repository make About the projects: * Mono.Ssdp: An implementation of the Simple Discovery Protocol (see UPnP Device Architecture 1.1, Section 1). * Mono.Upnp: An implementation of the UPnP Device Archetecture 1.1, Secions 2-5. * Mono.Upnp.GtkClient: An executable GTK+ user interface for inspecting UPnP devices and services on the network. * Mono.Upnp.Dcp.MediaServer1: An implementation of the UPnP Audio/Video MediaServer1 Device Control Protocol. * Mono.Upnp.Dcp.MediaServer1.FileSystem: A MediaServer1 implementation which serves media from the file system. * Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer: An executable console program which serves media from the file system. * Mono.Upnp.Dcp.MSMediaServerRegistrar1: An implementation of the Microsoft MSMediaServerRegistrar1 Device Control Protocol. mono-upnp-0.1.2/configure0000775000175000017500000042150311761735651016650 0ustar00lorentzlorentz00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.68 for Mono.Upnp 0.1.2. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software # Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV export CONFIG_SHELL case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='Mono.Upnp' PACKAGE_TARNAME='mono-upnp' PACKAGE_VERSION='0.1.2' PACKAGE_STRING='Mono.Upnp 0.1.2' PACKAGE_BUGREPORT='' PACKAGE_URL='' ac_subst_vars='LTLIBOBJS LIBOBJS NUNIT_CMD NUNIT_LIBS NUNIT_CFLAGS TAGLIB_SHARP_LIBS TAGLIB_SHARP_CFLAGS MONO_ADDINS_LIBS MONO_ADDINS_CFLAGS GLADE_SHARP_20_LIBS GLADE_SHARP_20_CFLAGS GLIB_SHARP_20_LIBS GLIB_SHARP_20_CFLAGS GTK_SHARP_20_LIBS GTK_SHARP_20_CFLAGS PKG_CONFIG_LIBDIR PKG_CONFIG_PATH ENABLE_RELEASE_FALSE ENABLE_RELEASE_TRUE ENABLE_DEBUG_FALSE ENABLE_DEBUG_TRUE GMCS expanded_datadir expanded_bindir expanded_libdir PKG_CONFIG MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_maintainer_mode enable_debug enable_release ' ac_precious_vars='build_alias host_alias target_alias PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR GTK_SHARP_20_CFLAGS GTK_SHARP_20_LIBS GLIB_SHARP_20_CFLAGS GLIB_SHARP_20_LIBS GLADE_SHARP_20_CFLAGS GLADE_SHARP_20_LIBS MONO_ADDINS_CFLAGS MONO_ADDINS_LIBS TAGLIB_SHARP_CFLAGS TAGLIB_SHARP_LIBS NUNIT_CFLAGS NUNIT_LIBS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used" >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures Mono.Upnp 0.1.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/mono-upnp] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of Mono.Upnp 0.1.2:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --enable-debug Use 'DEBUG' Configuration [default=YES] --enable-release Use 'RELEASE' Configuration [default=NO] Some influential environment variables: PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path GTK_SHARP_20_CFLAGS C compiler flags for GTK_SHARP_20, overriding pkg-config GTK_SHARP_20_LIBS linker flags for GTK_SHARP_20, overriding pkg-config GLIB_SHARP_20_CFLAGS C compiler flags for GLIB_SHARP_20, overriding pkg-config GLIB_SHARP_20_LIBS linker flags for GLIB_SHARP_20, overriding pkg-config GLADE_SHARP_20_CFLAGS C compiler flags for GLADE_SHARP_20, overriding pkg-config GLADE_SHARP_20_LIBS linker flags for GLADE_SHARP_20, overriding pkg-config MONO_ADDINS_CFLAGS C compiler flags for MONO_ADDINS, overriding pkg-config MONO_ADDINS_LIBS linker flags for MONO_ADDINS, overriding pkg-config TAGLIB_SHARP_CFLAGS C compiler flags for TAGLIB_SHARP, overriding pkg-config TAGLIB_SHARP_LIBS linker flags for TAGLIB_SHARP, overriding pkg-config NUNIT_CFLAGS C compiler flags for NUNIT, overriding pkg-config NUNIT_LIBS linker flags for NUNIT, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF Mono.Upnp configure 0.1.2 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by Mono.Upnp $as_me 0.1.2, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu am__api_version='1.11' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='mono-upnp' VERSION='0.1.2' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to create a ustar tar archive" >&5 $as_echo_n "checking how to create a ustar tar archive... " >&6; } # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar plaintar pax cpio none' _am_tools=${am_cv_prog_tar_ustar-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do { echo "$as_me:$LINENO: $_am_tar --version" >&5 ($_am_tar --version) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && break done am__tar="$_am_tar --format=ustar -chf - "'"$$tardir"' am__tar_="$_am_tar --format=ustar -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x ustar -w "$$tardir"' am__tar_='pax -L -x ustar -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H ustar -L' am__tar_='find "$tardir" -print | cpio -o -H ustar -L' am__untar='cpio -i -H ustar -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_ustar}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5 (tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } rm -rf conftest.dir if test -s conftest.tar; then { echo "$as_me:$LINENO: $am__untar &5 ($am__untar &5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } grep GrepMe conftest.dir/file >/dev/null 2>&1 && break fi done rm -rf conftest.dir if ${am_cv_prog_tar_ustar+:} false; then : $as_echo_n "(cached) " >&6 else am_cv_prog_tar_ustar=$_am_tool fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5 $as_echo "$am_cv_prog_tar_ustar" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then : enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 $as_echo "$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$PKG_CONFIG" = "xno"; then as_fn_error $? "You need to install pkg-config" "$LINENO" 5 fi expanded_libdir=`( case $prefix in NONE) prefix=$ac_default_prefix ;; *) ;; esac case $exec_prefix in NONE) exec_prefix=$prefix ;; *) ;; esac eval echo $libdir )` expanded_bindir=`( case $prefix in NONE) prefix=$ac_default_prefix ;; *) ;; esac case $exec_prefix in NONE) exec_prefix=$prefix ;; *) ;; esac eval echo $bindir )` case $prefix in NONE) prefix=$ac_default_prefix ;; *) ;; esac case $exec_prefix in NONE) exec_prefix=$prefix ;; *) ;; esac expanded_datadir=`(eval echo $datadir)` expanded_datadir=`(eval echo $expanded_datadir)` # Extract the first word of "gmcs", so it can be a program name with args. set dummy gmcs; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GMCS+:} false; then : $as_echo_n "(cached) " >&6 else case $GMCS in [\\/]* | ?:[\\/]*) ac_cv_path_GMCS="$GMCS" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_GMCS="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GMCS" && ac_cv_path_GMCS="no" ;; esac fi GMCS=$ac_cv_path_GMCS if test -n "$GMCS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMCS" >&5 $as_echo "$GMCS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$GMCS" = "xno"; then as_fn_error $? "gmcs Not found" "$LINENO" 5 fi # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then : enableval=$enable_debug; enable_debug=yes else enable_debug=no fi if test x$enable_debug = xyes; then ENABLE_DEBUG_TRUE= ENABLE_DEBUG_FALSE='#' else ENABLE_DEBUG_TRUE='#' ENABLE_DEBUG_FALSE= fi if test "x$enable_debug" = "xyes" ; then CONFIG_REQUESTED="yes" fi # Check whether --enable-release was given. if test "${enable_release+set}" = set; then : enableval=$enable_release; enable_release=yes else enable_release=no fi if test x$enable_release = xyes; then ENABLE_RELEASE_TRUE= ENABLE_RELEASE_FALSE='#' else ENABLE_RELEASE_TRUE='#' ENABLE_RELEASE_FALSE= fi if test "x$enable_release" = "xyes" ; then CONFIG_REQUESTED="yes" fi if test -z "$CONFIG_REQUESTED" ; then if true; then ENABLE_DEBUG_TRUE= ENABLE_DEBUG_FALSE='#' else ENABLE_DEBUG_TRUE='#' ENABLE_DEBUG_FALSE= fi enable_debug=yes fi if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTK_SHARP_20" >&5 $as_echo_n "checking for GTK_SHARP_20... " >&6; } if test -n "$GTK_SHARP_20_CFLAGS"; then pkg_cv_GTK_SHARP_20_CFLAGS="$GTK_SHARP_20_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk-sharp-2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "gtk-sharp-2.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GTK_SHARP_20_CFLAGS=`$PKG_CONFIG --cflags "gtk-sharp-2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GTK_SHARP_20_LIBS"; then pkg_cv_GTK_SHARP_20_LIBS="$GTK_SHARP_20_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk-sharp-2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "gtk-sharp-2.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GTK_SHARP_20_LIBS=`$PKG_CONFIG --libs "gtk-sharp-2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GTK_SHARP_20_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gtk-sharp-2.0" 2>&1` else GTK_SHARP_20_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gtk-sharp-2.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GTK_SHARP_20_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (gtk-sharp-2.0) were not met: $GTK_SHARP_20_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables GTK_SHARP_20_CFLAGS and GTK_SHARP_20_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables GTK_SHARP_20_CFLAGS and GTK_SHARP_20_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else GTK_SHARP_20_CFLAGS=$pkg_cv_GTK_SHARP_20_CFLAGS GTK_SHARP_20_LIBS=$pkg_cv_GTK_SHARP_20_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLIB_SHARP_20" >&5 $as_echo_n "checking for GLIB_SHARP_20... " >&6; } if test -n "$GLIB_SHARP_20_CFLAGS"; then pkg_cv_GLIB_SHARP_20_CFLAGS="$GLIB_SHARP_20_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-sharp-2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-sharp-2.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GLIB_SHARP_20_CFLAGS=`$PKG_CONFIG --cflags "glib-sharp-2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GLIB_SHARP_20_LIBS"; then pkg_cv_GLIB_SHARP_20_LIBS="$GLIB_SHARP_20_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-sharp-2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-sharp-2.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GLIB_SHARP_20_LIBS=`$PKG_CONFIG --libs "glib-sharp-2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GLIB_SHARP_20_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glib-sharp-2.0" 2>&1` else GLIB_SHARP_20_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glib-sharp-2.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GLIB_SHARP_20_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (glib-sharp-2.0) were not met: $GLIB_SHARP_20_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables GLIB_SHARP_20_CFLAGS and GLIB_SHARP_20_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables GLIB_SHARP_20_CFLAGS and GLIB_SHARP_20_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else GLIB_SHARP_20_CFLAGS=$pkg_cv_GLIB_SHARP_20_CFLAGS GLIB_SHARP_20_LIBS=$pkg_cv_GLIB_SHARP_20_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLADE_SHARP_20" >&5 $as_echo_n "checking for GLADE_SHARP_20... " >&6; } if test -n "$GLADE_SHARP_20_CFLAGS"; then pkg_cv_GLADE_SHARP_20_CFLAGS="$GLADE_SHARP_20_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glade-sharp-2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "glade-sharp-2.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GLADE_SHARP_20_CFLAGS=`$PKG_CONFIG --cflags "glade-sharp-2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GLADE_SHARP_20_LIBS"; then pkg_cv_GLADE_SHARP_20_LIBS="$GLADE_SHARP_20_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glade-sharp-2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "glade-sharp-2.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GLADE_SHARP_20_LIBS=`$PKG_CONFIG --libs "glade-sharp-2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GLADE_SHARP_20_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glade-sharp-2.0" 2>&1` else GLADE_SHARP_20_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glade-sharp-2.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GLADE_SHARP_20_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (glade-sharp-2.0) were not met: $GLADE_SHARP_20_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables GLADE_SHARP_20_CFLAGS and GLADE_SHARP_20_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables GLADE_SHARP_20_CFLAGS and GLADE_SHARP_20_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else GLADE_SHARP_20_CFLAGS=$pkg_cv_GLADE_SHARP_20_CFLAGS GLADE_SHARP_20_LIBS=$pkg_cv_GLADE_SHARP_20_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MONO_ADDINS" >&5 $as_echo_n "checking for MONO_ADDINS... " >&6; } if test -n "$MONO_ADDINS_CFLAGS"; then pkg_cv_MONO_ADDINS_CFLAGS="$MONO_ADDINS_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mono-addins\""; } >&5 ($PKG_CONFIG --exists --print-errors "mono-addins") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_MONO_ADDINS_CFLAGS=`$PKG_CONFIG --cflags "mono-addins" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$MONO_ADDINS_LIBS"; then pkg_cv_MONO_ADDINS_LIBS="$MONO_ADDINS_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mono-addins\""; } >&5 ($PKG_CONFIG --exists --print-errors "mono-addins") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_MONO_ADDINS_LIBS=`$PKG_CONFIG --libs "mono-addins" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then MONO_ADDINS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "mono-addins" 2>&1` else MONO_ADDINS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "mono-addins" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$MONO_ADDINS_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (mono-addins) were not met: $MONO_ADDINS_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables MONO_ADDINS_CFLAGS and MONO_ADDINS_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables MONO_ADDINS_CFLAGS and MONO_ADDINS_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else MONO_ADDINS_CFLAGS=$pkg_cv_MONO_ADDINS_CFLAGS MONO_ADDINS_LIBS=$pkg_cv_MONO_ADDINS_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TAGLIB_SHARP" >&5 $as_echo_n "checking for TAGLIB_SHARP... " >&6; } if test -n "$TAGLIB_SHARP_CFLAGS"; then pkg_cv_TAGLIB_SHARP_CFLAGS="$TAGLIB_SHARP_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"taglib-sharp\""; } >&5 ($PKG_CONFIG --exists --print-errors "taglib-sharp") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_TAGLIB_SHARP_CFLAGS=`$PKG_CONFIG --cflags "taglib-sharp" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$TAGLIB_SHARP_LIBS"; then pkg_cv_TAGLIB_SHARP_LIBS="$TAGLIB_SHARP_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"taglib-sharp\""; } >&5 ($PKG_CONFIG --exists --print-errors "taglib-sharp") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_TAGLIB_SHARP_LIBS=`$PKG_CONFIG --libs "taglib-sharp" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then TAGLIB_SHARP_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "taglib-sharp" 2>&1` else TAGLIB_SHARP_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "taglib-sharp" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$TAGLIB_SHARP_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (taglib-sharp) were not met: $TAGLIB_SHARP_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables TAGLIB_SHARP_CFLAGS and TAGLIB_SHARP_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables TAGLIB_SHARP_CFLAGS and TAGLIB_SHARP_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else TAGLIB_SHARP_CFLAGS=$pkg_cv_TAGLIB_SHARP_CFLAGS TAGLIB_SHARP_LIBS=$pkg_cv_TAGLIB_SHARP_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NUNIT" >&5 $as_echo_n "checking for NUNIT... " >&6; } if test -n "$NUNIT_CFLAGS"; then pkg_cv_NUNIT_CFLAGS="$NUNIT_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"nunit\""; } >&5 ($PKG_CONFIG --exists --print-errors "nunit") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_NUNIT_CFLAGS=`$PKG_CONFIG --cflags "nunit" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$NUNIT_LIBS"; then pkg_cv_NUNIT_LIBS="$NUNIT_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"nunit\""; } >&5 ($PKG_CONFIG --exists --print-errors "nunit") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_NUNIT_LIBS=`$PKG_CONFIG --libs "nunit" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then NUNIT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "nunit" 2>&1` else NUNIT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "nunit" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$NUNIT_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (nunit) were not met: $NUNIT_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables NUNIT_CFLAGS and NUNIT_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables NUNIT_CFLAGS and NUNIT_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else NUNIT_CFLAGS=$pkg_cv_NUNIT_CFLAGS NUNIT_LIBS=$pkg_cv_NUNIT_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi # Extract the first word of "nunit-console2", so it can be a program name with args. set dummy nunit-console2; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_NUNIT_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $NUNIT_CMD in [\\/]* | ?:[\\/]*) ac_cv_path_NUNIT_CMD="$NUNIT_CMD" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_NUNIT_CMD="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_NUNIT_CMD" && ac_cv_path_NUNIT_CMD="nunit-console" ;; esac fi NUNIT_CMD=$ac_cv_path_NUNIT_CMD if test -n "$NUNIT_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NUNIT_CMD" >&5 $as_echo "$NUNIT_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ac_config_files="$ac_config_files src/Mono.Ssdp/Mono.Ssdp/mono.ssdp.pc src/Mono.Ssdp/Mono.Ssdp/Makefile src/Mono.Upnp/Mono.Upnp/mono.upnp.pc src/Mono.Upnp/Mono.Upnp/Makefile src/Mono.Upnp/Mono.Upnp.GtkClient/mono-upnp-gtk src/Mono.Upnp/Mono.Upnp.GtkClient/Makefile src/Mono.Upnp/Makefile src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/mono.upnp.dcp.mediaserver1.pc src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Makefile src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MSMediaReceiverRegistrar1/mono.upnp.dcp.msmediareceiverregistrar1.pc src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MSMediaReceiverRegistrar1/Makefile src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem/mono.upnp.dcp.mediaserver1.filesystem.pc src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem/Makefile src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer/mono-upnp-simple-media-server src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer/Makefile src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.GtkClient/mono.upnp.dcp.mediaserver1.gtkclient.pc src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.GtkClient/Makefile src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Makefile tests/Mono.Ssdp.Tests/Makefile tests/Mono.Upnp.Tests/Makefile tests/Mono.Upnp.Dcp.MediaServer1.Tests/Makefile tests/Mono.Upnp.Dcp.MediaServer1.FileSystem.Tests/Makefile tests/Makefile Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' :mline /\\$/{ N s,\\\n,, b mline } t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_DEBUG_TRUE}" && test -z "${ENABLE_DEBUG_FALSE}"; then as_fn_error $? "conditional \"ENABLE_DEBUG\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_RELEASE_TRUE}" && test -z "${ENABLE_RELEASE_FALSE}"; then as_fn_error $? "conditional \"ENABLE_RELEASE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_DEBUG_TRUE}" && test -z "${ENABLE_DEBUG_FALSE}"; then as_fn_error $? "conditional \"ENABLE_DEBUG\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by Mono.Upnp $as_me 0.1.2, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ Mono.Upnp config.status 0.1.2 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" Copyright (C) 2010 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "src/Mono.Ssdp/Mono.Ssdp/mono.ssdp.pc") CONFIG_FILES="$CONFIG_FILES src/Mono.Ssdp/Mono.Ssdp/mono.ssdp.pc" ;; "src/Mono.Ssdp/Mono.Ssdp/Makefile") CONFIG_FILES="$CONFIG_FILES src/Mono.Ssdp/Mono.Ssdp/Makefile" ;; "src/Mono.Upnp/Mono.Upnp/mono.upnp.pc") CONFIG_FILES="$CONFIG_FILES src/Mono.Upnp/Mono.Upnp/mono.upnp.pc" ;; "src/Mono.Upnp/Mono.Upnp/Makefile") CONFIG_FILES="$CONFIG_FILES src/Mono.Upnp/Mono.Upnp/Makefile" ;; "src/Mono.Upnp/Mono.Upnp.GtkClient/mono-upnp-gtk") CONFIG_FILES="$CONFIG_FILES src/Mono.Upnp/Mono.Upnp.GtkClient/mono-upnp-gtk" ;; "src/Mono.Upnp/Mono.Upnp.GtkClient/Makefile") CONFIG_FILES="$CONFIG_FILES src/Mono.Upnp/Mono.Upnp.GtkClient/Makefile" ;; "src/Mono.Upnp/Makefile") CONFIG_FILES="$CONFIG_FILES src/Mono.Upnp/Makefile" ;; "src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/mono.upnp.dcp.mediaserver1.pc") CONFIG_FILES="$CONFIG_FILES src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/mono.upnp.dcp.mediaserver1.pc" ;; "src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Makefile") CONFIG_FILES="$CONFIG_FILES src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Makefile" ;; "src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MSMediaReceiverRegistrar1/mono.upnp.dcp.msmediareceiverregistrar1.pc") CONFIG_FILES="$CONFIG_FILES src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MSMediaReceiverRegistrar1/mono.upnp.dcp.msmediareceiverregistrar1.pc" ;; "src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MSMediaReceiverRegistrar1/Makefile") CONFIG_FILES="$CONFIG_FILES src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MSMediaReceiverRegistrar1/Makefile" ;; "src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem/mono.upnp.dcp.mediaserver1.filesystem.pc") CONFIG_FILES="$CONFIG_FILES src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem/mono.upnp.dcp.mediaserver1.filesystem.pc" ;; "src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem/Makefile") CONFIG_FILES="$CONFIG_FILES src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem/Makefile" ;; "src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer/mono-upnp-simple-media-server") CONFIG_FILES="$CONFIG_FILES src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer/mono-upnp-simple-media-server" ;; "src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer/Makefile") CONFIG_FILES="$CONFIG_FILES src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer/Makefile" ;; "src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.GtkClient/mono.upnp.dcp.mediaserver1.gtkclient.pc") CONFIG_FILES="$CONFIG_FILES src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.GtkClient/mono.upnp.dcp.mediaserver1.gtkclient.pc" ;; "src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.GtkClient/Makefile") CONFIG_FILES="$CONFIG_FILES src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.GtkClient/Makefile" ;; "src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Makefile") CONFIG_FILES="$CONFIG_FILES src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Makefile" ;; "tests/Mono.Ssdp.Tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Mono.Ssdp.Tests/Makefile" ;; "tests/Mono.Upnp.Tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Mono.Upnp.Tests/Makefile" ;; "tests/Mono.Upnp.Dcp.MediaServer1.Tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Mono.Upnp.Dcp.MediaServer1.Tests/Makefile" ;; "tests/Mono.Upnp.Dcp.MediaServer1.FileSystem.Tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Mono.Upnp.Dcp.MediaServer1.FileSystem.Tests/Makefile" ;; "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" eval set X " :F $CONFIG_FILES " shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi mono-upnp-0.1.2/aclocal.m40000664000175000017500000007522011761735647016607 0ustar00lorentzlorentz00000000000000# generated automatically by aclocal 1.11.3 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, # Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, [m4_warning([this file was generated for autoconf 2.68. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # serial 1 (pkg-config-0.24) # # Copyright © 2004 Scott James Remnant . # # 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. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # PKG_PROG_PKG_CONFIG([MIN-VERSION]) # ---------------------------------- AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])# PKG_PROG_PKG_CONFIG # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # # Check to see whether a particular set of modules exists. Similar # to PKG_CHECK_MODULES(), but does not set variables or print errors. # # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) # only at the first occurence in configure.ac, so if the first place # it's called might be skipped (such as if it is within an "if", you # have to call PKG_CHECK_EXISTS manually # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes ], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])# _PKG_CONFIG # _PKG_SHORT_ERRORS_SUPPORTED # ----------------------------- AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])# _PKG_SHORT_ERRORS_SUPPORTED # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], # [ACTION-IF-NOT-FOUND]) # # # Note that if there is a possibility the first call to # PKG_CHECK_MODULES might not happen, you should be sure to include an # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac # # # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])[]dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])# PKG_CHECK_MODULES # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software # Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.11.3], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.11.3])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 9 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 16 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.62])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl dnl The `parallel-tests' driver may need to know about EXEEXT, so add the dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation, # Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008, # 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_MAINTAINER_MODE([DEFAULT-MODE]) # ---------------------------------- # Control maintainer-specific portions of Makefiles. # Default is to disable them, unless `enable' is passed literally. # For symmetry, `disable' may be passed as well. Anyway, the user # can override the default with the --enable/--disable switch. AC_DEFUN([AM_MAINTAINER_MODE], [m4_case(m4_default([$1], [disable]), [enable], [m4_define([am_maintainer_other], [disable])], [disable], [m4_define([am_maintainer_other], [enable])], [m4_define([am_maintainer_other], [enable]) m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE([maintainer-mode], [ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful (and sometimes confusing) to the casual installer], [USE_MAINTAINER_MODE=$enableval], [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST([MAINT])dnl ] ) AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 6 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, # Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software # Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([expansions.m4]) mono-upnp-0.1.2/tests/0000775000175000017500000000000011761740037016070 5ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/tests/Makefile.am0000664000175000017500000000056111715002253020114 0ustar00lorentzlorentz00000000000000 EXTRA_DIST = #Warning: This is an automatically generated file, do not edit! if ENABLE_DEBUG SUBDIRS = Mono.Ssdp.Tests Mono.Upnp.Tests Mono.Upnp.Dcp.MediaServer1.Tests Mono.Upnp.Dcp.MediaServer1.FileSystem.Tests endif if ENABLE_RELEASE SUBDIRS = Mono.Ssdp.Tests Mono.Upnp.Tests Mono.Upnp.Dcp.MediaServer1.Tests Mono.Upnp.Dcp.MediaServer1.FileSystem.Tests endif mono-upnp-0.1.2/tests/Mono.Ssdp.Tests/0000775000175000017500000000000011761740037021011 5ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/tests/Mono.Ssdp.Tests/Makefile.am0000664000175000017500000000375611715013277023056 0ustar00lorentzlorentz00000000000000 EXTRA_DIST = # Warning: This is an automatically generated file, do not edit! if ENABLE_DEBUG ASSEMBLY_COMPILER_COMMAND = gmcs ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug "-define:DEBUG" ASSEMBLY = ../../bin/Mono.Ssdp.Tests.dll ASSEMBLY_MDB = $(ASSEMBLY).mdb COMPILE_TARGET = library PROJECT_REFERENCES = \ ../../bin/Mono.Ssdp.dll BUILD_DIR = ../../bin MONO_SSDP_TESTS_DLL_MDB_SOURCE=../../bin/Mono.Ssdp.Tests.dll.mdb MONO_SSDP_TESTS_DLL_MDB=$(BUILD_DIR)/Mono.Ssdp.Tests.dll.mdb MONO_SSDP_DLL_SOURCE=../../bin/Mono.Ssdp.dll MONO_SSDP_DLL_MDB_SOURCE=../../bin/Mono.Ssdp.dll.mdb MONO_SSDP_DLL_MDB=$(BUILD_DIR)/Mono.Ssdp.dll.mdb endif if ENABLE_RELEASE ASSEMBLY_COMPILER_COMMAND = gmcs ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ ASSEMBLY = ../../bin/Mono.Ssdp.Tests.dll ASSEMBLY_MDB = COMPILE_TARGET = library PROJECT_REFERENCES = \ ../../bin/Mono.Ssdp.dll BUILD_DIR = ../../bin MONO_SSDP_TESTS_DLL_MDB= MONO_SSDP_DLL_SOURCE=../../bin/Mono.Ssdp.dll MONO_SSDP_DLL_MDB= endif AL=al2 SATELLITE_ASSEMBLY_NAME=$(notdir $(basename $(ASSEMBLY))).resources.dll PROGRAMFILES = \ $(MONO_SSDP_TESTS_DLL_MDB) \ $(MONO_SSDP_DLL) \ $(MONO_SSDP_DLL_MDB) RESGEN=resgen2 all: $(ASSEMBLY) $(PROGRAMFILES) FILES = \ ClientTests.cs \ ServerTests.cs DATA_FILES = RESOURCES = EXTRAS = REFERENCES = \ System \ $(NUNIT_LIBS) DLL_REFERENCES = CLEANFILES = $(PROGRAMFILES) include $(top_srcdir)/Makefile.include MONO_SSDP_DLL = $(BUILD_DIR)/Mono.Ssdp.dll $(eval $(call emit_resgen_targets)) $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(ASSEMBLY_MDB): $(ASSEMBLY) $(ASSEMBLY): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(shell dirname $(ASSEMBLY)) $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) mono-upnp-0.1.2/tests/Mono.Ssdp.Tests/Makefile.in0000664000175000017500000005773711761736756023116 0ustar00lorentzlorentz00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/Makefile.include subdir = tests/Mono.Ssdp.Tests ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/expansions.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(bindir)" \ "$(DESTDIR)$(assemblyfilesdir)" \ "$(DESTDIR)$(linuxpkgconfigdir)" \ "$(DESTDIR)$(programfilesdir)" SCRIPTS = $(bin_SCRIPTS) SOURCES = DIST_SOURCES = DATA = $(assemblyfiles_DATA) $(linuxpkgconfig_DATA) \ $(programfiles_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ GLADE_SHARP_20_CFLAGS = @GLADE_SHARP_20_CFLAGS@ GLADE_SHARP_20_LIBS = @GLADE_SHARP_20_LIBS@ GLIB_SHARP_20_CFLAGS = @GLIB_SHARP_20_CFLAGS@ GLIB_SHARP_20_LIBS = @GLIB_SHARP_20_LIBS@ GMCS = @GMCS@ GTK_SHARP_20_CFLAGS = @GTK_SHARP_20_CFLAGS@ GTK_SHARP_20_LIBS = @GTK_SHARP_20_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MONO_ADDINS_CFLAGS = @MONO_ADDINS_CFLAGS@ MONO_ADDINS_LIBS = @MONO_ADDINS_LIBS@ NUNIT_CFLAGS = @NUNIT_CFLAGS@ NUNIT_CMD = @NUNIT_CMD@ NUNIT_LIBS = @NUNIT_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TAGLIB_SHARP_CFLAGS = @TAGLIB_SHARP_CFLAGS@ TAGLIB_SHARP_LIBS = @TAGLIB_SHARP_LIBS@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_bindir = @expanded_bindir@ expanded_datadir = @expanded_datadir@ expanded_libdir = @expanded_libdir@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = $(build_sources) $(build_resx_files) \ $(build_others_files) $(ASSEMBLY_WRAPPER_IN) $(EXTRAS) \ $(DATA_FILES) $(build_culture_res_files) # Warning: This is an automatically generated file, do not edit! @ENABLE_DEBUG_TRUE@ASSEMBLY_COMPILER_COMMAND = gmcs @ENABLE_RELEASE_TRUE@ASSEMBLY_COMPILER_COMMAND = gmcs @ENABLE_DEBUG_TRUE@ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug "-define:DEBUG" @ENABLE_RELEASE_TRUE@ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ @ENABLE_DEBUG_TRUE@ASSEMBLY = ../../bin/Mono.Ssdp.Tests.dll @ENABLE_RELEASE_TRUE@ASSEMBLY = ../../bin/Mono.Ssdp.Tests.dll @ENABLE_DEBUG_TRUE@ASSEMBLY_MDB = $(ASSEMBLY).mdb @ENABLE_RELEASE_TRUE@ASSEMBLY_MDB = @ENABLE_DEBUG_TRUE@COMPILE_TARGET = library @ENABLE_RELEASE_TRUE@COMPILE_TARGET = library @ENABLE_DEBUG_TRUE@PROJECT_REFERENCES = \ @ENABLE_DEBUG_TRUE@ ../../bin/Mono.Ssdp.dll @ENABLE_RELEASE_TRUE@PROJECT_REFERENCES = \ @ENABLE_RELEASE_TRUE@ ../../bin/Mono.Ssdp.dll @ENABLE_DEBUG_TRUE@BUILD_DIR = ../../bin @ENABLE_RELEASE_TRUE@BUILD_DIR = ../../bin @ENABLE_DEBUG_TRUE@MONO_SSDP_TESTS_DLL_MDB_SOURCE = ../../bin/Mono.Ssdp.Tests.dll.mdb @ENABLE_DEBUG_TRUE@MONO_SSDP_TESTS_DLL_MDB = $(BUILD_DIR)/Mono.Ssdp.Tests.dll.mdb @ENABLE_RELEASE_TRUE@MONO_SSDP_TESTS_DLL_MDB = @ENABLE_DEBUG_TRUE@MONO_SSDP_DLL_SOURCE = ../../bin/Mono.Ssdp.dll @ENABLE_RELEASE_TRUE@MONO_SSDP_DLL_SOURCE = ../../bin/Mono.Ssdp.dll @ENABLE_DEBUG_TRUE@MONO_SSDP_DLL_MDB_SOURCE = ../../bin/Mono.Ssdp.dll.mdb @ENABLE_DEBUG_TRUE@MONO_SSDP_DLL_MDB = $(BUILD_DIR)/Mono.Ssdp.dll.mdb @ENABLE_RELEASE_TRUE@MONO_SSDP_DLL_MDB = AL = al2 SATELLITE_ASSEMBLY_NAME = $(notdir $(basename $(ASSEMBLY))).resources.dll PROGRAMFILES = \ $(MONO_SSDP_TESTS_DLL_MDB) \ $(MONO_SSDP_DLL) \ $(MONO_SSDP_DLL_MDB) RESGEN = resgen2 FILES = \ ClientTests.cs \ ServerTests.cs DATA_FILES = RESOURCES = EXTRAS = REFERENCES = \ System \ $(NUNIT_LIBS) DLL_REFERENCES = CLEANFILES = $(PROGRAMFILES) $(ASSEMBLY) $(ASSEMBLY).mdb $(BINARIES) \ $(build_resx_resources) $(build_satellite_assembly_list) VALID_CULTURES = ar bg ca zh-CHS cs da de el en es fi fr he hu is it ja ko nl no pl pt ro ru hr sk sq sv th tr id uk be sl et lv lt fa vi hy eu mk af ka fo hi sw gu ta te kn mr gl kok ar-SA bg-BG ca-ES zh-TW cs-CZ da-DK de-DE el-GR en-US fi-FI fr-FR he-IL hu-HU is-IS it-IT ja-JP ko-KR nl-NL nb-NO pl-PL pt-BR ro-RO ru-RU hr-HR sk-SK sq-AL sv-SE th-TH tr-TR id-ID uk-UA be-BY sl-SI et-EE lv-LV lt-LT fa-IR vi-VN hy-AM eu-ES mk-MK af-ZA ka-GE fo-FO hi-IN sw-KE gu-IN ta-IN te-IN kn-IN mr-IN gl-ES kok-IN ar-IQ zh-CN de-CH en-GB es-MX fr-BE it-CH nl-BE nn-NO pt-PT sv-FI ar-EG zh-HK de-AT en-AU es-ES fr-CA ar-LY zh-SG de-LU en-CA es-GT fr-CH ar-DZ zh-MO en-NZ es-CR fr-LU ar-MA en-IE es-PA ar-TN en-ZA es-DO ar-OM es-VE ar-YE es-CO ar-SY es-PE ar-JO en-TT es-AR ar-LB en-ZW es-EC ar-KW en-PH es-CL ar-AE es-UY ar-BH es-PY ar-QA es-BO es-SV es-HN es-NI es-PR zh-CHT s2q = $(subst \ ,?,$1) q2s = $(subst ?,\ ,$1) # use this when result will be quoted unesc2 = $(subst ?, ,$1) build_sources = $(FILES) $(GENERATED_FILES) build_sources_esc = $(call s2q,$(build_sources)) # use unesc2, as build_sources_embed is quoted build_sources_embed = $(call unesc2,$(build_sources_esc:%='$(srcdir)/%')) comma__ = , get_resource_name = $(firstword $(subst $(comma__), ,$1)) get_culture = $(lastword $(subst ., ,$(basename $1))) is_cultured_resource = $(and $(word 3,$(subst ., ,$1)), $(filter $(VALID_CULTURES),$(lastword $(subst ., ,$(basename $1))))) RESOURCES_ESC = $(call s2q,$(RESOURCES)) build_resx_list = $(foreach res, $(RESOURCES_ESC), $(if $(filter %.resx, $(call get_resource_name,$(res))),$(res),)) build_non_culture_resx_list = $(foreach res, $(build_resx_list),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_non_culture_others_list = $(foreach res, $(filter-out $(build_resx_list),$(RESOURCES_ESC)),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_others_list = $(build_non_culture_others_list) build_xamlg_list = $(filter %.xaml.g.cs, $(FILES)) # resgen all .resx resources build_resx_files = $(foreach res, $(build_resx_list), $(call get_resource_name,$(res))) build_resx_resources_esc = $(build_resx_files:.resx=.resources) build_resx_resources = $(call q2s,$(build_resx_resources_esc)) # embed resources for the main assembly build_resx_resources_hack = $(subst .resx,.resources, $(build_non_culture_resx_list)) # use unesc2, as build_resx_resources_embed is quoted build_resx_resources_embed = $(call unesc2,$(build_resx_resources_hack:%='-resource:%')) build_others_files = $(call q2s,$(foreach res, $(build_others_list),$(call get_resource_name,$(res)))) build_others_resources = $(build_others_files) # use unesc2, as build_others_resources_embed is quoted build_others_resources_embed = $(call unesc2,$(build_others_list:%='-resource:$(srcdir)/%')) build_resources = $(build_resx_resources) $(build_others_resources) build_resources_embed = $(build_resx_resources_embed) $(build_others_resources_embed) # -usesourcepath is available only for resgen2 emit_resgen_target_1 = $(call q2s,$1) : $(call q2s,$(subst .resources,.resx,$1)); cd '$$(shell dirname '$$<')' && MONO_IOMAP=drive $$(RESGEN) '$$(shell basename '$$<')' '$$(shell basename '$$@')' emit_resgen_target_2 = $(call q2s,$1) : $(call q2s,$(subst .resources,.resx,$1)); MONO_IOMAP=drive $$(RESGEN) -usesourcepath '$$<' '$$@' emit_resgen_target = $(if $(filter resgen2,$(RESGEN)),$(emit_resgen_target_2),$(emit_resgen_target_1)) emit_resgen_targets = $(foreach res,$(build_resx_resources_esc),$(eval $(call emit_resgen_target,$(res)))) build_references_ref = $(call q2s,$(foreach ref, $(call \ s2q,$(REFERENCES)), $(if $(filter -pkg:%, $(ref)), $(ref), \ $(if $(filter -r:%, $(ref)), $(ref), -r:$(ref))))) $(call \ q2s,$(foreach ref, $(call s2q,$(DLL_REFERENCES)), -r:$(ref))) \ $(call q2s,$(foreach ref, $(call s2q,$(PROJECT_REFERENCES)), \ -r:$(ref))) s2q2s = $(call unesc2,$(call s2q,$1)) cp_actual = test -z $1 || cp $1 $2 cp = $(call cp_actual,'$(call s2q2s,$1)','$(call s2q2s,$2)') rm_actual = test -z '$1' || rm -f '$2' rm = $(call rm_actual,$(call s2q2s,$1),$(call s2q2s,$2)/$(shell basename '$(call s2q2s,$1)')) DISTCLEANFILES = $(GENERATED_FILES) $(pc_files) $(BUILD_DIR)/* assemblyfilesdir = $(pkglibdir) assemblyfiles_DATA = $(ASSEMBLY) bin_SCRIPTS = $(BINARIES) programfilesdir = @libdir@/@PACKAGE@ programfiles_DATA = $(PROGRAMFILES) linuxpkgconfigdir = @libdir@/pkgconfig linuxpkgconfig_DATA = $(LINUX_PKGCONFIG) # generating satellite assemblies culture_resources = $(foreach res, $(RESOURCES_ESC), $(if $(call is_cultured_resource,$(call get_resource_name, $(res))),$(res))) cultures = $(sort $(foreach res, $(culture_resources), $(call get_culture,$(call get_resource_name,$(res))))) culture_resource_dependencies = $(call q2s,$(BUILD_DIR)/$1/$(SATELLITE_ASSEMBLY_NAME): $(subst .resx,.resources,$2)) culture_resource_commandlines = $(call unesc2,cmd_line_satellite_$1 += '/embed:$(subst .resx,.resources,$2)') build_satellite_assembly_list = $(call q2s,$(cultures:%=$(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME))) build_culture_res_files = $(call q2s,$(foreach res, $(culture_resources),$(call get_resource_name,$(res)))) install_satellite_assembly_list = $(subst $(BUILD_DIR),$(DESTDIR)$(libdir)/$(PACKAGE),$(build_satellite_assembly_list)) MONO_SSDP_DLL = $(BUILD_DIR)/Mono.Ssdp.dll all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.include $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/Mono.Ssdp.Tests/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign tests/Mono.Ssdp.Tests/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/Makefile.include: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) install-assemblyfilesDATA: $(assemblyfiles_DATA) @$(NORMAL_INSTALL) test -z "$(assemblyfilesdir)" || $(MKDIR_P) "$(DESTDIR)$(assemblyfilesdir)" @list='$(assemblyfiles_DATA)'; test -n "$(assemblyfilesdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(assemblyfilesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(assemblyfilesdir)" || exit $$?; \ done uninstall-assemblyfilesDATA: @$(NORMAL_UNINSTALL) @list='$(assemblyfiles_DATA)'; test -n "$(assemblyfilesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(assemblyfilesdir)'; $(am__uninstall_files_from_dir) install-linuxpkgconfigDATA: $(linuxpkgconfig_DATA) @$(NORMAL_INSTALL) test -z "$(linuxpkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(linuxpkgconfigdir)" @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(linuxpkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(linuxpkgconfigdir)" || exit $$?; \ done uninstall-linuxpkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(linuxpkgconfigdir)'; $(am__uninstall_files_from_dir) install-programfilesDATA: $(programfiles_DATA) @$(NORMAL_INSTALL) test -z "$(programfilesdir)" || $(MKDIR_P) "$(DESTDIR)$(programfilesdir)" @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(programfilesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(programfilesdir)" || exit $$?; \ done uninstall-programfilesDATA: @$(NORMAL_UNINSTALL) @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(programfilesdir)'; $(am__uninstall_files_from_dir) tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(assemblyfilesdir)" "$(DESTDIR)$(linuxpkgconfigdir)" "$(DESTDIR)$(programfilesdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-assemblyfilesDATA install-linuxpkgconfigDATA \ install-programfilesDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binSCRIPTS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-assemblyfilesDATA uninstall-binSCRIPTS \ uninstall-linuxpkgconfigDATA uninstall-programfilesDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-assemblyfilesDATA \ install-binSCRIPTS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-linuxpkgconfigDATA install-man install-pdf \ install-pdf-am install-programfilesDATA install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \ uninstall-am uninstall-assemblyfilesDATA uninstall-binSCRIPTS \ uninstall-linuxpkgconfigDATA uninstall-programfilesDATA all: $(ASSEMBLY) $(PROGRAMFILES) # macros # $(call emit-deploy-target,deploy-variable-name) define emit-deploy-target $($1): $($1_SOURCE) mkdir -p '$$(shell dirname '$$@')' cp '$$<' '$$@' endef # $(call emit-deploy-wrapper,wrapper-variable-name,wrapper-sourcefile,x) # assumes that for a wrapper foo.pc its source template is foo.pc.in # if $3 is non-empty then wrapper is marked exec define emit-deploy-wrapper $($1): $2 mkdir -p '$$(shell dirname '$$@')' cp '$$<' '$$@' $(if $3,chmod +x '$$@') endef $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_dependencies,$(call get_culture,$(call get_resource_name,$(res))),$(call get_resource_name,$(res)))))) $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_commandlines,$(call get_culture,$(call get_resource_name,$(res))),$(res))))) $(build_satellite_assembly_list): $(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME): mkdir -p '$(@D)' $(AL) -out:'$@' -culture:$* -t:lib $(cmd_line_satellite_$*) $(install_satellite_assembly_list): mkdir -p '$(@D)' cp $(subst $(DESTDIR)$(libdir)/$(PACKAGE), $(BUILD_DIR), $@) $@ install-satellite-assemblies: $(install_satellite_assembly_list) uninstall-satellite-assemblies: rm -rf $(install_satellite_assembly_list) $(eval $(call emit_resgen_targets)) $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(ASSEMBLY_MDB): $(ASSEMBLY) $(ASSEMBLY): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(shell dirname $(ASSEMBLY)) $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: mono-upnp-0.1.2/tests/Mono.Ssdp.Tests/ClientTests.cs0000664000175000017500000001154511714307244023604 0ustar00lorentzlorentz00000000000000// // ClientTests.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Threading; using NUnit.Framework; namespace Mono.Ssdp.Tests { [TestFixture] public class ClientTests { readonly object mutex = new object (); [Test] public void BrowseAllAnnoucementTest () { using (var client = new Client ()) { using (var server = new Server ()) { client.ServiceAdded += ClientServiceAdded; client.BrowseAll (); lock (mutex) { server.Announce ("upnp:test", "uuid:mono-upnp-tests:test", "http://localhost/"); if (!Monitor.Wait (mutex, TimeSpan.FromSeconds (30))) { Assert.Fail ("The announcement timed out."); } } } } } [Test] public void BrowseAllSearchTest () { using (var client = new Client ()) { using (var server = new Server ()) { server.Announce ("upnp:test", "uuid:mono-upnp-tests:test", "http://localhost/"); client.ServiceAdded += ClientServiceAdded; lock (mutex) { client.BrowseAll (); if (!Monitor.Wait (mutex, TimeSpan.FromSeconds (30))) { Assert.Fail ("The announcement timed out."); } } } } } void ClientServiceAdded (object sender, ServiceArgs e) { lock (mutex) { Assert.AreEqual (ServiceOperation.Added, e.Operation); Assert.AreEqual ("upnp:test", e.Service.ServiceType); Assert.AreEqual ("uuid:mono-upnp-tests:test", e.Usn); Monitor.Pulse (mutex); } } [Test] public void BrowseAnnouncementInclusionTest () { using (var client = new Client ()) { using (var server = new Server ()) { client.ServiceAdded += ClientServiceAdded; client.Browse ("upnp:test"); lock (mutex) { server.Announce ("upnp:test", "uuid:mono-upnp-tests:test", "http://localhost/"); if (!Monitor.Wait (mutex, TimeSpan.FromSeconds (30))) { Assert.Fail ("The announcement timed out."); } } } } } [Test] public void BrowseAnnouncementExclusionTest () { using (var client = new Client ()) { using (var server = new Server ()) { client.ServiceAdded += (sender, args) => { lock (mutex) { if (args.Service.ServiceType != "upnp:test") { Monitor.Pulse (mutex); } } }; client.Browse ("upnp:test"); lock (mutex) { server.Announce ("upnp:test:fail", "uuid:mono-upnp-tests:test1", "http://localhost/"); server.Announce ("upnp", "uuid:mono-upnp-tests:test2", "http://localhost/"); server.Announce ("upnp:test", "uuid:mono-upnp-tests:test3", "http://localhost/"); if (Monitor.Wait (mutex, TimeSpan.FromSeconds (30))) { Assert.Fail ("The client recieved invalid announcements."); } } } } } } } mono-upnp-0.1.2/tests/Mono.Ssdp.Tests/ServerTests.cs0000664000175000017500000000755511714307244023642 0ustar00lorentzlorentz00000000000000// // ServerTests.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Net; using System.Net.Sockets; using System.Text; using System.Threading; using NUnit.Framework; namespace Mono.Ssdp.Tests { [TestFixture] public class ServerTests { const string address = "239.255.255.250"; const int port = 1900; static readonly IPAddress ipaddress = IPAddress.Parse (address); //static readonly IPEndPoint ip_endpoint = new IPEndPoint (ipaddress, port); static EndPoint endpoint = new IPEndPoint (IPAddress.Any, port); readonly object mutex = new object (); static Socket CreateMulticastSocket () { var socket = CreateSocket (); socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Broadcast, true); socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true); socket.SetSocketOption (SocketOptionLevel.IP, SocketOptionName.MulticastTimeToLive, 4); socket.SetSocketOption (SocketOptionLevel.IP, SocketOptionName.AddMembership, new MulticastOption (ipaddress, 0)); return socket; } static Socket CreateSocket () { var socket = new Socket (AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); socket.SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true); return socket; } [Test] public void AnnouncementTest () { using (var socket = CreateMulticastSocket ()) { using (var server = new Server ()) { lock (mutex) { socket.Bind (endpoint); var buffer = new byte[1024]; socket.BeginReceiveFrom (buffer, 0, buffer.Length, SocketFlags.None, ref endpoint, result => { lock (mutex) { socket.EndReceiveFrom (result, ref endpoint); var datagram = Encoding.ASCII.GetString (buffer, 0, buffer.Length); Assert.IsTrue (datagram.StartsWith ("NOTIFY * HTTP/1.1\r\n")); Monitor.Pulse (mutex); } }, null ); server.Announce ("test-service", "test1", "http://localhost/"); if (!Monitor.Wait (mutex, TimeSpan.FromSeconds (5))) { Assert.Fail ("The server notification timed out."); } } } } } } } mono-upnp-0.1.2/tests/Makefile.in0000664000175000017500000004121111761736756020151 0ustar00lorentzlorentz00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = tests DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/expansions.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = Mono.Ssdp.Tests Mono.Upnp.Tests \ Mono.Upnp.Dcp.MediaServer1.Tests \ Mono.Upnp.Dcp.MediaServer1.FileSystem.Tests DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ GLADE_SHARP_20_CFLAGS = @GLADE_SHARP_20_CFLAGS@ GLADE_SHARP_20_LIBS = @GLADE_SHARP_20_LIBS@ GLIB_SHARP_20_CFLAGS = @GLIB_SHARP_20_CFLAGS@ GLIB_SHARP_20_LIBS = @GLIB_SHARP_20_LIBS@ GMCS = @GMCS@ GTK_SHARP_20_CFLAGS = @GTK_SHARP_20_CFLAGS@ GTK_SHARP_20_LIBS = @GTK_SHARP_20_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MONO_ADDINS_CFLAGS = @MONO_ADDINS_CFLAGS@ MONO_ADDINS_LIBS = @MONO_ADDINS_LIBS@ NUNIT_CFLAGS = @NUNIT_CFLAGS@ NUNIT_CMD = @NUNIT_CMD@ NUNIT_LIBS = @NUNIT_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TAGLIB_SHARP_CFLAGS = @TAGLIB_SHARP_CFLAGS@ TAGLIB_SHARP_LIBS = @TAGLIB_SHARP_LIBS@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_bindir = @expanded_bindir@ expanded_datadir = @expanded_datadir@ expanded_libdir = @expanded_libdir@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = #Warning: This is an automatically generated file, do not edit! @ENABLE_DEBUG_TRUE@SUBDIRS = Mono.Ssdp.Tests Mono.Upnp.Tests Mono.Upnp.Dcp.MediaServer1.Tests Mono.Upnp.Dcp.MediaServer1.FileSystem.Tests @ENABLE_RELEASE_TRUE@SUBDIRS = Mono.Ssdp.Tests Mono.Upnp.Tests Mono.Upnp.Dcp.MediaServer1.Tests Mono.Upnp.Dcp.MediaServer1.FileSystem.Tests all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign tests/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic ctags \ ctags-recursive distclean distclean-generic distclean-tags \ distdir dvi dvi-am html html-am info info-am install \ install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \ tags-recursive uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: mono-upnp-0.1.2/tests/Mono.Upnp.Dcp.MediaServer1.Tests/0000775000175000017500000000000011761740037024015 5ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/tests/Mono.Upnp.Dcp.MediaServer1.Tests/ObjectQueryContextTests.cs0000664000175000017500000003133011707010776031170 0ustar00lorentzlorentz00000000000000// // ObjectQueryContextTests.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using NUnit.Framework; using Mono.Upnp.Dcp.MediaServer1.ContentDirectory1; using Mono.Upnp.Xml; namespace Mono.Upnp.Dcp.MediaServer1.Tests { [TestFixture] public class ObjectQueryContextTests { const string bar = "www.bar.org"; class ElementTestClass { [XmlElement] public string Foo { get; set; } } [Test] public void Element () { var context = new ObjectQueryContext (typeof (ElementTestClass)); Assert.IsTrue (context.PropertyExists ("Foo", new ElementTestClass ())); var foo = new ElementTestClass { Foo = "bar" }; Assert.IsTrue (context.PropertyExists ("Foo", foo)); Assert.IsFalse (context.PropertyExists ("Bar", foo)); var equality = false; context.VisitProperty ("Foo", foo, value => equality = value.Equals ("bar")); Assert.IsTrue (equality); equality = false; context.VisitProperty ("Foo", new ElementTestClass (), value => equality = value == null); Assert.IsTrue (equality); } class OmitIfNullElementTestClass { [XmlElement (OmitIfNull = true)] public string Foo { get; set; } } [Test] public void OmitIfNullElement () { var context = new ObjectQueryContext (typeof (OmitIfNullElementTestClass)); Assert.IsFalse (context.PropertyExists ("Foo", new OmitIfNullElementTestClass ())); Assert.IsTrue (context.PropertyExists ("Foo", new OmitIfNullElementTestClass { Foo = "bar" })); } class NamedElementTestClass { [XmlElement ("foo")] public string Foo { get; set; } } [Test] public void NamedElement () { var context = new ObjectQueryContext (typeof (NamedElementTestClass)); Assert.IsTrue (context.PropertyExists ("foo", new NamedElementTestClass ())); } class PrefixedElementTestClass { [XmlElement ("foo", bar, "bar")] public string Foo { get; set; } } [Test] public void PrefixedElement () { var context = new ObjectQueryContext (typeof (PrefixedElementTestClass)); Assert.IsTrue (context.PropertyExists ("bar:foo", new PrefixedElementTestClass ())); } class AttributeTestClass { [XmlAttribute] public string Foo { get; set; } } [Test] public void Attribute () { var context = new ObjectQueryContext (typeof (AttributeTestClass)); Assert.IsTrue (context.PropertyExists ("@Foo", new AttributeTestClass ())); var foo = new AttributeTestClass { Foo = "bar" }; Assert.IsTrue (context.PropertyExists ("@Foo", foo)); Assert.IsFalse (context.PropertyExists ("@Bar", foo)); var equality = false; context.VisitProperty ("@Foo", foo, value => equality = value.Equals ("bar")); Assert.IsTrue (equality); equality = false; context.VisitProperty ("@Foo", new AttributeTestClass (), value => equality = value == null); Assert.IsTrue (equality); } class OmitIfNullAttributeTestClass { [XmlAttribute (OmitIfNull = true)] public string Foo { get; set; } } [Test] public void OmitIfNullAttribute () { var context = new ObjectQueryContext (typeof (OmitIfNullAttributeTestClass)); Assert.IsFalse (context.PropertyExists ("@Foo", new OmitIfNullAttributeTestClass ())); Assert.IsTrue (context.PropertyExists ("@Foo", new OmitIfNullAttributeTestClass { Foo = "bar" })); } class NamedAttributeTestClass { [XmlAttribute ("foo")] public string Foo { get; set; } } [Test] public void NamedAttribute () { var context = new ObjectQueryContext (typeof (NamedAttributeTestClass)); Assert.IsTrue (context.PropertyExists ("@foo", new NamedAttributeTestClass ())); } class PrefixedAttributeTestClass { [XmlAttribute ("foo", bar, "bar")] public string Foo { get; set; } } [Test] public void PrefixedAttribute () { var context = new ObjectQueryContext (typeof (PrefixedAttributeTestClass)); Assert.IsTrue (context.PropertyExists ("@bar:foo", new PrefixedAttributeTestClass ())); } class NestedTestClass { [XmlElement] public AttributeTestClass Attribute { get; set; } [XmlElement] public OmitIfNullAttributeTestClass OmitIfNullAttribute { get; set; } [XmlElement] public NamedAttributeTestClass NamedAttribute { get; set; } [XmlElement] public PrefixedAttributeTestClass PrefixedAttribute { get; set; } [XmlElement ("prefixedNestedAttribute", bar, "bar")] public AttributeTestClass PrefixedNestedAttribute { get; set; } [XmlElement ("prefixedNestedPrefixedAttribute", bar, "bar")] public PrefixedAttributeTestClass PrefixedNestedPrefixedAttribute { get; set; } } [Test] public void NestedElements () { var context = new ObjectQueryContext (typeof (NestedTestClass)); var test = new NestedTestClass { Attribute = new AttributeTestClass (), OmitIfNullAttribute = new OmitIfNullAttributeTestClass (), NamedAttribute = new NamedAttributeTestClass (), PrefixedAttribute = new PrefixedAttributeTestClass (), PrefixedNestedAttribute = new AttributeTestClass (), PrefixedNestedPrefixedAttribute = new PrefixedAttributeTestClass () }; Assert.IsTrue (context.PropertyExists ("Attribute", test)); Assert.IsTrue (context.PropertyExists ("Attribute@Foo", test)); Assert.IsTrue (context.PropertyExists ("OmitIfNullAttribute", test)); Assert.IsFalse (context.PropertyExists ("OmitIfNullAttribute@Foo", test)); Assert.IsTrue (context.PropertyExists ("NamedAttribute", test)); Assert.IsTrue (context.PropertyExists ("NamedAttribute@foo", test)); Assert.IsTrue (context.PropertyExists ("PrefixedAttribute", test)); Assert.IsTrue (context.PropertyExists ("PrefixedAttribute@bar:foo", test)); Assert.IsTrue (context.PropertyExists ("bar:prefixedNestedAttribute", test)); Assert.IsTrue (context.PropertyExists ("bar:prefixedNestedAttribute@Foo", test)); Assert.IsTrue (context.PropertyExists ("bar:prefixedNestedPrefixedAttribute", test)); Assert.IsTrue (context.PropertyExists ("bar:prefixedNestedPrefixedAttribute@bar:foo", test)); test.OmitIfNullAttribute.Foo = "bar"; Assert.IsTrue (context.PropertyExists ("OmitIfNullAttribute@Foo", test)); var equality = false; context.VisitProperty ("OmitIfNullAttribute@Foo", test, value => equality = value.Equals ("bar")); Assert.IsTrue (equality); } class ArrayItemTestClass { [XmlArrayItem] public IEnumerable Foo { get; set; } } [Test] public void ArrayItem () { var context = new ObjectQueryContext (typeof (ArrayItemTestClass)); Assert.IsFalse (context.PropertyExists ("Foo", new ArrayItemTestClass ())); Assert.IsFalse (context.PropertyExists ("Foo", new ArrayItemTestClass { Foo = new string[0] })); var foos = new[] { "foo", "bar", "bat", "baz" }; var test = new ArrayItemTestClass { Foo = foos }; Assert.IsTrue (context.PropertyExists ("Foo", test)); var i = 0; var inequality = false; context.VisitProperty ("Foo", test, value => inequality |= !value.Equals (foos[i++])); Assert.IsFalse (inequality); } class NamedArrayItemTestClass { [XmlArrayItem ("foo")] public IEnumerable Foo { get; set; } } [Test] public void NamedArrayItem () { var context = new ObjectQueryContext (typeof (NamedArrayItemTestClass)); Assert.IsTrue (context.PropertyExists ("foo", new NamedArrayItemTestClass { Foo = new[] { "bar" } })); } class PrefixedArrayItemTestClass { [XmlArrayItem ("foo", bar, "bar")] public IEnumerable Foo { get; set; } } [Test] public void PrefixedArrayItem () { var context = new ObjectQueryContext (typeof (PrefixedArrayItemTestClass)); Assert.IsTrue (context.PropertyExists ("bar:foo", new PrefixedArrayItemTestClass { Foo = new[] { "bar" } })); } class NestedArrayItemTestClass { [XmlElement] public IEnumerable Foo { get; set; } } [Test] public void NestedArrayTestClass () { var context = new ObjectQueryContext (typeof (NestedArrayItemTestClass)); var attributes = new[] { "foo", "bar", "bat", "baz" }; var foos = new[] { new AttributeTestClass { Foo = "foo" }, new AttributeTestClass { Foo = "bar" }, new AttributeTestClass { Foo = "bat" }, new AttributeTestClass { Foo = "baz" } }; var test = new NestedArrayItemTestClass { Foo = foos }; var i = 0; var inequality = false; context.VisitProperty ("Foo@Foo", test, value => inequality |= !value.Equals (attributes[i++])); Assert.IsFalse (inequality); } class ElementTestSubclass : ElementTestClass { [XmlElement] public string Bar { get; set; } } [Test] public void SuperclassLookup () { var superclass_context = new ObjectQueryContext (typeof (ElementTestClass)); var subclass_context = new ObjectQueryContext (typeof (ElementTestSubclass), superclass_context); var test = new ElementTestSubclass (); Assert.IsTrue (superclass_context.PropertyExists ("Foo", test)); Assert.IsFalse (superclass_context.PropertyExists ("Bar", test)); Assert.IsTrue (subclass_context.PropertyExists ("Foo", test)); Assert.IsTrue (subclass_context.PropertyExists ("Bar", test)); Assert.IsFalse (new ObjectQueryContext (typeof (ElementTestSubclass)).PropertyExists ("Foo", test)); } class NullableElementTestClass { [XmlElement (OmitIfNull = true)] public int? Foo { get; set; } } [Test] public void NullableElement () { var context = new ObjectQueryContext (typeof (NullableElementTestClass)); Assert.IsTrue (context.PropertyExists ("Foo", new NullableElementTestClass { Foo = 42 })); Assert.IsFalse (context.PropertyExists ("Foo", new NullableElementTestClass ())); } class NullableAttributeTestClass { [XmlAttribute (OmitIfNull = true)] public int? Foo { get; set; } } [Test] public void NullableAttribute () { var context = new ObjectQueryContext (typeof (NullableAttributeTestClass)); Assert.IsTrue (context.PropertyExists ("@Foo", new NullableAttributeTestClass { Foo = 42 })); Assert.IsFalse (context.PropertyExists ("@Foo", new NullableAttributeTestClass ())); } } } mono-upnp-0.1.2/tests/Mono.Upnp.Dcp.MediaServer1.Tests/Makefile.am0000664000175000017500000000702211715013277026050 0ustar00lorentzlorentz00000000000000 EXTRA_DIST = # Warning: This is an automatically generated file, do not edit! if ENABLE_DEBUG ASSEMBLY_COMPILER_COMMAND = gmcs ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug "-define:DEBUG" "-keyfile:$(srcdir)/mono-upnp-dcp-mediaserver1-tests.snk" ASSEMBLY = ../../bin/Mono.Upnp.Dcp.MediaServer1.Tests.dll ASSEMBLY_MDB = $(ASSEMBLY).mdb COMPILE_TARGET = library PROJECT_REFERENCES = \ ../../bin/Mono.Upnp.Dcp.MediaServer1.dll \ ../../bin/Mono.Upnp.dll BUILD_DIR = ../../bin MONO_UPNP_DCP_MEDIASERVER1_TESTS_DLL_MDB_SOURCE=../../bin/Mono.Upnp.Dcp.MediaServer1.Tests.dll.mdb MONO_UPNP_DCP_MEDIASERVER1_TESTS_DLL_MDB=$(BUILD_DIR)/Mono.Upnp.Dcp.MediaServer1.Tests.dll.mdb MONO_UPNP_DCP_MEDIASERVER1_DLL_SOURCE=../../bin/Mono.Upnp.Dcp.MediaServer1.dll MONO_UPNP_DLL_SOURCE=../../bin/Mono.Upnp.dll MONO_SSDP_DLL_SOURCE=../../bin/Mono.Ssdp.dll MONO_SSDP_DLL_MDB_SOURCE=../../bin/Mono.Ssdp.dll.mdb MONO_SSDP_DLL_MDB=$(BUILD_DIR)/Mono.Ssdp.dll.mdb MONO_UPNP_DLL_MDB_SOURCE=../../bin/Mono.Upnp.dll.mdb MONO_UPNP_DLL_MDB=$(BUILD_DIR)/Mono.Upnp.dll.mdb MONO_UPNP_DCP_MEDIASERVER1_DLL_MDB_SOURCE=../../bin/Mono.Upnp.Dcp.MediaServer1.dll.mdb MONO_UPNP_DCP_MEDIASERVER1_DLL_MDB=$(BUILD_DIR)/Mono.Upnp.Dcp.MediaServer1.dll.mdb endif if ENABLE_RELEASE ASSEMBLY_COMPILER_COMMAND = gmcs ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- "-keyfile:$(srcdir)/mono-upnp-dcp-mediaserver1-tests.snk" ASSEMBLY = ../../bin/Mono.Upnp.Dcp.MediaServer1.Tests.dll ASSEMBLY_MDB = COMPILE_TARGET = library PROJECT_REFERENCES = \ ../../bin/Mono.Upnp.Dcp.MediaServer1.dll \ ../../bin/Mono.Upnp.dll BUILD_DIR = ../../bin MONO_UPNP_DCP_MEDIASERVER1_TESTS_DLL_MDB= MONO_UPNP_DCP_MEDIASERVER1_DLL_SOURCE=../../bin/Mono.Upnp.Dcp.MediaServer1.dll MONO_UPNP_DLL_SOURCE=../../bin/Mono.Upnp.dll MONO_SSDP_DLL_SOURCE=../../bin/Mono.Ssdp.dll MONO_SSDP_DLL_MDB= MONO_UPNP_DLL_MDB= MONO_UPNP_DCP_MEDIASERVER1_DLL_MDB= endif AL=al2 SATELLITE_ASSEMBLY_NAME=$(notdir $(basename $(ASSEMBLY))).resources.dll PROGRAMFILES = \ $(MONO_UPNP_DCP_MEDIASERVER1_TESTS_DLL_MDB) \ $(MONO_UPNP_DCP_MEDIASERVER1_DLL) \ $(MONO_UPNP_DLL) \ $(MONO_SSDP_DLL) \ $(MONO_SSDP_DLL_MDB) \ $(MONO_UPNP_DLL_MDB) \ $(MONO_UPNP_DCP_MEDIASERVER1_DLL_MDB) RESGEN=resgen2 all: $(ASSEMBLY) $(PROGRAMFILES) FILES = \ Consumer.cs \ DummyContentDirectory.cs \ DummyObject.cs \ FilteringXmlSerializerTests.cs \ ObjectQueryContextTests.cs \ ObjectQueryTests.cs \ ObjectSerializationTests.cs \ ObjectTests.cs \ QueryParserTests.cs \ QueryTests.cs \ UpdateTextWriterTests.cs \ UpdateXmlSerializerTests.cs \ VirtualXmlSerializerTests.cs DATA_FILES = RESOURCES = EXTRAS = \ mono-upnp-dcp-mediaserver1-tests.snk REFERENCES = \ ../../bin/Mono.Upnp.Dcp.MediaServer1.dll \ ../../bin/Mono.Upnp.dll \ -pkg:nunit \ System \ System.Xml DLL_REFERENCES = CLEANFILES = $(PROGRAMFILES) include $(top_srcdir)/Makefile.include MONO_UPNP_DCP_MEDIASERVER1_DLL = $(BUILD_DIR)/Mono.Upnp.Dcp.MediaServer1.dll MONO_UPNP_DLL = $(BUILD_DIR)/Mono.Upnp.dll MONO_SSDP_DLL = $(BUILD_DIR)/Mono.Ssdp.dll $(eval $(call emit_resgen_targets)) $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(ASSEMBLY_MDB): $(ASSEMBLY) $(ASSEMBLY): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(shell dirname $(ASSEMBLY)) $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) mono-upnp-0.1.2/tests/Mono.Upnp.Dcp.MediaServer1.Tests/FilteringXmlSerializerTests.cs0000664000175000017500000005206011707010776032030 0ustar00lorentzlorentz00000000000000// // FilteringXmlSerializerTests.cs // // Author: // Scott Peterson // // Copyright (c) 2010 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using NUnit.Framework; using Mono.Upnp.Dcp.MediaServer1.Xml; using Mono.Upnp.Xml; namespace Mono.Upnp.Dcp.MediaServer1.Tests { [TestFixture] public class FilteringXmlSerializerTests { readonly XmlSerializer xml_serializer = new XmlSerializer ( (serializer, type) => new FilteringDelegateSerializationCompiler (serializer, type)); const string foo = "www.foo.org"; const string bar = "www.bar.org"; const string bat = "www.bat.org"; [XmlType ("data", foo)] [XmlNamespace (bat, "bat")] [XmlNamespace (bar, "bar")] class Data { [XmlElement ("manditoryFooElement", foo)] public string ManditoryFooElement { get; set; } [XmlElement ("manditoryBarElement", bar)] public string ManditoryBarElement { get; set; } [XmlElement ("manditoryBatElement", bat)] public string ManditoryBatElement { get; set; } [XmlAttribute ("manditoryAttribute")] public string ManditoryAttribute { get; set; } [XmlAttribute ("manditoryBarAttribute", bar)] public string ManditoryBarAttribute { get; set; } [XmlAttribute ("manditoryBatAttribute", bat)] public string ManditoryBatAttribute { get; set; } [XmlElement ("optionalFooElement", foo, OmitIfNull = true)] public string OptionalFooElement { get; set; } [XmlElement ("optionalBarElement", bar, OmitIfNull = true)] public string OptionalBarElement { get; set; } [XmlElement ("optionalBatElement", bat, OmitIfNull = true)] public string OptionalBatElement { get; set; } [XmlAttribute ("optionalAttribute", OmitIfNull = true)] public string OptionalAttribute { get; set; } [XmlAttribute ("optionalBarAttribute", bar, OmitIfNull = true)] public string OptionalBarAttribute { get; set; } [XmlAttribute ("optionalBatAttribute", bat, OmitIfNull = true)] public string OptionalBatAttribute { get; set; } } static XmlSerializationOptions Options (params string[] filters) { return new XmlSerializationOptions { XmlDeclarationType = XmlDeclarationType.None, Context = new FilteringContext (typeof (T), filters) }; } [Test] public void NoFilterWithNoData () { Assert.AreEqual ( @"" + "" + "" + "" + "", xml_serializer.GetString (new Data (), Options ())); } static Data FullData { get { return new Data { ManditoryFooElement = "Manditory Foo Element", ManditoryBarElement = "Manditory Bar Element", ManditoryBatElement = "Manditory Bat Element", ManditoryAttribute = "Manditory Attribute", ManditoryBarAttribute = "Manditory Bar Attribute", ManditoryBatAttribute = "Manditory Bat Attribute", OptionalFooElement = "Optional Foo Element", OptionalBarElement = "Optional Bar Element", OptionalBatElement = "Optional Bat Element", OptionalAttribute = "Optional Attribute", OptionalBarAttribute = "Optional Bar Attribute", OptionalBatAttribute = "Optional Bat Attribute" }; } } [Test] public void NoFilterWithAllData () { Assert.AreEqual ( @"" + "Manditory Foo Element" + "Manditory Bar Element" + "Manditory Bat Element" + "", xml_serializer.GetString (FullData, Options ())); } [Test] public void WildCardWithNoData () { Assert.AreEqual ( @"" + "" + "" + "" + "", xml_serializer.GetString (new Data (), Options ("*"))); } [Test] public void WildCardWithAllData () { Assert.AreEqual ( @"" + "Manditory Foo Element" + "Manditory Bar Element" + "Manditory Bat Element" + "Optional Foo Element" + "Optional Bar Element" + "Optional Bat Element" + "", xml_serializer.GetString (FullData, Options ("*"))); } [Test] public void UnprefixedFilterWithAllData () { Assert.AreEqual ( @"" + "Manditory Foo Element" + "Manditory Bar Element" + "Manditory Bat Element" + "Optional Foo Element" + "", xml_serializer.GetString (FullData, Options ("optionalFooElement"))); } [Test] public void PrefixedFilterWithAllData () { Assert.AreEqual ( @"" + "Manditory Foo Element" + "Manditory Bar Element" + "Manditory Bat Element" + "Optional Bar Element" + "", xml_serializer.GetString (FullData, Options ("bar:optionalBarElement"))); } [Test] public void TwoPrefixedFiltersWithAllData () { Assert.AreEqual ( @"" + "Manditory Foo Element" + "Manditory Bar Element" + "Manditory Bat Element" + "Optional Bar Element" + "Optional Bat Element" + "", xml_serializer.GetString (FullData, Options ("bar:optionalBarElement", "bat:optionalBatElement"))); } [Test] public void UnprefixedAndPrefixedFiltersWithAllData () { Assert.AreEqual ( @"" + "Manditory Foo Element" + "Manditory Bar Element" + "Manditory Bat Element" + "Optional Foo Element" + "Optional Bar Element" + "", xml_serializer.GetString (FullData, Options ("optionalFooElement", "bar:optionalBarElement"))); } [Test] public void FilterAndWildCardWithAllData () { Assert.AreEqual ( @"" + "Manditory Foo Element" + "Manditory Bar Element" + "Manditory Bat Element" + "Optional Foo Element" + "Optional Bar Element" + "Optional Bat Element" + "", xml_serializer.GetString (FullData, Options ("optionalFooElement", "*"))); } [Test] public void IncludeOptionalAttribute () { Assert.AreEqual ( @"" + "Manditory Foo Element" + "Manditory Bar Element" + "Manditory Bat Element" + "", xml_serializer.GetString (FullData, Options ("@optionalAttribute"))); } [Test] public void IncludeOptionalNamespacedAttribute () { Assert.AreEqual ( @"" + "Manditory Foo Element" + "Manditory Bar Element" + "Manditory Bat Element" + "", xml_serializer.GetString (FullData, Options ("@bar:optionalBarAttribute"))); } [XmlType ("nestedData", foo)] [XmlNamespace (bar, "bar")] class NestedData { [XmlAttribute ("attribute", OmitIfNull = true)] public string Attribute { get; set; } [XmlAttribute ("barAttribute", bar, OmitIfNull = true)] public string BarAttribute { get; set; } [XmlElement ("nested", OmitIfNull = true)] public NestedData Nested { get; set; } [XmlElement ("barNested", bar, OmitIfNull = true)] public NestedData BarNested { get; set; } } static NestedData FullNestedData { get { return new NestedData { Attribute = "Attribute", BarAttribute = "Bar Attribute", Nested = new NestedData { Attribute = "Nested Attribute", BarAttribute = "Nested Bar Attribute" }, BarNested = new NestedData { Attribute = "Bar Nested Attribute", BarAttribute = "Bar Nested Bar Attribute" } }; } } [Test] public void NestedDataWithAnAttribute () { Assert.AreEqual ( @"", xml_serializer.GetString (FullNestedData, Options ("@attribute"))); } [Test] public void NestedDataWithAttributeAndNamespacedAttribute () { Assert.AreEqual ( @"", xml_serializer.GetString (FullNestedData, Options ("@attribute", "@bar:barAttribute"))); } [Test] public void NestedDataWithNoAttributes () { Assert.AreEqual ( @"", xml_serializer.GetString (FullNestedData, Options ("nested"))); } [Test] public void NamespacedNestedDataWithNoAttributes () { Assert.AreEqual ( @"", xml_serializer.GetString (FullNestedData, Options ("bar:barNested"))); } [Test] public void NestedDataWithAttribute () { Assert.AreEqual ( @"" + @""+ "", xml_serializer.GetString (FullNestedData, Options ("nested", "nested@attribute"))); } [Test] public void NestedDataWithNamespacedAttribute () { Assert.AreEqual ( @"" + @""+ "", xml_serializer.GetString (FullNestedData, Options ("nested", "nested@bar:barAttribute"))); } [Test] public void NamespacedNestedDataWithAttribute () { Assert.AreEqual ( @"" + @""+ "", xml_serializer.GetString (FullNestedData, Options ("bar:barNested", "bar:barNested@attribute"))); } [Test] public void NamespacedNestedDataWithNamespacedAttribute () { Assert.AreEqual ( @"" + @""+ "", xml_serializer.GetString (FullNestedData, Options ("bar:barNested", "bar:barNested@bar:barAttribute"))); } [Test] public void NestedAttributeButNoNestedData () { Assert.AreEqual ( @"", xml_serializer.GetString (FullNestedData, Options ("nested@attribute"))); } [Test] public void EmptyNestedDataAndAnAttribute () { Assert.AreEqual ( @"" + "" + "", xml_serializer.GetString (FullNestedData, Options ("@attribute", "nested"))); } [XmlType ("container", foo)] [XmlNamespace (bar, "bar")] class Container { [XmlElement ("content")] public T Content { get; set; } } [Test] public void ContainedNestedData () { Assert.AreEqual ( @"" + @"" + "" + "" + "", xml_serializer.GetString ( new Container { Content = FullNestedData }, Options ("@attribute", "nested"))); } [Test] public void ContainedWildCardNestedData () { Assert.AreEqual ( @"" + @"" + @"" + @"" + "" + "", xml_serializer.GetString ( new Container { Content = FullNestedData }, Options ("*"))); } } } mono-upnp-0.1.2/tests/Mono.Upnp.Dcp.MediaServer1.Tests/Makefile.in0000664000175000017500000006347011761736756026111 0ustar00lorentzlorentz00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/Makefile.include subdir = tests/Mono.Upnp.Dcp.MediaServer1.Tests ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/expansions.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(bindir)" \ "$(DESTDIR)$(assemblyfilesdir)" \ "$(DESTDIR)$(linuxpkgconfigdir)" \ "$(DESTDIR)$(programfilesdir)" SCRIPTS = $(bin_SCRIPTS) SOURCES = DIST_SOURCES = DATA = $(assemblyfiles_DATA) $(linuxpkgconfig_DATA) \ $(programfiles_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ GLADE_SHARP_20_CFLAGS = @GLADE_SHARP_20_CFLAGS@ GLADE_SHARP_20_LIBS = @GLADE_SHARP_20_LIBS@ GLIB_SHARP_20_CFLAGS = @GLIB_SHARP_20_CFLAGS@ GLIB_SHARP_20_LIBS = @GLIB_SHARP_20_LIBS@ GMCS = @GMCS@ GTK_SHARP_20_CFLAGS = @GTK_SHARP_20_CFLAGS@ GTK_SHARP_20_LIBS = @GTK_SHARP_20_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MONO_ADDINS_CFLAGS = @MONO_ADDINS_CFLAGS@ MONO_ADDINS_LIBS = @MONO_ADDINS_LIBS@ NUNIT_CFLAGS = @NUNIT_CFLAGS@ NUNIT_CMD = @NUNIT_CMD@ NUNIT_LIBS = @NUNIT_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TAGLIB_SHARP_CFLAGS = @TAGLIB_SHARP_CFLAGS@ TAGLIB_SHARP_LIBS = @TAGLIB_SHARP_LIBS@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_bindir = @expanded_bindir@ expanded_datadir = @expanded_datadir@ expanded_libdir = @expanded_libdir@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = $(build_sources) $(build_resx_files) \ $(build_others_files) $(ASSEMBLY_WRAPPER_IN) $(EXTRAS) \ $(DATA_FILES) $(build_culture_res_files) # Warning: This is an automatically generated file, do not edit! @ENABLE_DEBUG_TRUE@ASSEMBLY_COMPILER_COMMAND = gmcs @ENABLE_RELEASE_TRUE@ASSEMBLY_COMPILER_COMMAND = gmcs @ENABLE_DEBUG_TRUE@ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug "-define:DEBUG" "-keyfile:$(srcdir)/mono-upnp-dcp-mediaserver1-tests.snk" @ENABLE_RELEASE_TRUE@ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- "-keyfile:$(srcdir)/mono-upnp-dcp-mediaserver1-tests.snk" @ENABLE_DEBUG_TRUE@ASSEMBLY = ../../bin/Mono.Upnp.Dcp.MediaServer1.Tests.dll @ENABLE_RELEASE_TRUE@ASSEMBLY = ../../bin/Mono.Upnp.Dcp.MediaServer1.Tests.dll @ENABLE_DEBUG_TRUE@ASSEMBLY_MDB = $(ASSEMBLY).mdb @ENABLE_RELEASE_TRUE@ASSEMBLY_MDB = @ENABLE_DEBUG_TRUE@COMPILE_TARGET = library @ENABLE_RELEASE_TRUE@COMPILE_TARGET = library @ENABLE_DEBUG_TRUE@PROJECT_REFERENCES = \ @ENABLE_DEBUG_TRUE@ ../../bin/Mono.Upnp.Dcp.MediaServer1.dll \ @ENABLE_DEBUG_TRUE@ ../../bin/Mono.Upnp.dll @ENABLE_RELEASE_TRUE@PROJECT_REFERENCES = \ @ENABLE_RELEASE_TRUE@ ../../bin/Mono.Upnp.Dcp.MediaServer1.dll \ @ENABLE_RELEASE_TRUE@ ../../bin/Mono.Upnp.dll @ENABLE_DEBUG_TRUE@BUILD_DIR = ../../bin @ENABLE_RELEASE_TRUE@BUILD_DIR = ../../bin @ENABLE_DEBUG_TRUE@MONO_UPNP_DCP_MEDIASERVER1_TESTS_DLL_MDB_SOURCE = ../../bin/Mono.Upnp.Dcp.MediaServer1.Tests.dll.mdb @ENABLE_DEBUG_TRUE@MONO_UPNP_DCP_MEDIASERVER1_TESTS_DLL_MDB = $(BUILD_DIR)/Mono.Upnp.Dcp.MediaServer1.Tests.dll.mdb @ENABLE_RELEASE_TRUE@MONO_UPNP_DCP_MEDIASERVER1_TESTS_DLL_MDB = @ENABLE_DEBUG_TRUE@MONO_UPNP_DCP_MEDIASERVER1_DLL_SOURCE = ../../bin/Mono.Upnp.Dcp.MediaServer1.dll @ENABLE_RELEASE_TRUE@MONO_UPNP_DCP_MEDIASERVER1_DLL_SOURCE = ../../bin/Mono.Upnp.Dcp.MediaServer1.dll @ENABLE_DEBUG_TRUE@MONO_UPNP_DLL_SOURCE = ../../bin/Mono.Upnp.dll @ENABLE_RELEASE_TRUE@MONO_UPNP_DLL_SOURCE = ../../bin/Mono.Upnp.dll @ENABLE_DEBUG_TRUE@MONO_SSDP_DLL_SOURCE = ../../bin/Mono.Ssdp.dll @ENABLE_RELEASE_TRUE@MONO_SSDP_DLL_SOURCE = ../../bin/Mono.Ssdp.dll @ENABLE_DEBUG_TRUE@MONO_SSDP_DLL_MDB_SOURCE = ../../bin/Mono.Ssdp.dll.mdb @ENABLE_DEBUG_TRUE@MONO_SSDP_DLL_MDB = $(BUILD_DIR)/Mono.Ssdp.dll.mdb @ENABLE_RELEASE_TRUE@MONO_SSDP_DLL_MDB = @ENABLE_DEBUG_TRUE@MONO_UPNP_DLL_MDB_SOURCE = ../../bin/Mono.Upnp.dll.mdb @ENABLE_DEBUG_TRUE@MONO_UPNP_DLL_MDB = $(BUILD_DIR)/Mono.Upnp.dll.mdb @ENABLE_RELEASE_TRUE@MONO_UPNP_DLL_MDB = @ENABLE_DEBUG_TRUE@MONO_UPNP_DCP_MEDIASERVER1_DLL_MDB_SOURCE = ../../bin/Mono.Upnp.Dcp.MediaServer1.dll.mdb @ENABLE_DEBUG_TRUE@MONO_UPNP_DCP_MEDIASERVER1_DLL_MDB = $(BUILD_DIR)/Mono.Upnp.Dcp.MediaServer1.dll.mdb @ENABLE_RELEASE_TRUE@MONO_UPNP_DCP_MEDIASERVER1_DLL_MDB = AL = al2 SATELLITE_ASSEMBLY_NAME = $(notdir $(basename $(ASSEMBLY))).resources.dll PROGRAMFILES = \ $(MONO_UPNP_DCP_MEDIASERVER1_TESTS_DLL_MDB) \ $(MONO_UPNP_DCP_MEDIASERVER1_DLL) \ $(MONO_UPNP_DLL) \ $(MONO_SSDP_DLL) \ $(MONO_SSDP_DLL_MDB) \ $(MONO_UPNP_DLL_MDB) \ $(MONO_UPNP_DCP_MEDIASERVER1_DLL_MDB) RESGEN = resgen2 FILES = \ Consumer.cs \ DummyContentDirectory.cs \ DummyObject.cs \ FilteringXmlSerializerTests.cs \ ObjectQueryContextTests.cs \ ObjectQueryTests.cs \ ObjectSerializationTests.cs \ ObjectTests.cs \ QueryParserTests.cs \ QueryTests.cs \ UpdateTextWriterTests.cs \ UpdateXmlSerializerTests.cs \ VirtualXmlSerializerTests.cs DATA_FILES = RESOURCES = EXTRAS = \ mono-upnp-dcp-mediaserver1-tests.snk REFERENCES = \ ../../bin/Mono.Upnp.Dcp.MediaServer1.dll \ ../../bin/Mono.Upnp.dll \ -pkg:nunit \ System \ System.Xml DLL_REFERENCES = CLEANFILES = $(PROGRAMFILES) $(ASSEMBLY) $(ASSEMBLY).mdb $(BINARIES) \ $(build_resx_resources) $(build_satellite_assembly_list) VALID_CULTURES = ar bg ca zh-CHS cs da de el en es fi fr he hu is it ja ko nl no pl pt ro ru hr sk sq sv th tr id uk be sl et lv lt fa vi hy eu mk af ka fo hi sw gu ta te kn mr gl kok ar-SA bg-BG ca-ES zh-TW cs-CZ da-DK de-DE el-GR en-US fi-FI fr-FR he-IL hu-HU is-IS it-IT ja-JP ko-KR nl-NL nb-NO pl-PL pt-BR ro-RO ru-RU hr-HR sk-SK sq-AL sv-SE th-TH tr-TR id-ID uk-UA be-BY sl-SI et-EE lv-LV lt-LT fa-IR vi-VN hy-AM eu-ES mk-MK af-ZA ka-GE fo-FO hi-IN sw-KE gu-IN ta-IN te-IN kn-IN mr-IN gl-ES kok-IN ar-IQ zh-CN de-CH en-GB es-MX fr-BE it-CH nl-BE nn-NO pt-PT sv-FI ar-EG zh-HK de-AT en-AU es-ES fr-CA ar-LY zh-SG de-LU en-CA es-GT fr-CH ar-DZ zh-MO en-NZ es-CR fr-LU ar-MA en-IE es-PA ar-TN en-ZA es-DO ar-OM es-VE ar-YE es-CO ar-SY es-PE ar-JO en-TT es-AR ar-LB en-ZW es-EC ar-KW en-PH es-CL ar-AE es-UY ar-BH es-PY ar-QA es-BO es-SV es-HN es-NI es-PR zh-CHT s2q = $(subst \ ,?,$1) q2s = $(subst ?,\ ,$1) # use this when result will be quoted unesc2 = $(subst ?, ,$1) build_sources = $(FILES) $(GENERATED_FILES) build_sources_esc = $(call s2q,$(build_sources)) # use unesc2, as build_sources_embed is quoted build_sources_embed = $(call unesc2,$(build_sources_esc:%='$(srcdir)/%')) comma__ = , get_resource_name = $(firstword $(subst $(comma__), ,$1)) get_culture = $(lastword $(subst ., ,$(basename $1))) is_cultured_resource = $(and $(word 3,$(subst ., ,$1)), $(filter $(VALID_CULTURES),$(lastword $(subst ., ,$(basename $1))))) RESOURCES_ESC = $(call s2q,$(RESOURCES)) build_resx_list = $(foreach res, $(RESOURCES_ESC), $(if $(filter %.resx, $(call get_resource_name,$(res))),$(res),)) build_non_culture_resx_list = $(foreach res, $(build_resx_list),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_non_culture_others_list = $(foreach res, $(filter-out $(build_resx_list),$(RESOURCES_ESC)),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_others_list = $(build_non_culture_others_list) build_xamlg_list = $(filter %.xaml.g.cs, $(FILES)) # resgen all .resx resources build_resx_files = $(foreach res, $(build_resx_list), $(call get_resource_name,$(res))) build_resx_resources_esc = $(build_resx_files:.resx=.resources) build_resx_resources = $(call q2s,$(build_resx_resources_esc)) # embed resources for the main assembly build_resx_resources_hack = $(subst .resx,.resources, $(build_non_culture_resx_list)) # use unesc2, as build_resx_resources_embed is quoted build_resx_resources_embed = $(call unesc2,$(build_resx_resources_hack:%='-resource:%')) build_others_files = $(call q2s,$(foreach res, $(build_others_list),$(call get_resource_name,$(res)))) build_others_resources = $(build_others_files) # use unesc2, as build_others_resources_embed is quoted build_others_resources_embed = $(call unesc2,$(build_others_list:%='-resource:$(srcdir)/%')) build_resources = $(build_resx_resources) $(build_others_resources) build_resources_embed = $(build_resx_resources_embed) $(build_others_resources_embed) # -usesourcepath is available only for resgen2 emit_resgen_target_1 = $(call q2s,$1) : $(call q2s,$(subst .resources,.resx,$1)); cd '$$(shell dirname '$$<')' && MONO_IOMAP=drive $$(RESGEN) '$$(shell basename '$$<')' '$$(shell basename '$$@')' emit_resgen_target_2 = $(call q2s,$1) : $(call q2s,$(subst .resources,.resx,$1)); MONO_IOMAP=drive $$(RESGEN) -usesourcepath '$$<' '$$@' emit_resgen_target = $(if $(filter resgen2,$(RESGEN)),$(emit_resgen_target_2),$(emit_resgen_target_1)) emit_resgen_targets = $(foreach res,$(build_resx_resources_esc),$(eval $(call emit_resgen_target,$(res)))) build_references_ref = $(call q2s,$(foreach ref, $(call \ s2q,$(REFERENCES)), $(if $(filter -pkg:%, $(ref)), $(ref), \ $(if $(filter -r:%, $(ref)), $(ref), -r:$(ref))))) $(call \ q2s,$(foreach ref, $(call s2q,$(DLL_REFERENCES)), -r:$(ref))) \ $(call q2s,$(foreach ref, $(call s2q,$(PROJECT_REFERENCES)), \ -r:$(ref))) s2q2s = $(call unesc2,$(call s2q,$1)) cp_actual = test -z $1 || cp $1 $2 cp = $(call cp_actual,'$(call s2q2s,$1)','$(call s2q2s,$2)') rm_actual = test -z '$1' || rm -f '$2' rm = $(call rm_actual,$(call s2q2s,$1),$(call s2q2s,$2)/$(shell basename '$(call s2q2s,$1)')) DISTCLEANFILES = $(GENERATED_FILES) $(pc_files) $(BUILD_DIR)/* assemblyfilesdir = $(pkglibdir) assemblyfiles_DATA = $(ASSEMBLY) bin_SCRIPTS = $(BINARIES) programfilesdir = @libdir@/@PACKAGE@ programfiles_DATA = $(PROGRAMFILES) linuxpkgconfigdir = @libdir@/pkgconfig linuxpkgconfig_DATA = $(LINUX_PKGCONFIG) # generating satellite assemblies culture_resources = $(foreach res, $(RESOURCES_ESC), $(if $(call is_cultured_resource,$(call get_resource_name, $(res))),$(res))) cultures = $(sort $(foreach res, $(culture_resources), $(call get_culture,$(call get_resource_name,$(res))))) culture_resource_dependencies = $(call q2s,$(BUILD_DIR)/$1/$(SATELLITE_ASSEMBLY_NAME): $(subst .resx,.resources,$2)) culture_resource_commandlines = $(call unesc2,cmd_line_satellite_$1 += '/embed:$(subst .resx,.resources,$2)') build_satellite_assembly_list = $(call q2s,$(cultures:%=$(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME))) build_culture_res_files = $(call q2s,$(foreach res, $(culture_resources),$(call get_resource_name,$(res)))) install_satellite_assembly_list = $(subst $(BUILD_DIR),$(DESTDIR)$(libdir)/$(PACKAGE),$(build_satellite_assembly_list)) MONO_UPNP_DCP_MEDIASERVER1_DLL = $(BUILD_DIR)/Mono.Upnp.Dcp.MediaServer1.dll MONO_UPNP_DLL = $(BUILD_DIR)/Mono.Upnp.dll MONO_SSDP_DLL = $(BUILD_DIR)/Mono.Ssdp.dll all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.include $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/Mono.Upnp.Dcp.MediaServer1.Tests/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign tests/Mono.Upnp.Dcp.MediaServer1.Tests/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/Makefile.include: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) install-assemblyfilesDATA: $(assemblyfiles_DATA) @$(NORMAL_INSTALL) test -z "$(assemblyfilesdir)" || $(MKDIR_P) "$(DESTDIR)$(assemblyfilesdir)" @list='$(assemblyfiles_DATA)'; test -n "$(assemblyfilesdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(assemblyfilesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(assemblyfilesdir)" || exit $$?; \ done uninstall-assemblyfilesDATA: @$(NORMAL_UNINSTALL) @list='$(assemblyfiles_DATA)'; test -n "$(assemblyfilesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(assemblyfilesdir)'; $(am__uninstall_files_from_dir) install-linuxpkgconfigDATA: $(linuxpkgconfig_DATA) @$(NORMAL_INSTALL) test -z "$(linuxpkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(linuxpkgconfigdir)" @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(linuxpkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(linuxpkgconfigdir)" || exit $$?; \ done uninstall-linuxpkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(linuxpkgconfigdir)'; $(am__uninstall_files_from_dir) install-programfilesDATA: $(programfiles_DATA) @$(NORMAL_INSTALL) test -z "$(programfilesdir)" || $(MKDIR_P) "$(DESTDIR)$(programfilesdir)" @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(programfilesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(programfilesdir)" || exit $$?; \ done uninstall-programfilesDATA: @$(NORMAL_UNINSTALL) @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(programfilesdir)'; $(am__uninstall_files_from_dir) tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(assemblyfilesdir)" "$(DESTDIR)$(linuxpkgconfigdir)" "$(DESTDIR)$(programfilesdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-assemblyfilesDATA install-linuxpkgconfigDATA \ install-programfilesDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binSCRIPTS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-assemblyfilesDATA uninstall-binSCRIPTS \ uninstall-linuxpkgconfigDATA uninstall-programfilesDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-assemblyfilesDATA \ install-binSCRIPTS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-linuxpkgconfigDATA install-man install-pdf \ install-pdf-am install-programfilesDATA install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \ uninstall-am uninstall-assemblyfilesDATA uninstall-binSCRIPTS \ uninstall-linuxpkgconfigDATA uninstall-programfilesDATA all: $(ASSEMBLY) $(PROGRAMFILES) # macros # $(call emit-deploy-target,deploy-variable-name) define emit-deploy-target $($1): $($1_SOURCE) mkdir -p '$$(shell dirname '$$@')' cp '$$<' '$$@' endef # $(call emit-deploy-wrapper,wrapper-variable-name,wrapper-sourcefile,x) # assumes that for a wrapper foo.pc its source template is foo.pc.in # if $3 is non-empty then wrapper is marked exec define emit-deploy-wrapper $($1): $2 mkdir -p '$$(shell dirname '$$@')' cp '$$<' '$$@' $(if $3,chmod +x '$$@') endef $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_dependencies,$(call get_culture,$(call get_resource_name,$(res))),$(call get_resource_name,$(res)))))) $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_commandlines,$(call get_culture,$(call get_resource_name,$(res))),$(res))))) $(build_satellite_assembly_list): $(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME): mkdir -p '$(@D)' $(AL) -out:'$@' -culture:$* -t:lib $(cmd_line_satellite_$*) $(install_satellite_assembly_list): mkdir -p '$(@D)' cp $(subst $(DESTDIR)$(libdir)/$(PACKAGE), $(BUILD_DIR), $@) $@ install-satellite-assemblies: $(install_satellite_assembly_list) uninstall-satellite-assemblies: rm -rf $(install_satellite_assembly_list) $(eval $(call emit_resgen_targets)) $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(ASSEMBLY_MDB): $(ASSEMBLY) $(ASSEMBLY): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(shell dirname $(ASSEMBLY)) $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: mono-upnp-0.1.2/tests/Mono.Upnp.Dcp.MediaServer1.Tests/UpdateXmlSerializerTests.cs0000664000175000017500000003327111707010776031332 0ustar00lorentzlorentz00000000000000// // UpdateXmlSerializerTests.cs // // Author: // Scott Peterson // // Copyright (c) 2010 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using System.IO; using System.Text; using NUnit.Framework; using Mono.Upnp.Xml; using Mono.Upnp.Dcp.MediaServer1.Xml; namespace Mono.Upnp.Dcp.MediaServer1.Tests { [TestFixture] public class UpdateXmlSerializerTests { readonly UpdateXmlSerializer serializer = new UpdateXmlSerializer (); class Data { [XmlElement] public string Foo { get; set; } [XmlElement] public int Bar { get; set; } [XmlElement] public bool Bat { get; set; } } [Test] public void NoUpdate () { AssertAreEqual (null, new Data { Foo = "foo", Bar = 42, Bat = true }, new Data { Foo = "foo", Bar = 42, Bat = true }); } [Test] public void OneUpdate () { AssertAreEqual ("foo", new Data { Foo = "foo", Bar = 42, Bat = true }, new Data { Foo = "bar", Bar = 42, Bat = true }); } [Test] public void OneMadeNotNull () { AssertAreEqual ("", new Data { Foo = null, Bar = 42, Bat = true }, new Data { Foo = "foo", Bar = 42, Bat = true }); } [Test] public void OneMadeNull () { AssertAreEqual ("foo", new Data { Foo = "foo", Bar = 42, Bat = true }, new Data { Foo = null, Bar = 42, Bat = true }); } [Test] public void OneUpdateWithCommaEscapes () { AssertAreEqual (@"the truth\, the whole truth\, and nothing but the truth", new Data { Foo = "the truth, the whole truth, and nothing but the truth", Bar = 42, Bat = true }, new Data { Foo = "bar", Bar = 42, Bat = true }); } [Test] public void TwoUpdates () { AssertAreEqual ("foo,42", new Data { Foo = "foo", Bar = 42, Bat = true }, new Data { Foo = "bar", Bar = 13, Bat = true }); } [Test] public void ThreeUpdates () { AssertAreEqual ("foo,42,True", new Data { Foo = "foo", Bar = 42, Bat = true }, new Data { Foo = "bar", Bar = 13, Bat = false }); } class NamedData { [XmlElement ("foo")] public string Foo { get; set; } } [Test] public void NamedElementUpdate () { AssertAreEqual ("foo", new NamedData { Foo = "foo" }, new NamedData { Foo = "bar" }); } class OmitIfNullData { [XmlElement (OmitIfNull = true)] public string Foo { get; set; } [XmlElement (OmitIfNull = true)] public string Bar { get; set; } } [Test] public void OneOmitIfNullMadeNotNull () { AssertAreEqual ("", new OmitIfNullData (), new OmitIfNullData { Foo = "foo" }); } [Test] public void OneOmitIfNullMadeNull () { AssertAreEqual ("foo", new OmitIfNullData { Foo = "foo" }, new OmitIfNullData ()); } [Test] public void TwoOmitIfNullMadeNotNull () { AssertAreEqual (",", new OmitIfNullData (), new OmitIfNullData { Foo = "foo", Bar = "bar" }); } [Test] public void TwoOmitIfNullMadeNull () { AssertAreEqual ("foo,bar", new OmitIfNullData { Foo = "foo", Bar = "bar" }, new OmitIfNullData ()); } class DataWithFlag { [XmlElement] public string Foo { get; set; } [XmlFlag] public bool Bar { get; set; } } [Test] public void FlagAdded () { AssertAreEqual ("", new DataWithFlag { Foo = "foo", Bar = false }, new DataWithFlag { Foo = "foo", Bar = true }); } [Test] public void FlagAddedAndStringChanged () { AssertAreEqual ("foo,", new DataWithFlag { Foo = "foo", Bar = false }, new DataWithFlag { Foo = "bar", Bar = true }); } [Test] public void FlagRemoved () { AssertAreEqual ("", new DataWithFlag { Foo = "foo", Bar = true }, new DataWithFlag { Foo = "foo", Bar = false }); } [Test] public void FlagRemovedAndStringChanged () { AssertAreEqual ("foo,", new DataWithFlag { Foo = "foo", Bar = true }, new DataWithFlag { Foo = "bar", Bar = false }); } #pragma warning disable 0659 class NestedData { [XmlElement] public string Foo { get; set; } [XmlElement (OmitIfNull = true)] public NestedData Child { get; set; } public override bool Equals (object obj) { var data = (NestedData)obj; return data.Foo == Foo && data.Child.Equals (Child); } } #pragma warning restore 0659 [Test] public void NestedObjectChanged () { AssertAreEqual ("foo", new NestedData { Child = new NestedData { Foo = "foo" } }, new NestedData { Child = new NestedData { Foo = "bar" } }); } #pragma warning disable 0659 class Item { readonly string foo; public Item (string foo) { this.foo = foo; } public override bool Equals (object obj) { return foo == ((Item)obj).foo; } public override string ToString () { return foo; } } #pragma warning restore 0659 class ArrayItemData { [XmlArrayItem] public IEnumerable Data { get; set; } } [Test] public void NullArrayItemUnchanged () { AssertAreEqual (null, new ArrayItemData (), new ArrayItemData ()); } [Test] public void EmptyArrayItemUnchaged () { AssertAreEqual (null, new ArrayItemData { Data = new Item[0] }, new ArrayItemData { Data = new Item[0] }); } [Test] public void SingleArrayItemUnchanged () { AssertAreEqual (null, new ArrayItemData { Data = new [] { new Item ("foo") } }, new ArrayItemData { Data = new [] { new Item ("foo") } }); } [Test] public void TwoArrayItemsUnchanged () { AssertAreEqual (null, new ArrayItemData { Data = new [] { new Item ("foo"), new Item ("bar") } }, new ArrayItemData { Data = new [] { new Item ("foo"), new Item ("bar") } }); } [Test] public void NullArrayItemMadeEmpty () { AssertAreEqual (null, new ArrayItemData (), new ArrayItemData { Data = new Item[0] }); } [Test] public void EmptyArrayItemMadeNull () { AssertAreEqual (null, new ArrayItemData { Data = new Item[0] }, new ArrayItemData ()); } [Test] public void NullArrayItemMadeSingle () { AssertAreEqual ("", new ArrayItemData (), new ArrayItemData { Data = new [] { new Item ("foo") } }); } [Test] public void SingleArrayItemMadeNull () { AssertAreEqual ("foo", new ArrayItemData { Data = new [] { new Item ("foo") } }, new ArrayItemData ()); } [Test] public void NullArrayItemMadeDouble () { AssertAreEqual (",", new ArrayItemData (), new ArrayItemData { Data = new [] { new Item ("foo"), new Item ("bar") } }); } [Test] public void DoubleArrayItemMadeNull () { AssertAreEqual ("foo,bar", new ArrayItemData { Data = new [] { new Item ("foo"), new Item ("bar") } }, new ArrayItemData ()); } [Test] public void EmptyArrayItemMadeSingle () { AssertAreEqual ("", new ArrayItemData { Data = new Item[0] }, new ArrayItemData { Data = new [] { new Item ("foo") } }); } [Test] public void SingleArrayItemMadeEmpty () { AssertAreEqual ("foo", new ArrayItemData { Data = new [] { new Item ("foo") } }, new ArrayItemData { Data = new Item[0] }); } [Test] public void EmptyArrayItemMadeDouble () { AssertAreEqual (",", new ArrayItemData { Data = new Item[0] }, new ArrayItemData { Data = new [] { new Item ("foo"), new Item ("bar") } }); } [Test] public void DoubleArrayItemMadeEmpty () { AssertAreEqual ("foo,bar", new ArrayItemData { Data = new [] { new Item ("foo"), new Item ("bar") } }, new ArrayItemData { Data = new Item[0] }); } [Test] public void SingleArrayItemMadeDouble () { AssertAreEqual ("", new ArrayItemData { Data = new [] { new Item ("foo") } }, new ArrayItemData { Data = new [] { new Item ("foo"), new Item ("bar") } }); } [Test] public void DoubleArrayItemMadeSingle () { AssertAreEqual ("bar", new ArrayItemData { Data = new [] { new Item ("foo"), new Item ("bar") } }, new ArrayItemData { Data = new [] { new Item ("foo") } }); } [Test] public void ArrayItemsChanged () { var data1 = new ArrayItemData { Data = new [] { new Item ("1"), new Item ("2"), new Item ("3") } }; var data2 = new ArrayItemData { Data = new [] { new Item ("a"), new Item ("b"), new Item ("c") } }; AssertAreEqual ("1,2,3", data1, data2); AssertAreEqual ("a,b,c", data2, data1); } [Test] public void ArrayItemRemovedWithNull () { var data1 = new ArrayItemData { Data = new [] { new Item ("foo") } }; var data2 = new ArrayItemData { Data = new Item[] { null } }; AssertAreEqual ("foo", data1, data2); AssertAreEqual ("", data2, data1); } [Test] public void ArrayItemsChangedAndAddedAndRemovedWithNull () { var data1 = new ArrayItemData { Data = new [] { new Item ("1"), new Item ("2"), new Item ("3") } }; var data2 = new ArrayItemData { Data = new [] { null, new Item ("2"), new Item ("three"), new Item ("4") } }; AssertAreEqual ("1,3,", data1, data2); AssertAreEqual (",three,4", data2, data1); } void AssertAreEqual (string expected, T obj1, T obj2) { using (var stream = new MemoryStream ()) { var updated = serializer.Serialize (obj1, obj2, stream); if (expected == null) { Assert.IsFalse (updated); return; } stream.Seek (0, SeekOrigin.Begin); var buffer = new byte[stream.Length]; stream.Read (buffer, 0, (int)stream.Length); var actual = Encoding.UTF8.GetString (buffer); Assert.AreEqual (expected, actual); } } } } mono-upnp-0.1.2/tests/Mono.Upnp.Dcp.MediaServer1.Tests/DummyContentDirectory.cs0000664000175000017500000000431711707010776030664 0ustar00lorentzlorentz00000000000000// // DummyContentDirectory.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using Mono.Upnp.Dcp.MediaServer1.ContentDirectory1; namespace Mono.Upnp.Dcp.MediaServer1.Tests { public class DummyContentDirectory : LocalContentDirectory { protected override string SearchCapabilities { get { return string.Empty; } } protected override string SortCapabilities { get { return string.Empty; } } protected override string Browse (string objectId, BrowseFlag browseFlag, string filter, int startIndex, int requestCount, string sortCriteria, out int numberReturned, out int totalMatches, out string updateId) { throw new System.NotImplementedException(); } } } mono-upnp-0.1.2/tests/Mono.Upnp.Dcp.MediaServer1.Tests/ObjectQueryTests.cs0000664000175000017500000003377111707010776027636 0ustar00lorentzlorentz00000000000000// // ObjectQueryTests.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using NUnit.Framework; using Mono.Upnp.Dcp.MediaServer1.ContentDirectory1; using Mono.Upnp.Xml; namespace Mono.Upnp.Dcp.MediaServer1.Tests { [TestFixture] public class ObjectQueryTests : QueryTests { static readonly Query text = new Query ("Text"); static readonly Query number = new Query ("Number"); static readonly Query nullable_number = new Query ("NullableNumber"); static readonly Query text_attribute = new Query ("@Text"); static readonly Query number_attribute = new Query ("@Number"); static readonly Query nullable_number_attribute = new Query ("@NullableNumber"); static readonly Query nested_text_attribute = new Query ("Data@Text"); static readonly Query nested_number_attribute = new Query ("Data@Number"); static readonly Query nested_nullable_number_attribute = new Query ("Data@NullableNumber"); class Data : DummyObject { [XmlElement] public string Text { get; set; } [XmlElement] public int Number { get; set; } [XmlElement] public int? NullableNumber { get; set; } } Data FullData { get { return new Data { Text = "bar", Number = 42, NullableNumber = 13 }; } } [Test] public void Equality () { Assert.IsTrue (Matches (FullData, text == "bar")); Assert.IsFalse (Matches (FullData, text == null)); Assert.IsFalse (Matches (FullData, text == "bat")); Assert.IsTrue (Matches (new Data (), text == null)); Assert.IsTrue (Matches (FullData, number == "42")); Assert.IsFalse (Matches (FullData, number == "13")); Assert.IsTrue (Matches (FullData, nullable_number == "13")); Assert.IsTrue (Matches (new Data (), nullable_number == null)); Assert.IsFalse (Matches (FullData, nullable_number == null)); } [Test] public void Inequality () { Assert.IsTrue (Matches (FullData, text != "bat")); Assert.IsTrue (Matches (FullData, text != null)); Assert.IsFalse (Matches (FullData, text != "bar")); Assert.IsFalse (Matches (new Data (), text != null)); Assert.IsTrue (Matches (FullData, number != "13")); Assert.IsFalse (Matches (FullData, number != "42")); Assert.IsFalse (Matches (new Data (), nullable_number != null)); Assert.IsTrue (Matches (FullData, nullable_number != null)); } [Test] public void LessThan () { Assert.IsTrue (Matches (FullData, number < "43")); Assert.IsFalse (Matches (FullData, number < "42")); Assert.IsTrue (Matches (FullData, nullable_number < "14")); Assert.IsFalse (Matches (FullData, nullable_number < "13")); } [Test] public void LessThanOrEqualTo () { Assert.IsTrue (Matches (FullData, number <= "43")); Assert.IsTrue (Matches (FullData, number <= "42")); Assert.IsFalse (Matches (FullData, number <= "41")); Assert.IsTrue (Matches (FullData, nullable_number <= "14")); Assert.IsTrue (Matches (FullData, nullable_number <= "13")); Assert.IsFalse (Matches (FullData, nullable_number <= "12")); } [Test] public void GreaterThan () { Assert.IsTrue (Matches (FullData, number > "41")); Assert.IsFalse (Matches (FullData, number > "42")); Assert.IsTrue (Matches (FullData, nullable_number > "12")); Assert.IsFalse (Matches (FullData, nullable_number > "13")); } [Test] public void GreaterThanOrEqualTo () { Assert.IsTrue (Matches (FullData, number >= "41")); Assert.IsTrue (Matches (FullData, number >= "42")); Assert.IsFalse (Matches (FullData, number >= "43")); Assert.IsTrue (Matches (FullData, nullable_number >= "12")); Assert.IsTrue (Matches (FullData, nullable_number >= "13")); Assert.IsFalse (Matches (FullData, nullable_number >= "14")); } [Test] public void Contains () { Assert.IsTrue (Matches (FullData, text.Contains ("bar"))); Assert.IsTrue (Matches (FullData, text.Contains ("ba"))); Assert.IsTrue (Matches (FullData, text.Contains ("ar"))); Assert.IsFalse (Matches (FullData, text.Contains ("bart"))); Assert.IsFalse (Matches (FullData, text.Contains ("bb"))); Assert.IsFalse (Matches (new Data (), text.Contains ("bb"))); } [Test] public void DoesNotContain () { Assert.IsFalse (Matches (FullData, text.DoesNotContain ("bar"))); Assert.IsFalse (Matches (FullData, text.DoesNotContain ("ba"))); Assert.IsFalse (Matches (FullData, text.DoesNotContain ("ar"))); Assert.IsTrue (Matches (FullData, text.DoesNotContain ("bart"))); Assert.IsTrue (Matches (FullData, text.DoesNotContain ("bb"))); Assert.IsTrue (Matches (new Data (), text.DoesNotContain ("bb"))); } [Test] public void Conjoin () { Assert.IsTrue (Matches (FullData, Conjoin (text == "bar", number == "42"))); Assert.IsTrue (Matches ( FullData, Conjoin (Conjoin (text == "bar", number == "42"), nullable_number <= "13"))); Assert.IsFalse (Matches (FullData, Conjoin (text == "bar", number < "42"))); Assert.IsFalse (Matches (FullData, Conjoin (text == "bart", number == "42"))); } [Test] public void Disjoin () { Assert.IsTrue (Matches (FullData, Disjoin (text == "bar", number == "42"))); Assert.IsTrue (Matches (FullData, Disjoin (text == "bar", number < "42"))); Assert.IsTrue (Matches (FullData, Disjoin (text == "bart", number == "42"))); Assert.IsTrue (Matches ( FullData, Disjoin (Disjoin (text == "bart", number == "42"), nullable_number == "13"))); Assert.IsTrue (Matches ( FullData, Disjoin (Disjoin (text == "bart", number != "42"), nullable_number == "13"))); Assert.IsFalse (Matches (FullData, Disjoin (text == "bart", number < "42"))); } class OmitIfNullData : DummyObject { [XmlElement (OmitIfNull = true)] public string Text { get; set; } [XmlElement (OmitIfNull = true)] public int? Number { get; set; } } [Test] public void Exists () { var data = new OmitIfNullData { Text = "foo", Number = 42 }; Assert.IsTrue (Matches (data, text.Exists (true))); Assert.IsFalse (Matches (data, text.Exists (false))); Assert.IsTrue (Matches (data, number.Exists (true))); Assert.IsFalse (Matches (data, number.Exists (false))); Assert.IsFalse (Matches (new OmitIfNullData (), text.Exists (true))); Assert.IsTrue (Matches (new OmitIfNullData (), text.Exists (false))); Assert.IsFalse (Matches (new OmitIfNullData (), number.Exists (true))); Assert.IsTrue (Matches (new OmitIfNullData (), number.Exists (false))); Assert.IsFalse (Matches (data, text_attribute.Exists (true))); Assert.IsTrue (Matches (data, text_attribute.Exists (false))); } class ArrayItemData : DummyObject { [XmlArrayItem] public IEnumerable Text { get; set; } [XmlArrayItem] public IEnumerable Number { get; set; } } [Test] public void ArrayItems () { var data = new ArrayItemData { Text = new[] { "one", "two", "three" }, Number = new[] { 1, 2, 3 } }; Assert.IsTrue (Matches (data, text == "two")); Assert.IsTrue (Matches (data, text.Contains ("ee"))); Assert.IsTrue (Matches (data, text.Contains ("t"))); Assert.IsTrue (Matches (data, text.Exists (true))); Assert.IsFalse (Matches (data, text.Exists (false))); Assert.IsTrue (Matches (new ArrayItemData (), text.Exists (false))); Assert.IsFalse (Matches (new ArrayItemData (), text.Exists (true))); Assert.IsTrue (Matches (data, number < "4")); Assert.IsTrue (Matches (data, number < "3")); Assert.IsTrue (Matches (data, number < "2")); Assert.IsFalse (Matches (data, number < "1")); } class ListArrayItemData : DummyObject { [XmlArrayItem] public List Number { get; set; } } [Test] public void ListArrayItems () { var data = new ListArrayItemData { Number = new List { 1, 2, 3 } }; Assert.IsTrue (Matches (data, number <= "4")); Assert.IsTrue (Matches (data, number <= "3")); Assert.IsTrue (Matches (data, number <= "2")); Assert.IsTrue (Matches (data, number <= "1")); Assert.IsFalse (Matches (data, number <= "0")); } class AttributeData : DummyObject { [XmlAttribute] public string Text { get; set; } [XmlAttribute] public int Number { get; set; } [XmlAttribute] public int? NullableNumber { get; set; } } [Test] public void Attributes () { var data = new AttributeData { Text = "foo", Number = 42, NullableNumber = 13 }; Assert.IsTrue (Matches (data, text_attribute == "foo")); Assert.IsTrue (Matches (data, number_attribute == "42")); Assert.IsTrue (Matches (data, nullable_number_attribute == "13")); Assert.IsFalse (Matches (data, text_attribute.Contains ("bar"))); Assert.IsFalse (Matches (data, number_attribute < "42")); Assert.IsFalse (Matches (data, nullable_number_attribute >= "14")); } class OmitIfNullAttributeData : DummyObject { [XmlAttribute (OmitIfNull = true)] public string Text { get; set; } [XmlAttribute] public int Number { get; set; } [XmlAttribute (OmitIfNull = true)] public int? NullableNumber { get; set; } } [Test] public void AttributeExists () { var data = new OmitIfNullAttributeData { Text = "foo", Number = 42, NullableNumber = 13 }; Assert.IsTrue (Matches (data, text_attribute.Exists (true))); Assert.IsFalse (Matches (data, text_attribute.Exists (false))); Assert.IsTrue (Matches (data, number_attribute.Exists (true))); Assert.IsFalse (Matches (data, number_attribute.Exists (false))); Assert.IsTrue (Matches (data, nullable_number_attribute.Exists (true))); Assert.IsFalse (Matches (data, nullable_number_attribute.Exists (false))); data = new OmitIfNullAttributeData (); Assert.IsFalse (Matches (data, text_attribute.Exists (true))); Assert.IsTrue (Matches (data, text_attribute.Exists (false))); Assert.IsTrue (Matches (data, number_attribute.Exists (true))); Assert.IsFalse (Matches (data, number_attribute.Exists (false))); Assert.IsFalse (Matches (data, nullable_number_attribute.Exists (true))); Assert.IsTrue (Matches (data, nullable_number_attribute.Exists (false))); Assert.IsFalse (Matches (data, text.Exists (true))); Assert.IsTrue (Matches (data, text.Exists (false))); } class NestedAttributeData : DummyObject { [XmlElement] public AttributeData Data { get; set; } } [Test] public void NestedAttributes () { var data = new NestedAttributeData { Data = new AttributeData { Text = "foo", Number = 42, NullableNumber = 13 } }; Assert.IsTrue (Matches (data, nested_text_attribute == "foo")); Assert.IsTrue (Matches (data, nested_number_attribute == "42")); Assert.IsTrue (Matches (data, nested_nullable_number_attribute == "13")); Assert.IsFalse (Matches (data, nested_text_attribute.Exists (false))); Assert.IsFalse (Matches (data, nested_number_attribute > "42")); Assert.IsFalse (Matches (data, nested_nullable_number_attribute != "13")); } static bool Matches (Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.Object @object, Action query) { var match = false; query (new ObjectQueryVisitor (new ObjectQueryContext (@object.GetType ()), @object, result => { if (match) { Assert.Fail ("Multiple matches for a single input."); } match = true; })); return match; } } } mono-upnp-0.1.2/tests/Mono.Upnp.Dcp.MediaServer1.Tests/ObjectTests.cs0000664000175000017500000011104711707010776026601 0ustar00lorentzlorentz00000000000000// // ObjectTests.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using NUnit.Framework; using Mono.Upnp.Dcp.MediaServer1.ConnectionManager1; using Mono.Upnp.Dcp.MediaServer1.ContentDirectory1; using Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV; namespace Mono.Upnp.Dcp.MediaServer1.Tests { [TestFixture] public class ObjectTests { [Test] public void ResourceInstantiation () { var options = new ResourceOptions (); SetResourceOptions (options); var resource = new Resource (new Uri ("http://0"), options); AssertResource (resource, options); AssertResource (resource, resource.GetOptions ()); } static void SetResourceOptions (ResourceOptions options) { options.Size = 0; options.Duration = new TimeSpan (0, 0, 1); options.BitRate = 2; options.SampleFrequency = 3; options.BitsPerSample = 4; options.NrAudioChannels = 5; options.Resolution = new Resolution (6, 7); options.ColorDepth = 8; options.ProtocolInfo = new ProtocolInfo ("foo"); options.Protection = "9"; options.ImportUri = new Uri ("http://10"); } static void AssertResource (Resource resource, ResourceOptions options) { Assert.AreEqual (resource.Size, options.Size); Assert.AreEqual (resource.Duration, options.Duration); Assert.AreEqual (resource.BitRate, options.BitRate); Assert.AreEqual (resource.SampleFrequency, options.SampleFrequency); Assert.AreEqual (resource.BitsPerSample, options.BitsPerSample); Assert.AreEqual (resource.NrAudioChannels, options.NrAudioChannels); Assert.AreEqual (resource.Resolution, options.Resolution); Assert.AreEqual (resource.ColorDepth, options.ColorDepth); Assert.AreEqual (resource.ProtocolInfo, options.ProtocolInfo); Assert.AreEqual (resource.Protection, options.Protection); Assert.AreEqual (resource.ImportUri, options.ImportUri); } [Test] public void ObjectInstantiation () { var options = new ObjectOptions (); SetObjectOptions (options); var @object = new Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.Object ("-1", "-1", options); Assert.AreEqual ("-1", @object.Id); AssertObject (@object, options); AssertObject (@object, @object.GetOptions ()); } static void SetObjectOptions (ObjectOptions options) { options.Title = "1"; options.Creator = "2"; options.WriteStatus = WriteStatus.Protected; options.IsRestricted = true; var resource_options = new ResourceOptions (); SetResourceOptions (resource_options); options.Resources = new[] { new Resource (new Uri ("http://0"), resource_options) }; } static void AssertObject (Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.Object @object, ObjectOptions options) { Assert.AreEqual (@object.Title, options.Title); Assert.AreEqual (@object.Creator, options.Creator); Assert.AreEqual (@object.WriteStatus, options.WriteStatus); Assert.AreEqual (@object.IsRestricted, options.IsRestricted); Assert.IsTrue (@object.Resources.IsReadOnly); var object_enumerator = @object.Resources.GetEnumerator (); var options_enumerator = options.Resources.GetEnumerator (); Assert.IsTrue (object_enumerator.MoveNext ()); Assert.IsTrue (options_enumerator.MoveNext ()); AssertResource (object_enumerator.Current, options_enumerator.Current.GetOptions ()); } [Test] public void ItemInstantiation () { var options = new ItemOptions (); SetItemOptions (options); var item = new Item ("-1", "-1", options); AssertItem (item, options); AssertItem (item, item.GetOptions ()); } static void SetItemOptions (ItemOptions options) { SetObjectOptions (options); options.Title = "3"; options.RefId = "4"; } static void AssertItem (Item item, ItemOptions options) { AssertObject (item, options); Assert.AreEqual (item.RefId, options.RefId); } [Test] public void ContainerInstantiation () { var options = new ContainerOptions (); SetContainerOptions (options); var container = new Container ("-1", "-1", options); AssertContainer (container, options); AssertContainer (container, container.GetOptions ()); } static void SetContainerOptions (ContainerOptions options) { SetObjectOptions (options); options.Title = "5"; options.ChildCount = 6; options.IsSearchable = true; options.SearchClasses = new[] { new ClassReference (false, "foo") }; options.CreateClasses = new[] { new ClassReference (false, "bar") }; } static void AssertContainer (Container container, ContainerOptions options) { AssertObject (container, options); Assert.AreEqual (container.ChildCount, options.ChildCount); Assert.AreEqual (container.IsSearchable, options.IsSearchable); Assert.IsTrue (container.SearchClasses.IsReadOnly); Assert.IsTrue (container.CreateClasses.IsReadOnly); CollectionAssert.AreEqual (container.SearchClasses, options.SearchClasses); CollectionAssert.AreEqual (container.CreateClasses, options.CreateClasses); } [Test] public void AlbumInstantiation () { var options = new AlbumOptions (); SetAlbumOptions (options); var album = new Album ("-1", "-1", options); AssertAlbum (album, options); AssertAlbum (album, album.GetOptions ()); } static void SetAlbumOptions (AlbumOptions options) { SetContainerOptions (options); options.StorageMedium = "7"; options.LongDescription = "8"; options.Description = "9"; options.Date = "10"; options.Publishers = new[] { "publisher" }; options.Contributors = new[] { "contributor" }; options.Relations = new[] { new Uri ("http://relation") }; options.Rights = new[] { "right" }; } static void AssertAlbum (Album album, AlbumOptions options) { AssertContainer (album, options); Assert.AreEqual (album.StorageMedium, options.StorageMedium); Assert.AreEqual (album.LongDescription, options.LongDescription); Assert.AreEqual (album.Description, options.Description); Assert.AreEqual (album.Date, options.Date); Assert.IsTrue (album.Publishers.IsReadOnly); Assert.IsTrue (album.Contributors.IsReadOnly); Assert.IsTrue (album.Relations.IsReadOnly); Assert.IsTrue (album.Rights.IsReadOnly); CollectionAssert.AreEqual (album.Publishers, options.Publishers); CollectionAssert.AreEqual (album.Contributors, options.Contributors); CollectionAssert.AreEqual (album.Relations, options.Relations); CollectionAssert.AreEqual (album.Rights, options.Rights); } [Test] public void AudioBookInstantiation () { var options = new AudioBookOptions (); SetAudioBookOptions (options); var audio_book = new AudioBook ("-1", "-1", options); AssertAudioBook (audio_book, options); AssertAudioBook (audio_book, audio_book.GetOptions ()); } static void SetAudioBookOptions (AudioBookOptions options) { SetAudioItemOptions (options); options.StorageMedium = "13"; options.Date = "14"; options.Producers = new[] { "producer" }; options.Contributors = new[] { "contributor" }; } static void AssertAudioBook (AudioBook audioBook, AudioBookOptions options) { AssertAudioItem (audioBook, options); Assert.AreEqual (audioBook.StorageMedium, options.StorageMedium); Assert.AreEqual (audioBook.Date, options.Date); Assert.IsTrue (audioBook.Producers.IsReadOnly); Assert.IsTrue (audioBook.Contributors.IsReadOnly); CollectionAssert.AreEqual (audioBook.Producers, options.Producers); CollectionAssert.AreEqual (audioBook.Contributors, options.Contributors); } [Test] public void AudioBroadcastInstantiation () { var options = new AudioBroadcastOptions (); SetAudioBroadcastOptions (options); var audio_broadcast = new AudioBroadcast ("-1", "-1", options); AssertAudioBroadcast (audio_broadcast, options); AssertAudioBroadcast (audio_broadcast, audio_broadcast.GetOptions ()); } static void SetAudioBroadcastOptions (AudioBroadcastOptions options) { SetAudioItemOptions (options); options.Region = "15"; options.RadioCallSign = "16"; options.RadioStationId = "17"; options.RadioBand = "18"; options.ChannelNr = 19; } static void AssertAudioBroadcast (AudioBroadcast audioBroadcast, AudioBroadcastOptions options) { AssertAudioItem (audioBroadcast, options); Assert.AreEqual (audioBroadcast.Region, options.Region); Assert.AreEqual (audioBroadcast.RadioCallSign, options.RadioCallSign); Assert.AreEqual (audioBroadcast.RadioStationId, options.RadioStationId); Assert.AreEqual (audioBroadcast.RadioBand, options.RadioBand); Assert.AreEqual (audioBroadcast.ChannelNr, options.ChannelNr); } [Test] public void AudioItemInstantiation () { var options = new AudioItemOptions (); SetAudioItemOptions (options); var audio_item = new AudioItem ("-1", "-1", options); AssertAudioItem (audio_item, options); AssertAudioItem (audio_item, audio_item.GetOptions ()); } static void SetAudioItemOptions (AudioItemOptions options) { SetItemOptions (options); options.Description = "20"; options.LongDescription = "21"; options.Language = "22"; options.Genres = new[] { "genre" }; options.Publishers = new[] { "publisher" }; options.Relations = new[] { new Uri ("http://relation") }; options.Rights = new[] { "right" }; } static void AssertAudioItem (AudioItem audioItem, AudioItemOptions options) { AssertItem (audioItem, options); Assert.AreEqual (audioItem.Description, options.Description); Assert.AreEqual (audioItem.LongDescription, options.LongDescription); Assert.AreEqual (audioItem.Language, options.Language); Assert.IsTrue (audioItem.Genres.IsReadOnly); Assert.IsTrue (audioItem.Publishers.IsReadOnly); Assert.IsTrue (audioItem.Relations.IsReadOnly); Assert.IsTrue (audioItem.Rights.IsReadOnly); CollectionAssert.AreEqual (audioItem.Genres, options.Genres); CollectionAssert.AreEqual (audioItem.Publishers, options.Publishers); CollectionAssert.AreEqual (audioItem.Relations, options.Relations); CollectionAssert.AreEqual (audioItem.Rights, options.Rights); } [Test] public void GenreInstantiation () { var options = new GenreOptions (); SetGenreOptions (options); var genre = new Genre ("-1", "-1", options); AssertGenre (genre, options); AssertGenre (genre, genre.GetOptions ()); } static void SetGenreOptions (GenreOptions options) { SetContainerOptions (options); options.LongDescription = "23"; options.Description = "24"; } static void AssertGenre (Genre genre, GenreOptions options) { AssertContainer (genre, options); Assert.AreEqual (genre.LongDescription, options.LongDescription); Assert.AreEqual (genre.Description, options.Description); } [Test] public void ImageItemInstantiation () { var options = new ImageItemOptions (); SetImageItemOptions (options); var image_item = new ImageItem ("-1", "-1", options); AssertImageItem (image_item, options); AssertImageItem (image_item, image_item.GetOptions ()); } static void SetImageItemOptions (ImageItemOptions options) { SetItemOptions (options); options.LongDescription = "25"; options.Description = "26"; options.StorageMedium = "27"; options.Rating = "28"; options.Date = "29"; options.Publishers = new[] { "publisher" }; options.Rights = new[] { "right" }; } static void AssertImageItem (ImageItem imageItem, ImageItemOptions options) { AssertItem (imageItem, options); Assert.AreEqual (imageItem.LongDescription, options.LongDescription); Assert.AreEqual (imageItem.Description, options.Description); Assert.AreEqual (imageItem.StorageMedium, options.StorageMedium); Assert.AreEqual (imageItem.Rating, options.Rating); Assert.AreEqual (imageItem.Date, options.Date); Assert.IsTrue (imageItem.Publishers.IsReadOnly); Assert.IsTrue (imageItem.Rights.IsReadOnly); CollectionAssert.AreEqual (imageItem.Publishers, options.Publishers); CollectionAssert.AreEqual (imageItem.Rights, options.Rights); } [Test] public void MovieInstantiation () { var options = new MovieOptions (); SetMovieOptions (options); var movie = new Movie ("-1", "-1", options); AssertMovie (movie, options); AssertMovie (movie, movie.GetOptions ()); } static void SetMovieOptions (MovieOptions options) { SetVideoItemOptions (options); options.StorageMedium = "30"; options.DvdRegionCode = 31; options.ChannelName = "32"; options.ScheduledStartTimes = new[] { DateTime.Now }; options.ScheduledEndTimes = new[] { DateTime.Now + new TimeSpan (0, 0, 10) }; } static void AssertMovie (Movie movie, MovieOptions options) { AssertVideoItem (movie, options); Assert.AreEqual (movie.StorageMedium, options.StorageMedium); Assert.AreEqual (movie.DvdRegionCode, options.DvdRegionCode); Assert.AreEqual (movie.ChannelName, options.ChannelName); Assert.IsTrue (movie.ScheduledStartTimes.IsReadOnly); Assert.IsTrue (movie.ScheduledEndTimes.IsReadOnly); CollectionAssert.AreEqual (movie.ScheduledStartTimes, options.ScheduledStartTimes); CollectionAssert.AreEqual (movie.ScheduledEndTimes, options.ScheduledEndTimes); } [Test] public void MusicAlbumInstantiation () { var options = new MusicAlbumOptions (); SetMusicAlbumOptions (options); var music_album = new MusicAlbum ("-1", "-1", options); AssertMusicAlbum (music_album, options); AssertMusicAlbum (music_album, music_album.GetOptions ()); } static void SetMusicAlbumOptions (MusicAlbumOptions options) { SetAlbumOptions (options); options.Toc = "33"; options.Artists = new[] { new PersonWithRole ("artist", "role") }; options.Genres = new[] { "genre" }; options.Producers = new[] { "genres" }; options.AlbumArtUris = new[] { new Uri ("http://albumart") }; } static void AssertMusicAlbum (MusicAlbum musicAlbum, MusicAlbumOptions options) { AssertAlbum (musicAlbum, options); Assert.AreEqual (musicAlbum.Toc, options.Toc); Assert.IsTrue (musicAlbum.Artists.IsReadOnly); Assert.IsTrue (musicAlbum.Genres.IsReadOnly); Assert.IsTrue (musicAlbum.Producers.IsReadOnly); Assert.IsTrue (musicAlbum.AlbumArtUris.IsReadOnly); CollectionAssert.AreEqual (musicAlbum.Artists, options.Artists); CollectionAssert.AreEqual (musicAlbum.Genres, options.Genres); CollectionAssert.AreEqual (musicAlbum.Producers, options.Producers); CollectionAssert.AreEqual (musicAlbum.AlbumArtUris, options.AlbumArtUris); } [Test] public void MusicArtistInstantiation () { var options = new MusicArtistOptions (); SetMusicArtistOptions (options); var music_artist = new MusicArtist ("-1", "-1", options); AssertMusicArtist (music_artist, options); AssertMusicArtist (music_artist, music_artist.GetOptions ()); } static void SetMusicArtistOptions (MusicArtistOptions options) { SetPersonOptions (options); options.ArtistDiscographyUri = new Uri ("http://34"); } static void AssertMusicArtist (MusicArtist musicArtist, MusicArtistOptions options) { AssertPerson (musicArtist, options); } [Test] public void MusicTrackInstantiation () { var options = new MusicTrackOptions (); SetMusicTrackOptions (options); var music_track = new MusicTrack ("-1", "-1", options); AssertMusicTrack (music_track, options); AssertMusicTrack (music_track, music_track.GetOptions ()); } static void SetMusicTrackOptions (MusicTrackOptions options) { SetAudioItemOptions (options); options.AlbumArtUri = new Uri ("http://35"); options.OriginalTrackNumber = 36; options.StorageMedium = "37"; options.Date = "38"; options.Artists = new[] { new PersonWithRole ("artist", "role") }; options.Albums = new[] { "album" }; options.Playlists = new[] { "playlist" }; options.Contributors = new[] { "contributor" }; } static void AssertMusicTrack (MusicTrack musicTrack, MusicTrackOptions options) { AssertAudioItem (musicTrack, options); Assert.AreEqual (musicTrack.AlbumArtUri, options.AlbumArtUri); Assert.AreEqual (musicTrack.OriginalTrackNumber, options.OriginalTrackNumber); Assert.AreEqual (musicTrack.StorageMedium, options.StorageMedium); Assert.AreEqual (musicTrack.Date, options.Date); Assert.IsTrue (musicTrack.Artists.IsReadOnly); Assert.IsTrue (musicTrack.Albums.IsReadOnly); Assert.IsTrue (musicTrack.Playlists.IsReadOnly); Assert.IsTrue (musicTrack.Contributors.IsReadOnly); CollectionAssert.AreEqual (musicTrack.Artists, options.Artists); CollectionAssert.AreEqual (musicTrack.Albums, options.Albums); CollectionAssert.AreEqual (musicTrack.Playlists, options.Playlists); CollectionAssert.AreEqual (musicTrack.Contributors, options.Contributors); } [Test] public void MusicVideoClipInstantiation () { var options = new MusicVideoClipOptions (); SetMusicVideoClipOptions (options); var music_video_clip = new MusicVideoClip ("-1", "-1", options); AssertMusicVideoClip (music_video_clip, options); AssertMusicVideoClip (music_video_clip, music_video_clip.GetOptions ()); } static void SetMusicVideoClipOptions (MusicVideoClipOptions options) { SetVideoItemOptions (options); options.StorageMedium = "39"; options.Date = "40"; options.Artists = new[] { new PersonWithRole ("artist", "role") }; options.Albums = new[] { "album" }; options.ScheduledStartTimes = new[] { DateTime.Now }; options.ScheduledEndTimes = new[] { DateTime.Now + new TimeSpan (0, 0, 10) }; options.Contributors = new[] { "contributor" }; } static void AssertMusicVideoClip (MusicVideoClip musicVideoClip, MusicVideoClipOptions options) { AssertVideoItem (musicVideoClip, options); Assert.AreEqual (musicVideoClip.StorageMedium, options.StorageMedium); Assert.AreEqual (musicVideoClip.Date, options.Date); Assert.IsTrue (musicVideoClip.Artists.IsReadOnly); Assert.IsTrue (musicVideoClip.Albums.IsReadOnly); Assert.IsTrue (musicVideoClip.ScheduledStartTimes.IsReadOnly); Assert.IsTrue (musicVideoClip.ScheduledEndTimes.IsReadOnly); Assert.IsTrue (musicVideoClip.Contributors.IsReadOnly); CollectionAssert.AreEqual (musicVideoClip.Artists, options.Artists); CollectionAssert.AreEqual (musicVideoClip.Albums, options.Albums); CollectionAssert.AreEqual (musicVideoClip.ScheduledStartTimes, options.ScheduledStartTimes); CollectionAssert.AreEqual (musicVideoClip.ScheduledEndTimes, options.ScheduledEndTimes); CollectionAssert.AreEqual (musicVideoClip.Contributors, options.Contributors); } [Test] public void PersonInstantiation () { var options = new PersonOptions (); SetPersonOptions (options); var person = new Person ("-1", "-1", options); AssertPerson (person, options); AssertPerson (person, person.GetOptions ()); } static void SetPersonOptions (PersonOptions options) { SetContainerOptions (options); options.Language = "41"; } static void AssertPerson (Person person, PersonOptions options) { AssertContainer (person, options); Assert.AreEqual (person.Language, options.Language); } [Test] public void PhotoInstantiation () { var options = new PhotoOptions (); SetPhotoOptions (options); var photo = new Photo ("-1", "-1", options); AssertPhoto (photo, options); AssertPhoto (photo, photo.GetOptions ()); } static void SetPhotoOptions (PhotoOptions options) { SetImageItemOptions (options); options.Albums = new[] { "album" }; } static void AssertPhoto (Photo photo, PhotoOptions options) { AssertImageItem (photo, options); Assert.IsTrue (photo.Albums.IsReadOnly); CollectionAssert.AreEqual (photo.Albums, options.Albums); } [Test] public void PlaylistContainerInstantiation () { var options = new PlaylistContainerOptions (); SetPlaylistContainerOptions (options); var playlist_container = new PlaylistContainer ("-1", "-1", options); AssertPlaylistContainer (playlist_container, options); AssertPlaylistContainer (playlist_container, playlist_container.GetOptions ()); } static void SetPlaylistContainerOptions (PlaylistContainerOptions options) { SetContainerOptions (options); options.StorageMedium = "42"; options.LongDescription = "43"; options.Description = "44"; options.Date = "45"; options.Language = "46"; options.Artists = new[] { new PersonWithRole ("artist", "role") }; options.Genres = new[] { "genre" }; options.Contributors = new[] { "contributor" }; options.Rights = new[] { "right" }; } static void AssertPlaylistContainer (PlaylistContainer playlistContainer, PlaylistContainerOptions options) { AssertContainer (playlistContainer, options); Assert.AreEqual (playlistContainer.StorageMedium, options.StorageMedium); Assert.AreEqual (playlistContainer.LongDescription, options.LongDescription); Assert.AreEqual (playlistContainer.Description, options.Description); Assert.AreEqual (playlistContainer.Date, options.Date); Assert.AreEqual (playlistContainer.Language, options.Language); Assert.IsTrue (playlistContainer.Artists.IsReadOnly); Assert.IsTrue (playlistContainer.Genres.IsReadOnly); Assert.IsTrue (playlistContainer.Contributors.IsReadOnly); Assert.IsTrue (playlistContainer.Rights.IsReadOnly); CollectionAssert.AreEqual (playlistContainer.Artists, options.Artists); CollectionAssert.AreEqual (playlistContainer.Genres, options.Genres); CollectionAssert.AreEqual (playlistContainer.Contributors, options.Contributors); CollectionAssert.AreEqual (playlistContainer.Rights, options.Rights); } [Test] public void PlaylistItemInstantiation () { var options = new PlaylistItemOptions (); SetPlaylistItemOptions (options); var playlist_item = new PlaylistItem ("-1", "-1", options); AssertPlaylistItem (playlist_item, options); AssertPlaylistItem (playlist_item, playlist_item.GetOptions ()); } static void SetPlaylistItemOptions (PlaylistItemOptions options) { SetItemOptions (options); options.StorageMedium = "47"; options.LongDescription = "48"; options.Description = "49"; options.Date = "50"; options.Language = "51"; options.Artists = new[] { new PersonWithRole ("artist", "role") }; options.Genres = new[] { "genre" }; } static void AssertPlaylistItem (PlaylistItem playlistItem, PlaylistItemOptions options) { AssertItem (playlistItem, options); Assert.AreEqual (playlistItem.StorageMedium, options.StorageMedium); Assert.AreEqual (playlistItem.LongDescription, options.LongDescription); Assert.AreEqual (playlistItem.Description, options.Description); Assert.AreEqual (playlistItem.Date, options.Date); Assert.AreEqual (playlistItem.Language, options.Language); Assert.IsTrue (playlistItem.Artists.IsReadOnly); Assert.IsTrue (playlistItem.Genres.IsReadOnly); CollectionAssert.AreEqual (playlistItem.Artists, options.Artists); CollectionAssert.AreEqual (playlistItem.Genres, options.Genres); } [Test] public void StorageFolderInstantiation () { var options = new StorageFolderOptions (); SetStorageFolderOptions (options); var storage_folder = new StorageFolder ("-1", "-1", options); AssertStorageFolder (storage_folder, options); AssertStorageFolder (storage_folder, storage_folder.GetOptions ()); } static void SetStorageFolderOptions (StorageFolderOptions options) { SetContainerOptions (options); options.StorageUsed = 52; } static void AssertStorageFolder (StorageFolder storageFolder, StorageFolderOptions options) { AssertContainer (storageFolder, options); Assert.AreEqual (storageFolder.StorageUsed, options.StorageUsed); } [Test] public void StorageSystemInstantiation () { var options = new StorageSystemOptions (); SetStorageSystemOptions (options); var storage_system = new StorageSystem ("-1", "-1", options); AssertStorageSystem (storage_system, options); AssertStorageSystem (storage_system, storage_system.GetOptions ()); } static void SetStorageSystemOptions (StorageSystemOptions options) { SetStorageVolumeOptions (options); options.StorageMaxPartition = 53; } static void AssertStorageSystem (StorageSystem storageSystem, StorageSystemOptions options) { AssertContainer (storageSystem, options); Assert.AreEqual (storageSystem.StorageUsed, options.StorageUsed); Assert.AreEqual (storageSystem.StorageTotal, options.StorageTotal); Assert.AreEqual (storageSystem.StorageFree, options.StorageFree); Assert.AreEqual (storageSystem.StorageMedium, options.StorageMedium); Assert.AreEqual (storageSystem.StorageMaxPartition, options.StorageMaxPartition); } [Test] public void StorageVolumeInstantiation () { var options = new StorageVolumeOptions (); SetStorageVolumeOptions (options); var storage_volume = new StorageVolume ("-1", "-1", options); AssertStorageVolume (storage_volume, options); AssertStorageVolume (storage_volume, storage_volume.GetOptions ()); } static void SetStorageVolumeOptions (StorageVolumeOptions options) { SetStorageFolderOptions (options); options.StorageTotal = 54; options.StorageFree = 55; options.StorageMedium = "56"; } static void AssertStorageVolume (StorageVolume storageVolume, StorageVolumeOptions options) { AssertContainer (storageVolume, options); Assert.AreEqual (storageVolume.StorageUsed, options.StorageUsed); Assert.AreEqual (storageVolume.StorageTotal, options.StorageTotal); Assert.AreEqual (storageVolume.StorageFree, options.StorageFree); Assert.AreEqual (storageVolume.StorageMedium, options.StorageMedium); } [Test] public void TextItemInstantiation () { var options = new TextItemOptions (); SetTextItemOptions (options); var text_item = new TextItem ("-1", "-1", options); AssertTextItem (text_item, options); AssertTextItem (text_item, text_item.GetOptions ()); } static void SetTextItemOptions (TextItemOptions options) { SetItemOptions (options); options.Protection = "57"; options.LongDescription = "58"; options.StorageMedium = "59"; options.Description = "60"; options.Rating = "61"; options.Date = "62"; options.Language = "63"; options.Authors = new[] { new PersonWithRole ("artist", "role") }; options.Publishers = new[] { "publisher" }; options.Contributors = new[] { "contributor" }; options.Relations = new[] { new Uri ("http://relation") }; options.Rights = new[] { "right" }; } static void AssertTextItem (TextItem textItem, TextItemOptions options) { AssertItem (textItem, options); Assert.AreEqual (textItem.Protection, options.Protection); Assert.AreEqual (textItem.LongDescription, options.LongDescription); Assert.AreEqual (textItem.Description, options.Description); Assert.AreEqual (textItem.Rating, options.Rating); Assert.AreEqual (textItem.Date, options.Date); Assert.AreEqual (textItem.Language, options.Language); Assert.IsTrue (textItem.Authors.IsReadOnly); Assert.IsTrue (textItem.Publishers.IsReadOnly); Assert.IsTrue (textItem.Contributors.IsReadOnly); Assert.IsTrue (textItem.Relations.IsReadOnly); Assert.IsTrue (textItem.Rights.IsReadOnly); CollectionAssert.AreEqual (textItem.Authors, options.Authors); CollectionAssert.AreEqual (textItem.Publishers, options.Publishers); CollectionAssert.AreEqual (textItem.Contributors, options.Contributors); CollectionAssert.AreEqual (textItem.Relations, options.Relations); CollectionAssert.AreEqual (textItem.Rights, options.Rights); } [Test] public void VideoBroadcastInstantiation () { var options = new VideoBroadcastOptions (); SetVideoBroadcastOptions (options); var video_broadcast = new VideoBroadcast ("-1", "-1", options); AssertVideoBroadcast (video_broadcast, options); AssertVideoBroadcast (video_broadcast, video_broadcast.GetOptions ()); } static void SetVideoBroadcastOptions (VideoBroadcastOptions options) { SetVideoItemOptions (options); options.Icon = new Uri ("http://64"); options.Region = "65"; options.ChannelNr = 66; } static void AssertVideoBroadcast (VideoBroadcast videoBroadcast, VideoBroadcastOptions options) { AssertVideoItem (videoBroadcast, options); Assert.AreEqual (videoBroadcast.Icon, options.Icon); Assert.AreEqual (videoBroadcast.Region, options.Region); Assert.AreEqual (videoBroadcast.ChannelNr, options.ChannelNr); } [Test] public void VideoItemInstantiation () { var options = new VideoItemOptions (); SetVideoItemOptions (options); var video_item = new VideoItem ("-1", "-1", options); AssertVideoItem (video_item, options); AssertVideoItem (video_item, video_item.GetOptions ()); } static void SetVideoItemOptions (VideoItemOptions options) { SetItemOptions (options); options.LongDescription = "67"; options.Description = "68"; options.Rating = "69"; options.Language = "70"; options.Genres = new[] { "genre" }; options.Producers = new[] { "producer" }; options.Actors = new[] { new PersonWithRole ("artist", "role") }; options.Directors = new[] { "director" }; options.Publishers = new[] { "publisher" }; options.Relations = new[] { new Uri ("http://relation") }; } static void AssertVideoItem (VideoItem videoItem, VideoItemOptions options) { AssertItem (videoItem, options); Assert.AreEqual (videoItem.LongDescription, options.LongDescription); Assert.AreEqual (videoItem.Description, options.Description); Assert.AreEqual (videoItem.Rating, options.Rating); Assert.AreEqual (videoItem.Language, options.Language); Assert.IsTrue (videoItem.Genres.IsReadOnly); Assert.IsTrue (videoItem.Producers.IsReadOnly); Assert.IsTrue (videoItem.Actors.IsReadOnly); Assert.IsTrue (videoItem.Directors.IsReadOnly); Assert.IsTrue (videoItem.Publishers.IsReadOnly); Assert.IsTrue (videoItem.Relations.IsReadOnly); CollectionAssert.AreEqual (videoItem.Genres, options.Genres); CollectionAssert.AreEqual (videoItem.Producers, options.Producers); CollectionAssert.AreEqual (videoItem.Actors, options.Actors); CollectionAssert.AreEqual (videoItem.Directors, options.Directors); CollectionAssert.AreEqual (videoItem.Publishers, options.Publishers); CollectionAssert.AreEqual (videoItem.Relations, options.Relations); } } } mono-upnp-0.1.2/tests/Mono.Upnp.Dcp.MediaServer1.Tests/VirtualXmlSerializerTests.cs0000664000175000017500000001621711707010776031537 0ustar00lorentzlorentz00000000000000// // VirtualXmlSerializerTests.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using NUnit.Framework; using Mono.Upnp.Dcp.MediaServer1.Xml; using Mono.Upnp.Xml; namespace Mono.Upnp.Dcp.MediaServer1.Tests { [TestFixture] public class VirtualXmlSerializerTests { XmlSerializer xml_serializer = new XmlSerializer ( (serializer, type) => new VirtualDelegateSerializationCompiler (serializer, type)); [XmlType ("element")] class Element { [XmlElement ("foo")] public T Foo { get; set; } } [Test] public void Element () { var data = new Element { Foo = "bar" }; AssertAreEqual ("foo", data, new Override ("foo", "foo")); } [Test] public void ElementWithoutMatchingOverrides () { var data = new Element { Foo = "bar" }; AssertAreEqual ("bar", data, new Override ("bat", "bat"), new Override ("baz", "baz")); } [Test] public void ElementWithMatchingAndNonMatchingOverrides () { var data = new Element { Foo = "bar" }; AssertAreEqual ("foo", data, new Override ("bat", "bat"), new Override ("foo", "foo")); } [Test] public void UnmatchingNamespacedElement () { var data = new Element { Foo = "bar" }; AssertAreEqual ("bar", data, new Override ("foo", "foo", "http://test")); } class ElementOverride : IXmlSerializable { Element element; public ElementOverride (Element element) { this.element = element; } public void Serialize (XmlSerializationContext context) { context.AutoSerializeObjectStart (element); SerializeMembers (context); context.AutoSerializeObjectEnd (element); } public void SerializeMembers (XmlSerializationContext context) { context.AutoSerializeMembers (element, new VirtualContext (new Override ("bat", "foo"))); } } [Test] public void ElementOverride () { var element_override = new ElementOverride (new Element { Foo = "foo" }); AssertAreEqual ("bat", element_override); } [XmlType ("element")] class ElementOmitIfNull { [XmlElement ("foo", OmitIfNull = true)] public string Foo { get; set; } } [Test] public void OverrideElementWithNull () { var element = new ElementOmitIfNull { Foo = "bar" }; AssertAreEqual ("", element, new Override (null, "foo")); } [Test] public void OverrideElementWithNonNull () { var element = new ElementOmitIfNull (); AssertAreEqual ("bar", element, new Override ("bar", "foo")); } [Test] public void IntElement () { var element = new Element { Foo = 42 }; AssertAreEqual ("13", element, new Override (13, "foo")); } [XmlType ("element")] class NamespacedElement { [XmlElement ("foo", "http://test")] public T Foo { get; set; } } [Test] public void NamespacedElement () { var element = new NamespacedElement { Foo = "bar" }; AssertAreEqual (@"foo", element, new Override ("foo", "foo", "http://test")); } [Test] public void UnmatchingUnnamespacedElement () { var element = new NamespacedElement { Foo = "bar" }; AssertAreEqual (@"bar", element, new Override ("foo", "foo")); } [XmlType ("attribute")] class Attribute { [XmlAttribute ("foo")] public T Foo { get; set; } } [Test] public void Attribute () { var attribute = new Attribute { Foo = "bar" }; AssertAreEqual (@"", attribute, new Override ("foo", "foo")); } [Test] public void UnmatchingNamespacedAttribute () { var attribute = new Attribute { Foo = "bar" }; AssertAreEqual (@"", attribute, new Override ("foo", "foo", "http://test")); } [XmlType ("attribute")] class NamespacedAttribute { [XmlAttribute ("foo", "http://test", "t")] public T Foo { get; set; } } [Test] public void NamespacedAttribute () { var attribute = new NamespacedAttribute { Foo = "bar" }; AssertAreEqual (@"", attribute, new Override ("foo", "foo", "http://test")); } [Test] public void UnmatchingWronglyNamespacedAttribute () { var attribute = new NamespacedAttribute { Foo = "bar" }; AssertAreEqual (@"", attribute, new Override ("foo", "foo", "http://fail")); } void AssertAreEqual (string xml, T obj, params Override[] overrides) { Assert.AreEqual (xml, xml_serializer.GetString (obj, new XmlSerializationOptions { Context = new VirtualContext (overrides), XmlDeclarationType = XmlDeclarationType.None })); } } } mono-upnp-0.1.2/tests/Mono.Upnp.Dcp.MediaServer1.Tests/ObjectSerializationTests.cs0000664000175000017500000000427611707010776031344 0ustar00lorentzlorentz00000000000000// // ObjectSerializationTests.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using NUnit.Framework; using Mono.Upnp.Dcp.MediaServer1.ConnectionManager1; using Mono.Upnp.Dcp.MediaServer1.ContentDirectory1; using Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV; using Mono.Upnp.Xml; namespace Mono.Upnp.Dcp.MediaServer1.Tests { [TestFixture] public class ObjectSerializationTests { XmlSerializer serializer = new XmlSerializer (); [Test] public void MusicTrackSerialization () { var music_track = new MusicTrack ("0", "-1", new MusicTrackOptions { Title = "Foo", Artists = new[] { new PersonWithRole ("Fooer", "performer") }, Albums = new[] { "Footown" }, OriginalTrackNumber = 1, Genres = new[] { "Fooish" }, Resources = new[] { new Resource (new Uri ("http://foo/"), new ResourceOptions { Size = 42 })} }); serializer.GetString (music_track); } } } mono-upnp-0.1.2/tests/Mono.Upnp.Dcp.MediaServer1.Tests/Consumer.cs0000664000175000017500000000242111707010776026136 0ustar00lorentzlorentz00000000000000// // Consumer.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. namespace Mono.Upnp.Dcp.MediaServer1.Tests { public delegate void Consumer (T value); } mono-upnp-0.1.2/tests/Mono.Upnp.Dcp.MediaServer1.Tests/QueryTests.cs0000664000175000017500000000332211707010776026474 0ustar00lorentzlorentz00000000000000// // QueryTests.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using Mono.Upnp.Dcp.MediaServer1.ContentDirectory1; namespace Mono.Upnp.Dcp.MediaServer1.Tests { using Query = System.Action; public class QueryTests { protected static Query Conjoin (Query leftOperand, Query rightOperand) { return visitor => visitor.VisitAnd (leftOperand, rightOperand); } protected static Query Disjoin (Query leftOperand, Query rightOperand) { return visitor => visitor.VisitOr (leftOperand, rightOperand); } } } mono-upnp-0.1.2/tests/Mono.Upnp.Dcp.MediaServer1.Tests/mono-upnp-dcp-mediaserver1-tests.snk0000664000175000017500000000112411707010776032751 0ustar00lorentzlorentz00000000000000$RSA2à )3×{íïL°@¯-û®Á·v“­X ki±D¨þÊi –W?=óâsôX”h]Da(ß“¡ÎꔩH™ ãÞ.U1¿M0cì©ÔÈKjwü܈ðýëšíØfh}¬¸VYÛHýÙB"C=œE8¥‘ôáÏ%ÏÒ«ûþ”¡š÷ž†µ<¸J”eÂ?7ÀÞ€F擈l¨;ÎbJ¦íÇE ˜¤Uű¹—'rº¾ßÕïz?¹x%"&éõJ`z‘•ã‡Q4ßùtä…óIÐ9¹Ë“›g ¼ƒ}‰²¸iMzþ¥Y*&f8&Ë’w£³{N¨Œ*/q'ÞÚ6\”ž¢BÿÄ9§6?Eaï,9PÖ¦VS«4ròßܹ>Óà^¾+ºlᨑÁ"CÜhÏ]¾ÝP¨d`Ç#)(ü­¢¬vœý+­=1ð®×P¯i62Î?eC‚80…Ÿ>úf¾+­E`«ç3¿ Ç]eÑ*Fò÷²‚¢‹àkóð¼pñ¯ÍÎIÂ8úpÕøÃ¯7{ƒÿ˜Ü˜ØqÛÉñS ®k`‡'Ž2iýñì§N ¨ºÁ>òbó"á4 \13±‘iÀ†Û®î´ºsêN™0\:L'ÃQ›O•ZÚ[Ör»àÞ¤ªÚC #‚Z§'£$ú7ž Gòíæ‡ÁèŒËY©$Ø(´°é³rª®õÔþʦª³õÜdÿÛxær»lKµ÷nTì¿|$ðZ%m×Í"0j‰çŠß8 [˜A†Ò+mono-upnp-0.1.2/tests/Mono.Upnp.Dcp.MediaServer1.Tests/UpdateTextWriterTests.cs0000664000175000017500000001332611707010776030660 0ustar00lorentzlorentz00000000000000// // UpdateTextWriterTests.cs // // Author: // Scott Peterson // // Copyright (c) 2010 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.IO; using System.Text; using System.Xml; using NUnit.Framework; using Mono.Upnp.Dcp.MediaServer1.Xml; namespace Mono.Upnp.Dcp.MediaServer1.Tests { [TestFixture] public class UpdateTextWriterTests { delegate void Test (UpdateTextWriter writer); [Test] public void NoComma () { AssertStringsAreEqual ("foo", "foo"); } [Test] public void EscapeComma () { AssertStringsAreEqual (@"\,", ","); } [Test] public void EscapeTwoCommas () { AssertStringsAreEqual (@"\,\,", ",,"); } [Test] public void EscapeThreeCommas () { AssertStringsAreEqual (@"\,\,\,", ",,,"); } [Test] public void EscapeLeadingComma () { AssertStringsAreEqual (@"\,foo", ",foo"); } [Test] public void EscapeTwoLeadingCommas () { AssertStringsAreEqual (@"\,\,foo", ",,foo"); } [Test] public void EscapeTrailingComma () { AssertStringsAreEqual (@"foo\,", "foo,"); } [Test] public void EscapeTwoTrailingCommas () { AssertStringsAreEqual (@"foo\,\,", "foo,,"); } [Test] public void EscapeInSituComma () { AssertStringsAreEqual (@"foo\,bar", "foo,bar"); } [Test] public void EscapeTwoInSituCommas () { AssertStringsAreEqual (@"foo\,bar\,bat", "foo,bar,bat"); } [Test] public void EscapeLeadingAndInSituCommas () { AssertStringsAreEqual (@"\,foo\,bar", ",foo,bar"); } [Test] public void EscapeLeadingAndTrailingCommas () { AssertStringsAreEqual (@"\,foo\,", ",foo,"); } [Test] public void EscapeInSituAndTrailingCommas () { AssertStringsAreEqual (@"foo\,bar\,", "foo,bar,"); } [Test] public void EscapeLeadingInSituAndTrailingCommas () { AssertStringsAreEqual (@"\,foo\,bar\,", ",foo,bar,"); } [Test] public void EscapeThreeInSituCommas () { AssertStringsAreEqual (@"foo\,bar\,bat\,baz", "foo,bar,bat,baz"); } [Test] public void EscapeThreeEachOfLeadingInSituAndTrailingCommas () { AssertStringsAreEqual (@"\,\,\,foo\,bar\,bat\,baz\,\,\,", ",,,foo,bar,bat,baz,,,"); } const int test_array_padding = 5; void AssertStringsAreEqual (string expected, string test) { var test_array = test.ToCharArray (); AssertAreEqual (expected, writer => writer.Write (test)); AssertAreEqual (expected, writer => writer.Write (test_array)); AssertAreEqual (expected, writer => { var length = test_array.Length; var array = new char[length + test_array_padding]; Array.Copy (test_array, array, length); writer.Write (array, 0, length); }); AssertAreEqual (expected, writer => { var length = test_array.Length; var array = new char[length + test_array_padding * 2]; Array.Copy (test_array, 0, array, test_array_padding, length); writer.Write (array, test_array_padding, length); }); AssertAreEqual (expected, writer => { var length = test_array.Length; var array = new char[length + test_array_padding]; Array.Copy (test_array, 0, array, test_array_padding, length); writer.Write (array, test_array_padding, length); }); AssertAreEqual (expected, writer => { foreach (var character in test) { writer.Write (character); } }); } void AssertAreEqual (string expected, Test test) { var builder = new StringBuilder (); using (var string_writer = new StringWriter (builder)) { using (var update_writer = new UpdateTextWriter (string_writer)) { test (update_writer); } } Assert.AreEqual (expected, builder.ToString ()); } } } mono-upnp-0.1.2/tests/Mono.Upnp.Dcp.MediaServer1.Tests/QueryParserTests.cs0000664000175000017500000006275511707010776027670 0ustar00lorentzlorentz00000000000000// // QueryParserTests.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Text; using NUnit.Framework; using Mono.Upnp.Dcp.MediaServer1.ContentDirectory1; using Mono.Upnp.Dcp.MediaServer1.Internal; namespace Mono.Upnp.Dcp.MediaServer1.Tests { [TestFixture] public class QueryParserTests : QueryTests { static readonly Query foo = new Query ("foo"); static readonly Query bat = new Query ("bat"); static readonly Query name = new Query ("name"); static readonly Query eyes = new Query ("eyes"); static readonly Query age = new Query ("age"); [Test] public void EqualityOperator () { AssertEquality (foo == "bar", @"foo = ""bar"""); } [Test] public void InequalityOperator () { AssertEquality (foo != "bar", @"foo != ""bar"""); } [Test] public void LessThanOperator () { AssertEquality (foo < "5", @"foo < ""5"""); } [Test] public void LessThanOrEqualOperator () { AssertEquality (foo <= "5", @"foo <= ""5"""); } [Test] public void GreaterThanOperator () { AssertEquality (foo > "5", @"foo > ""5"""); } [Test] public void GreaterThanOrEqualOperator () { AssertEquality (foo >= "5", @"foo >= ""5"""); } [Test] public void ContainsOperator () { AssertEquality (foo.Contains ("bar"), @"foo contains ""bar"""); } [Test] public void ExistsTrue () { AssertEquality (foo.Exists (true), "foo exists true"); } [Test] public void ExistsFalse () { AssertEquality (foo.Exists (false), "foo exists false"); } [Test] public void ExistsTrueWithTrailingWhiteSpace () { AssertEquality (foo.Exists (true), "foo exists true "); } [Test] public void ExistsFalseWithTrailingWhiteSpace () { AssertEquality (foo.Exists (false), "foo exists false "); } [Test] public void ExistsTrueWithLeadingWhiteSpace () { AssertEquality (foo.Exists (true), "foo exists \t\rtrue"); } [Test] public void ExistsFalseWithLeadingWhiteSpace () { AssertEquality (foo.Exists (false), "foo exists \t\rfalse"); } [Test] public void DerivedFromOperator () { AssertEquality (foo.DerivedFrom ("object.item"), @"foo derivedfrom ""object.item"""); } [Test] public void NamespacedDerivedFromOperator () { var @class = new Query ("upnp:class"); AssertEquality (@class.DerivedFrom ("object.item"), @"upnp:class derivedfrom ""object.item"""); } [Test] public void DoesNotContainOperator () { AssertEquality (foo.DoesNotContain ("bar"), @"foo doesNotContain ""bar"""); } [Test] public void EscapedDoubleQuote () { AssertEquality (foo == @"b""a""r", @"foo = ""b\""a\""r"""); } [Test] public void EscapedSlash () { AssertEquality (foo == @"b\a\r", @"foo = ""b\\a\\r"""); } [Test] public void AndOperator () { AssertEquality ( Conjoin (foo == "bar", bat == "baz"), @"foo = ""bar"" and bat = ""baz"""); } [Test] public void OrOperator () { AssertEquality ( Disjoin (foo == "bar", bat == "baz"), @"foo = ""bar"" or bat = ""baz"""); } [Test] public void OperatorPriority () { AssertEquality ( Disjoin ( Disjoin ( Conjoin (foo == "bar", bat == "baz"), name.Contains ("john")), Conjoin (eyes == "green", age >= "21")), @"foo = ""bar"" and bat = ""baz"" or name contains ""john"" or eyes = ""green"" and age >= ""21"""); } [Test] public void ParentheticalPriority1 () { AssertEquality ( Disjoin ( Conjoin (foo == "bar", bat == "baz"), Conjoin ( Disjoin (name.Contains ("john"), eyes == "green"), age >= "21")), @"foo = ""bar"" and bat = ""baz"" or (name contains ""john"" or eyes = ""green"") and age >= ""21"""); } [Test] public void ParentheticalPriority2 () { AssertEquality ( Conjoin ( Conjoin ( foo == "bar", Disjoin ( Disjoin (bat == "baz", name.Contains ("john")), eyes == "green")), age >= "21"), @"foo = ""bar"" and ((bat = ""baz"" or name contains ""john"") or eyes = ""green"") and age >= ""21"""); } [Test] public void ParentheticalPriority3 () { AssertEquality ( Disjoin ( Conjoin ( foo == "bar", Disjoin (bat == "baz", name.Contains ("john"))), Conjoin (eyes == "green", age >= "21")), @"foo = ""bar"" and (bat = ""baz"" or name contains ""john"") or eyes = ""green"" and age >= ""21"""); } [Test] public void ParentheticalPriority4 () { AssertEquality ( Conjoin ( Conjoin ( Disjoin (foo == "bar", bat == "baz"), Disjoin (name.Contains ("john"), eyes == "green")), age >= "21"), @"(foo = ""bar"" or bat = ""baz"") and (name contains ""john"" or eyes = ""green"") and age >= ""21"""); } [Test] public void ParentheticalPriority5 () { AssertEquality ( Conjoin ( Disjoin (foo == "bar", bat.Exists (true)), Conjoin ( Disjoin (name.Contains ("john"), eyes.Exists (false)), age >= "21")), @"(foo = ""bar"" or bat exists true) and ((name contains ""john"" or eyes exists false) and age >= ""21"")"); } [Test] public void WildCard () { AssertEquality (visitor => visitor.VisitAllResults (), "*"); } [Test] public void WildCardWithWhiteSpace () { AssertEquality (visitor => visitor.VisitAllResults (), " * "); } [Test] public void WhiteSpaceAroundOperator () { var expected = foo == "bar"; AssertEquality (expected, @" foo = ""bar"""); AssertEquality (expected, @"foo = ""bar"""); AssertEquality (expected, @"foo = ""bar"""); AssertEquality (expected, @"foo = ""bar"" "); AssertEquality (expected, @" foo = ""bar"" "); } [Test] public void DerivedFromOperatorWithParentheses () { AssertEquality ( new Query ("upnp:class").DerivedFrom ("object.item.audioItem"), @"(upnp:class derivedfrom ""object.item.audioItem"")"); } [Test, ExpectedException (typeof (QueryParsingException), ExpectedMessage = "The query is empty.")] public void EmptyQuery () { QueryParser.Parse (""); } [Test, ExpectedException (typeof (QueryParsingException), ExpectedMessage = "Unexpected operator: !.")] public void IncompleteInequalityOperator () { QueryParser.Parse (@"foo ! ""bar"""); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = "The property identifier is not a part of an expression: foo.")] public void NoOperator () { QueryParser.Parse ("foo"); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = @"No operator is applied to the property identifier: foo.")] public void NoOperatorAndTrailingWhiteSpace () { QueryParser.Parse ("foo "); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = @"The property identifier is not a part of an expression: foo=""bar"".")] public void NoWhiteSpaceAroundOperator () { QueryParser.Parse (@"foo=""bar"""); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = @"Unexpected operator begining: ="".")] public void NoTrailingWhiteSpaceAroundOperator () { QueryParser.Parse (@"foo =""bar"""); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = "Unexpected operator begining: ==.")] public void DoubleEqualityOperator () { QueryParser.Parse (@"foo == ""bar"""); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = @"Unexpected operator begining: <"".")] public void NoTrailingWhiteSpaceAroundLessThan () { QueryParser.Parse (@"foo <""bar"""); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = @"Unexpected operator begining: <="".")] public void NoTrailingWhiteSpaceAroundLessThanOrEqualTo () { QueryParser.Parse (@"foo <=""bar"""); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = @"Unexpected operator begining: >"".")] public void NoTrailingWhiteSpaceAroundGreaterThan () { QueryParser.Parse (@"foo >""bar"""); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = @"Unexpected operator begining: >="".")] public void NoTrailingWhiteSpaceAroundGreaterThanOrEqualTo () { QueryParser.Parse (@"foo >=""bar"""); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = "Expecting double-quoted string operand with the operator: =.")] public void UnquotedOperand () { QueryParser.Parse ("foo = bar"); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = "Unexpected operator begining: /.")] public void UnexpectedOperator () { QueryParser.Parse (@"foo / ""bar"""); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = @"The double-quoted string is not terminated: ""bar"".")] public void UnterminatedDoubleQuotedString () { QueryParser.Parse (@"foo = ""bar"); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = "There is no operand for the operator: =.")] public void MissingOperandWithNoSpace () { QueryParser.Parse ("foo ="); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = "There is no operand for the operator: =.")] public void MissingOperandWithSpace () { QueryParser.Parse ("foo = "); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = "Unexpected operator: contain.")] public void IncompleteContainsOperator () { QueryParser.Parse (@"foo contain ""bar"""); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = "Unexpected operator begining: containe.")] public void IncorrectContainsOperator () { QueryParser.Parse (@"foo container ""bar"""); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = "Unexpected operator begining: containsi.")] public void OverlongContainsOperator () { QueryParser.Parse (@"foo containsing ""bar"""); } const string boolean_error_message = @"Expecting either ""true"" or ""false""."; [Test, ExpectedException (typeof (QueryParsingException), ExpectedMessage = boolean_error_message)] public void IllegalBooleanLiteral () { QueryParser.Parse ("foo exists bar"); } [Test, ExpectedException (typeof (QueryParsingException), ExpectedMessage = boolean_error_message)] public void IllegalTrueLiteral () { QueryParser.Parse ("foo exists troo"); } [Test, ExpectedException (typeof (QueryParsingException), ExpectedMessage = boolean_error_message)] public void IllegalFalseLiteral () { QueryParser.Parse ("foo exists falze"); } [Test, ExpectedException (typeof (QueryParsingException), ExpectedMessage = boolean_error_message)] public void IllegallyShortTrueLiteral () { QueryParser.Parse ("foo exists tru"); } [Test, ExpectedException (typeof (QueryParsingException), ExpectedMessage = boolean_error_message)] public void IllegallyShortTrueLiteralWithTrailingWhitespace () { QueryParser.Parse ("foo exists tru "); } [Test, ExpectedException (typeof (QueryParsingException), ExpectedMessage = boolean_error_message)] public void IllegallyShortFalseLiteral () { QueryParser.Parse ("foo exists fals"); } [Test, ExpectedException (typeof (QueryParsingException), ExpectedMessage = boolean_error_message)] public void IllegallyShortFalseLiteralWithTrailingWhitespace () { QueryParser.Parse ("foo exists fals "); } [Test, ExpectedException (typeof (QueryParsingException), ExpectedMessage = boolean_error_message)] public void IllegallyLongTrueLiteral () { QueryParser.Parse ("foo exists truely"); } [Test, ExpectedException (typeof (QueryParsingException), ExpectedMessage = boolean_error_message)] public void IllegallyLongFalseLiteral () { QueryParser.Parse ("foo exists falserize"); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = "There is no operand for the operator: exists.")] public void ExistsOperatorWithNoOperand () { QueryParser.Parse ("foo exists "); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = "Unexpected operator begining: du.")] public void NeitherDerivedFromNorDoesNotContain () { QueryParser.Parse (@"foo dumbo ""bar"""); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = "Unexpected operator: d.")] public void IllegallyShortDerivedFromOrDoesNotContain () { QueryParser.Parse ("foo d"); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = "Unexpected operator: d.")] public void IllegallyShortDerivedFromOrDoesNotContainWithWhiteSpace () { QueryParser.Parse (@"foo d ""bar"""); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = "Unexpected operator begining: az.")] public void IllegalAndOperator1 () { QueryParser.Parse (@"foo = ""bar"" az"); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = "Unexpected operator begining: anz.")] public void IllegalAndOperator2 () { QueryParser.Parse (@"foo = ""bar"" anz"); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = "Unexpected operator begining: andz.")] public void IllegalAndOperator3 () { QueryParser.Parse (@"foo = ""bar"" andz"); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = "Unexpected operator: a.")] public void IllegallyShortAndOperator1 () { QueryParser.Parse (@"foo = ""bar"" a"); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = "Unexpected operator: a.")] public void IllegallyShortAndOperatorWithTrailingWhiteSpace1 () { QueryParser.Parse ("foo = \"bar\" a\t"); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = "Unexpected operator: an.")] public void IllegallyShortAndOperator2 () { QueryParser.Parse (@"foo = ""bar"" an"); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = "Unexpected operator: an.")] public void IllegallyShortAndOperatorWithTrailingWhiteSpace2 () { QueryParser.Parse ("foo = \"bar\" an\t"); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = "There is no operand for the operator: and.")] public void IncompleteConjuction () { QueryParser.Parse (@"foo = ""bar"" and"); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = "There is no operand for the operator: and.")] public void IncompleteConjuctionWithTrailingWhiteSpace () { QueryParser.Parse ("foo = \"bar\" and \t\n"); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = "Unexpected operator begining: oz.")] public void IllegalOrOperator1 () { QueryParser.Parse (@"foo = ""bar"" oz"); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = "Unexpected operator begining: orz.")] public void IllegalOrOperator2 () { QueryParser.Parse (@"foo = ""bar"" orz"); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = "Unexpected operator: o.")] public void IllegallyShortOrOperator () { QueryParser.Parse (@"foo = ""bar"" o"); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = "Unexpected operator: o.")] public void IllegallyShortOrOperatorWithTrailingWhiteSpace () { QueryParser.Parse (@"foo = ""bar"" o "); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = "There is no operand for the operator: or.")] public void IncompleteDisjunction () { QueryParser.Parse (@"foo = ""bar"" or"); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = "There is no operand for the operator: or.")] public void IncompleteDisjunctionWithTrailingWhiteSpace () { QueryParser.Parse (@"foo = ""bar"" or "); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = "The parentheses are unbalanced.")] public void UnbalancedOpeningParenthesis () { QueryParser.Parse (")"); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = "Empty expressions are not allowed.")] public void OpeningEmptyParentheses () { QueryParser.Parse ("()"); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = "Expecting an expression after the conjunction.")] public void ConjoinedEmptyParentheses () { QueryParser.Parse (@"foo = ""bar"" and ()"); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = "Expecting an expression after the disjunction.")] public void DisjoinedEmptyParentheses () { QueryParser.Parse (@"foo = ""bar"" or ()"); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = "Unexpected operator begining: n.")] public void NeitherAndNorOr () { QueryParser.Parse (@"foo = ""bar"" nor bat = ""baz"""); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = "The parentheses are unbalanced.")] public void BackHeavyUnbalancedEquasionStatement () { QueryParser.Parse (@"foo = ""bar"")"); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = "The parentheses are unbalanced.")] public void FrontHeavyUnbalancedEquasionStatement () { QueryParser.Parse (@"(foo = ""bar"""); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = "The parentheses are unbalanced.")] public void UnbalancedExistsStatement () { QueryParser.Parse (@"foo exists true )"); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = "The parentheses are unbalanced.")] public void UnbalancedConjunction () { QueryParser.Parse (@"foo exists true and bar = ""bat"" )"); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = "The parentheses are unbalanced.")] public void UnbalancedDisjunction () { QueryParser.Parse (@"foo exists true or bar = ""bat"" )"); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = "Expecting an expression after the conjunction.")] public void IllegalParenthesisWithConjunction () { QueryParser.Parse (@"foo exists true and )"); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = "Expecting an expression after the disjunction.")] public void IllegalParenthesisWithDisjunction () { QueryParser.Parse (@"foo exists true or )"); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = "The wildcard must be used alone.")] public void WildCardWithOpenParenthesis () { QueryParser.Parse (@"* (foo exists true)"); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = "The parentheses are unbalanced.")] public void WildCardWithCloseParenthesis () { QueryParser.Parse (@"* ) foo exists true)"); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = "The wildcard must be used alone.")] public void WildCardWithConjunction () { QueryParser.Parse (@"* and foo exists true"); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = "The wildcard must be used alone.")] public void DoubleWildCards () { QueryParser.Parse (@"* *"); } [Test] [ExpectedException (typeof (QueryParsingException), ExpectedMessage = @"Unexpected escape sequence: \t.")] public void BadEscapeSequence () { QueryParser.Parse (@"foo = ""\tbar"""); } void AssertEquality (Action expectedQuery, string actualQuery) { var expected_builder = new StringBuilder (); var actual_builder = new StringBuilder (); expectedQuery (new QueryStringifier (expected_builder)); QueryParser.Parse (actualQuery) (new QueryStringifier (actual_builder)); Assert.AreEqual (expected_builder.ToString (), actual_builder.ToString ()); } } } mono-upnp-0.1.2/tests/Mono.Upnp.Dcp.MediaServer1.Tests/DummyObject.cs0000664000175000017500000000346011707010776026571 0ustar00lorentzlorentz00000000000000// // DummyObject.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using Mono.Upnp.Dcp.MediaServer1.ContentDirectory1; using Mono.Upnp.Xml; namespace Mono.Upnp.Dcp.MediaServer1.Tests { public class DummyObject : Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.Object { public DummyObject () : base ("-1", "-1", new ObjectOptions ()) { } protected override void SerializeMembers (XmlSerializationContext context) { throw new System.NotImplementedException (); } protected override void Serialize (XmlSerializationContext context) { throw new System.NotImplementedException (); } } } mono-upnp-0.1.2/tests/Mono.Upnp.Tests/0000775000175000017500000000000011761740037021022 5ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/tests/Mono.Upnp.Tests/DeviceDescriptionTests.cs0000664000175000017500000004044411714307244026002 0ustar00lorentzlorentz00000000000000// // DeviceDescriptionTests.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using NUnit.Framework; using Mono.Upnp.Xml; namespace Mono.Upnp.Tests { [TestFixture] public class DeviceDescriptionTests { readonly XmlSerializer serializer = new XmlSerializer (); readonly DummyDeserializer deserializer = new DummyDeserializer (); static DummyRoot CreateRoot () { return new DummyRoot ( new DeviceType ("schemas-upnp-org", "mono-upnp-tests-full-device", new Version (1, 0)), "uuid:fd1", "Mono.Upnp.Tests Full Device", "Mono Project", "Full Device", new DeviceOptions { ManufacturerUrl = new Uri ("http://www.mono-project.org"), ModelDescription = "A device description with all optional information.", ModelNumber = "1", ModelUrl = new Uri ("http://www.mono-project.org/Mono.Upnp"), SerialNumber = "12345", Upc = "67890", Icons = new[] { new DummyIcon (100, 100, 32, "image/png"), new DummyIcon (100, 100, 32, "image/jpeg") }, Services = new[] { new DummyService (new ServiceType ("schemas-upnp-org", "mono-upnp-test-service", new Version (1, 0)), "urn:upnp-org:serviceId:testService1"), new DummyService (new ServiceType ("schemas-upnp-org", "mono-upnp-test-service", new Version (2, 0)), "urn:upnp-org:serviceId:testService2"), }, EmbeddedDevices = new[] { new Device ( new DeviceType ("schemas-upnp-org", "mono-upnp-tests-full-embedded-device", new Version (1, 0)), "uuid:fed1", "Mono.Upnp.Tests Full Embedded Device", "Mono Project", "Full Embedded Device", new DeviceOptions { ManufacturerUrl = new Uri ("http://www.mono-project.org"), ModelDescription = "An embedded device description with all optional information.", ModelNumber = "1", ModelUrl = new Uri ("http://www.mono-project.org/Mono.Upnp"), SerialNumber = "12345", Upc = "67890", Icons = new[] { new DummyIcon (100, 100, 32, "image/png"), new DummyIcon (100, 100, 32, "image/jpeg") }, Services = new[] { new DummyService (new ServiceType ("schemas-upnp-org", "mono-upnp-test-service", new Version (1, 0)), "urn:upnp-org:serviceId:testService1"), new DummyService (new ServiceType ("schemas-upnp-org", "mono-upnp-test-service", new Version (2, 0)), "urn:upnp-org:serviceId:testService2"), } } ) } } ); } public static void AssertEquality (Root sourceRoot, Root targetRoot) { Assert.AreEqual (sourceRoot.SpecVersion.Major, targetRoot.SpecVersion.Major); Assert.AreEqual (sourceRoot.SpecVersion.Minor, targetRoot.SpecVersion.Minor); Assert.AreEqual (sourceRoot.UrlBase, targetRoot.UrlBase); AssertEquality (sourceRoot.RootDevice, targetRoot.RootDevice); } public static void AssertEquality (Device sourceDevice, Device targetDevice) { Assert.AreEqual (sourceDevice.Type, targetDevice.Type); Assert.AreEqual (sourceDevice.FriendlyName, targetDevice.FriendlyName); Assert.AreEqual (sourceDevice.Manufacturer, targetDevice.Manufacturer); Assert.AreEqual (sourceDevice.ManufacturerUrl, targetDevice.ManufacturerUrl); Assert.AreEqual (sourceDevice.ModelDescription, targetDevice.ModelDescription); Assert.AreEqual (sourceDevice.ModelName, targetDevice.ModelName); Assert.AreEqual (sourceDevice.ModelNumber, targetDevice.ModelNumber); Assert.AreEqual (sourceDevice.ModelUrl, targetDevice.ModelUrl); Assert.AreEqual (sourceDevice.SerialNumber, targetDevice.SerialNumber); Assert.AreEqual (sourceDevice.Udn, targetDevice.Udn); Assert.AreEqual (sourceDevice.Upc, targetDevice.Upc); var source_icons = sourceDevice.Icons.GetEnumerator (); var target_icons = targetDevice.Icons.GetEnumerator (); while (source_icons.MoveNext ()) { Assert.IsTrue (target_icons.MoveNext ()); AssertEquality (source_icons.Current, target_icons.Current); } Assert.IsFalse (target_icons.MoveNext ()); var source_services = sourceDevice.Services.GetEnumerator (); var target_services = targetDevice.Services.GetEnumerator (); while (source_services.MoveNext ()) { Assert.IsTrue (target_services.MoveNext ()); AssertEquality (source_services.Current, target_services.Current); } Assert.IsFalse (target_services.MoveNext ()); var source_devices = sourceDevice.Devices.GetEnumerator (); var target_devices = targetDevice.Devices.GetEnumerator (); while (source_devices.MoveNext ()) { Assert.IsTrue (target_devices.MoveNext ()); AssertEquality (source_devices.Current, target_devices.Current); } Assert.IsFalse (target_services.MoveNext ()); } public static void AssertEquality (Icon sourceIcon, Icon targetIcon) { Assert.AreEqual (sourceIcon.MimeType, targetIcon.MimeType); Assert.AreEqual (sourceIcon.Width, targetIcon.Width); Assert.AreEqual (sourceIcon.Height, targetIcon.Height); Assert.AreEqual (sourceIcon.Depth, targetIcon.Depth); Assert.AreEqual (sourceIcon.Url, targetIcon.Url); } public static void AssertEquality (Service sourceService, Service targetService) { Assert.AreEqual (sourceService.Type, targetService.Type); Assert.AreEqual (sourceService.Id, targetService.Id); Assert.AreEqual (sourceService.ScpdUrl, targetService.ScpdUrl); Assert.AreEqual (sourceService.ControlUrl, targetService.ControlUrl); Assert.AreEqual (sourceService.EventUrl, targetService.EventUrl); } [Test] public void OfflineFullDeviceDescriptionTest () { var source_root = CreateRoot (); source_root.Initialize (); var target_root = deserializer.DeserializeRoot (serializer.GetString (source_root)); AssertEquality (source_root, target_root); } [Test] public void FullDeviceDescriptionDeserializationTest () { var root = deserializer.DeserializeRoot (Xml.FullDeviceDescription); Assert.AreEqual ("", root.ConfigurationId); Assert.AreEqual (1, root.SpecVersion.Major); Assert.AreEqual (1, root.SpecVersion.Minor); Assert.AreEqual (new DeviceType ("schemas-upnp-org", "mono-upnp-tests-full-device", new Version (1, 0)), root.RootDevice.Type); Assert.AreEqual ("Mono.Upnp.Tests Full Device", root.RootDevice.FriendlyName); Assert.AreEqual ("Mono Project", root.RootDevice.Manufacturer); Assert.AreEqual (new Uri ("http://www.mono-project.org/"), root.RootDevice.ManufacturerUrl); Assert.AreEqual ("A device description with all optional information.", root.RootDevice.ModelDescription); Assert.AreEqual ("Full Device", root.RootDevice.ModelName); Assert.AreEqual ("1", root.RootDevice.ModelNumber); Assert.AreEqual (new Uri ("http://www.mono-project.org/Mono.Upnp"), root.RootDevice.ModelUrl); Assert.AreEqual ("12345", root.RootDevice.SerialNumber); Assert.AreEqual ("uuid:fd1", root.RootDevice.Udn); Assert.AreEqual ("67890", root.RootDevice.Upc); var icons = root.RootDevice.Icons.GetEnumerator (); Assert.IsTrue (icons.MoveNext ()); Assert.AreEqual ("image/png", icons.Current.MimeType); Assert.AreEqual (100, icons.Current.Width); Assert.AreEqual (100, icons.Current.Height); Assert.AreEqual (32, icons.Current.Depth); Assert.AreEqual (new Uri ("http://localhost:8080/icon/0/"), icons.Current.Url); Assert.IsTrue (icons.MoveNext ()); Assert.AreEqual ("image/jpeg", icons.Current.MimeType); Assert.AreEqual (100, icons.Current.Width); Assert.AreEqual (100, icons.Current.Height); Assert.AreEqual (32, icons.Current.Depth); Assert.AreEqual (new Uri ("http://localhost:8080/icon/1/"), icons.Current.Url); Assert.IsFalse (icons.MoveNext ()); var services = root.RootDevice.Services.GetEnumerator (); Assert.IsTrue (services.MoveNext ()); Assert.AreEqual (new ServiceType ("schemas-upnp-org", "mono-upnp-test-service", new Version (1, 0)), services.Current.Type); Assert.AreEqual ("urn:upnp-org:serviceId:testService1", services.Current.Id); Assert.AreEqual (new Uri ("http://localhost:8080/service/0/scpd/"), services.Current.ScpdUrl); Assert.AreEqual (new Uri ("http://localhost:8080/service/0/control/"), services.Current.ControlUrl); Assert.AreEqual (new Uri ("http://localhost:8080/service/0/event/"), services.Current.EventUrl); Assert.IsTrue (services.MoveNext ()); Assert.AreEqual (new ServiceType ("schemas-upnp-org", "mono-upnp-test-service", new Version (2, 0)), services.Current.Type); Assert.AreEqual ("urn:upnp-org:serviceId:testService2", services.Current.Id); Assert.AreEqual (new Uri ("http://localhost:8080/service/1/scpd/"), services.Current.ScpdUrl); Assert.AreEqual (new Uri ("http://localhost:8080/service/1/control/"), services.Current.ControlUrl); Assert.AreEqual (new Uri ("http://localhost:8080/service/1/event/"), services.Current.EventUrl); Assert.IsFalse (services.MoveNext ()); var devices = root.RootDevice.Devices.GetEnumerator (); Assert.IsTrue (devices.MoveNext ()); Assert.AreEqual (new DeviceType ("schemas-upnp-org", "mono-upnp-tests-full-embedded-device", new Version (1, 0)), devices.Current.Type); Assert.AreEqual ("Mono.Upnp.Tests Full Embedded Device", devices.Current.FriendlyName); Assert.AreEqual ("Mono Project", devices.Current.Manufacturer); Assert.AreEqual (new Uri ("http://www.mono-project.org/"), devices.Current.ManufacturerUrl); Assert.AreEqual ("An embedded device description with all optional information.", devices.Current.ModelDescription); Assert.AreEqual ("Full Embedded Device", devices.Current.ModelName); Assert.AreEqual ("1", devices.Current.ModelNumber); Assert.AreEqual (new Uri ("http://www.mono-project.org/Mono.Upnp"), devices.Current.ModelUrl); Assert.AreEqual ("12345", devices.Current.SerialNumber); Assert.AreEqual ("uuid:fed1", devices.Current.Udn); Assert.AreEqual ("67890", devices.Current.Upc); icons = devices.Current.Icons.GetEnumerator (); Assert.IsTrue (icons.MoveNext ()); Assert.AreEqual ("image/png", icons.Current.MimeType); Assert.AreEqual (100, icons.Current.Width); Assert.AreEqual (100, icons.Current.Height); Assert.AreEqual (32, icons.Current.Depth); Assert.AreEqual (new Uri ("http://localhost:8080/device/0/icon/0/"), icons.Current.Url); Assert.IsTrue (icons.MoveNext ()); Assert.AreEqual ("image/jpeg", icons.Current.MimeType); Assert.AreEqual (100, icons.Current.Width); Assert.AreEqual (100, icons.Current.Height); Assert.AreEqual (32, icons.Current.Depth); Assert.AreEqual (new Uri ("http://localhost:8080/device/0/icon/1/"), icons.Current.Url); Assert.IsFalse (icons.MoveNext ()); services = devices.Current.Services.GetEnumerator (); Assert.IsTrue (services.MoveNext ()); Assert.AreEqual (new ServiceType ("schemas-upnp-org", "mono-upnp-test-service", new Version (1, 0)), services.Current.Type); Assert.AreEqual ("urn:upnp-org:serviceId:testService1", services.Current.Id); Assert.AreEqual (new Uri ("http://localhost:8080/device/0/service/0/scpd/"), services.Current.ScpdUrl); Assert.AreEqual (new Uri ("http://localhost:8080/device/0/service/0/control/"), services.Current.ControlUrl); Assert.AreEqual (new Uri ("http://localhost:8080/device/0/service/0/event/"), services.Current.EventUrl); Assert.IsTrue (services.MoveNext ()); Assert.AreEqual (new ServiceType ("schemas-upnp-org", "mono-upnp-test-service", new Version (2, 0)), services.Current.Type); Assert.AreEqual ("urn:upnp-org:serviceId:testService2", services.Current.Id); Assert.AreEqual (new Uri ("http://localhost:8080/device/0/service/1/scpd/"), services.Current.ScpdUrl); Assert.AreEqual (new Uri ("http://localhost:8080/device/0/service/1/control/"), services.Current.ControlUrl); Assert.AreEqual (new Uri ("http://localhost:8080/device/0/service/1/event/"), services.Current.EventUrl); Assert.IsFalse (services.MoveNext ()); var empty_devices = devices.Current.Devices.GetEnumerator (); Assert.IsFalse (empty_devices.MoveNext ()); Assert.IsFalse (devices.MoveNext ()); } [Test] public void UrlBaseDeviceDescriptionDeserializationTest () { var root = deserializer.DeserializeRoot (Xml.UrlBaseDeviceDescription); var icons = root.RootDevice.Icons.GetEnumerator (); Assert.IsTrue (icons.MoveNext ()); Assert.AreEqual (new Uri ("http://www.mono-project.com/icon/0/"), icons.Current.Url); var services = root.RootDevice.Services.GetEnumerator (); Assert.IsTrue (services.MoveNext ()); Assert.AreEqual (new Uri ("http://www.mono-project.com/service/0/scpd/"), services.Current.ScpdUrl); Assert.AreEqual (new Uri ("http://www.mono-project.com/service/0/control/"), services.Current.ControlUrl); Assert.AreEqual (new Uri ("http://www.mono-project.com/service/0/event/"), services.Current.EventUrl); } [Test] public void FullDescriptionSerializationTest () { var root = CreateRoot (); root.Initialize (); Assert.AreEqual (Xml.FullDeviceDescription, serializer.GetString (root)); } } } mono-upnp-0.1.2/tests/Mono.Upnp.Tests/Makefile.am0000664000175000017500000000533111715013277023056 0ustar00lorentzlorentz00000000000000 EXTRA_DIST = # Warning: This is an automatically generated file, do not edit! if ENABLE_DEBUG ASSEMBLY_COMPILER_COMMAND = gmcs ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug "-define:DEBUG" ASSEMBLY = ../../bin/Mono.Upnp.Tests.dll ASSEMBLY_MDB = $(ASSEMBLY).mdb COMPILE_TARGET = library PROJECT_REFERENCES = \ ../../bin/Mono.Ssdp.dll \ ../../bin/Mono.Upnp.dll BUILD_DIR = ../../bin MONO_UPNP_TESTS_DLL_MDB_SOURCE=../../bin/Mono.Upnp.Tests.dll.mdb MONO_UPNP_TESTS_DLL_MDB=$(BUILD_DIR)/Mono.Upnp.Tests.dll.mdb MONO_UPNP_DLL_SOURCE=../../bin/Mono.Upnp.dll MONO_SSDP_DLL_SOURCE=../../bin/Mono.Ssdp.dll MONO_SSDP_DLL_MDB_SOURCE=../../bin/Mono.Ssdp.dll.mdb MONO_SSDP_DLL_MDB=$(BUILD_DIR)/Mono.Ssdp.dll.mdb MONO_UPNP_DLL_MDB_SOURCE=../../bin/Mono.Upnp.dll.mdb MONO_UPNP_DLL_MDB=$(BUILD_DIR)/Mono.Upnp.dll.mdb endif if ENABLE_RELEASE ASSEMBLY_COMPILER_COMMAND = gmcs ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ ASSEMBLY = ../../bin/Mono.Upnp.Tests.dll ASSEMBLY_MDB = COMPILE_TARGET = library PROJECT_REFERENCES = \ ../../bin/Mono.Upnp.dll \ ../../bin/Mono.Ssdp.dll BUILD_DIR = ../../bin MONO_UPNP_TESTS_DLL_MDB= MONO_UPNP_DLL_SOURCE=../../bin/Mono.Upnp.dll MONO_SSDP_DLL_SOURCE=../../bin/Mono.Ssdp.dll MONO_SSDP_DLL_MDB= MONO_UPNP_DLL_MDB= endif AL=al2 SATELLITE_ASSEMBLY_NAME=$(notdir $(basename $(ASSEMBLY))).resources.dll PROGRAMFILES = \ $(MONO_UPNP_TESTS_DLL_MDB) \ $(MONO_UPNP_DLL) \ $(MONO_SSDP_DLL) \ $(MONO_SSDP_DLL_MDB) \ $(MONO_UPNP_DLL_MDB) RESGEN=resgen2 all: $(ASSEMBLY) $(PROGRAMFILES) FILES = \ ClientTests.cs \ DeviceDescriptionTests.cs \ DummyDeserializer.cs \ DummyDeserializerFactory.cs \ DummyIcon.cs \ DummyRoot.cs \ DummyService.cs \ DummyServiceAction.cs \ DummyServiceController.cs \ DummyStateVariable.cs \ DummyStateVariableEventer.cs \ ServerTests.cs \ ServiceDescriptionTests.cs \ ServiceTests.cs \ TypeInfoTests.cs \ Xml.cs \ XmlDeserializationTests.cs \ XmlSerializationTests.cs DATA_FILES = RESOURCES = EXTRAS = REFERENCES = \ -pkg:nunit \ System \ System.Xml DLL_REFERENCES = CLEANFILES = $(PROGRAMFILES) include $(top_srcdir)/Makefile.include MONO_UPNP_DLL = $(BUILD_DIR)/Mono.Upnp.dll MONO_SSDP_DLL = $(BUILD_DIR)/Mono.Ssdp.dll $(eval $(call emit_resgen_targets)) $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(ASSEMBLY_MDB): $(ASSEMBLY) $(ASSEMBLY): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(shell dirname $(ASSEMBLY)) $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) mono-upnp-0.1.2/tests/Mono.Upnp.Tests/DummyStateVariable.cs0000664000175000017500000000341411714307244025112 0ustar00lorentzlorentz00000000000000// // DummyStateVariable.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using Mono.Upnp.Control; namespace Mono.Upnp.Tests { public class DummyStateVariable : StateVariable { static readonly DummyStateVariableEventer eventer = new DummyStateVariableEventer (); public DummyStateVariable (string name, string dataType) : this (name, dataType, false) { } public DummyStateVariable (string name, string dataType, bool isMulticast) : base (name, dataType, new StateVariableOptions { Eventer = eventer, IsMulticast = isMulticast }) { } } } mono-upnp-0.1.2/tests/Mono.Upnp.Tests/Makefile.in0000664000175000017500000006153611761736756023117 0ustar00lorentzlorentz00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/Makefile.include subdir = tests/Mono.Upnp.Tests ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/expansions.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(bindir)" \ "$(DESTDIR)$(assemblyfilesdir)" \ "$(DESTDIR)$(linuxpkgconfigdir)" \ "$(DESTDIR)$(programfilesdir)" SCRIPTS = $(bin_SCRIPTS) SOURCES = DIST_SOURCES = DATA = $(assemblyfiles_DATA) $(linuxpkgconfig_DATA) \ $(programfiles_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ GLADE_SHARP_20_CFLAGS = @GLADE_SHARP_20_CFLAGS@ GLADE_SHARP_20_LIBS = @GLADE_SHARP_20_LIBS@ GLIB_SHARP_20_CFLAGS = @GLIB_SHARP_20_CFLAGS@ GLIB_SHARP_20_LIBS = @GLIB_SHARP_20_LIBS@ GMCS = @GMCS@ GTK_SHARP_20_CFLAGS = @GTK_SHARP_20_CFLAGS@ GTK_SHARP_20_LIBS = @GTK_SHARP_20_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MONO_ADDINS_CFLAGS = @MONO_ADDINS_CFLAGS@ MONO_ADDINS_LIBS = @MONO_ADDINS_LIBS@ NUNIT_CFLAGS = @NUNIT_CFLAGS@ NUNIT_CMD = @NUNIT_CMD@ NUNIT_LIBS = @NUNIT_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TAGLIB_SHARP_CFLAGS = @TAGLIB_SHARP_CFLAGS@ TAGLIB_SHARP_LIBS = @TAGLIB_SHARP_LIBS@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_bindir = @expanded_bindir@ expanded_datadir = @expanded_datadir@ expanded_libdir = @expanded_libdir@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = $(build_sources) $(build_resx_files) \ $(build_others_files) $(ASSEMBLY_WRAPPER_IN) $(EXTRAS) \ $(DATA_FILES) $(build_culture_res_files) # Warning: This is an automatically generated file, do not edit! @ENABLE_DEBUG_TRUE@ASSEMBLY_COMPILER_COMMAND = gmcs @ENABLE_RELEASE_TRUE@ASSEMBLY_COMPILER_COMMAND = gmcs @ENABLE_DEBUG_TRUE@ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug "-define:DEBUG" @ENABLE_RELEASE_TRUE@ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ @ENABLE_DEBUG_TRUE@ASSEMBLY = ../../bin/Mono.Upnp.Tests.dll @ENABLE_RELEASE_TRUE@ASSEMBLY = ../../bin/Mono.Upnp.Tests.dll @ENABLE_DEBUG_TRUE@ASSEMBLY_MDB = $(ASSEMBLY).mdb @ENABLE_RELEASE_TRUE@ASSEMBLY_MDB = @ENABLE_DEBUG_TRUE@COMPILE_TARGET = library @ENABLE_RELEASE_TRUE@COMPILE_TARGET = library @ENABLE_DEBUG_TRUE@PROJECT_REFERENCES = \ @ENABLE_DEBUG_TRUE@ ../../bin/Mono.Ssdp.dll \ @ENABLE_DEBUG_TRUE@ ../../bin/Mono.Upnp.dll @ENABLE_RELEASE_TRUE@PROJECT_REFERENCES = \ @ENABLE_RELEASE_TRUE@ ../../bin/Mono.Upnp.dll \ @ENABLE_RELEASE_TRUE@ ../../bin/Mono.Ssdp.dll @ENABLE_DEBUG_TRUE@BUILD_DIR = ../../bin @ENABLE_RELEASE_TRUE@BUILD_DIR = ../../bin @ENABLE_DEBUG_TRUE@MONO_UPNP_TESTS_DLL_MDB_SOURCE = ../../bin/Mono.Upnp.Tests.dll.mdb @ENABLE_DEBUG_TRUE@MONO_UPNP_TESTS_DLL_MDB = $(BUILD_DIR)/Mono.Upnp.Tests.dll.mdb @ENABLE_RELEASE_TRUE@MONO_UPNP_TESTS_DLL_MDB = @ENABLE_DEBUG_TRUE@MONO_UPNP_DLL_SOURCE = ../../bin/Mono.Upnp.dll @ENABLE_RELEASE_TRUE@MONO_UPNP_DLL_SOURCE = ../../bin/Mono.Upnp.dll @ENABLE_DEBUG_TRUE@MONO_SSDP_DLL_SOURCE = ../../bin/Mono.Ssdp.dll @ENABLE_RELEASE_TRUE@MONO_SSDP_DLL_SOURCE = ../../bin/Mono.Ssdp.dll @ENABLE_DEBUG_TRUE@MONO_SSDP_DLL_MDB_SOURCE = ../../bin/Mono.Ssdp.dll.mdb @ENABLE_DEBUG_TRUE@MONO_SSDP_DLL_MDB = $(BUILD_DIR)/Mono.Ssdp.dll.mdb @ENABLE_RELEASE_TRUE@MONO_SSDP_DLL_MDB = @ENABLE_DEBUG_TRUE@MONO_UPNP_DLL_MDB_SOURCE = ../../bin/Mono.Upnp.dll.mdb @ENABLE_DEBUG_TRUE@MONO_UPNP_DLL_MDB = $(BUILD_DIR)/Mono.Upnp.dll.mdb @ENABLE_RELEASE_TRUE@MONO_UPNP_DLL_MDB = AL = al2 SATELLITE_ASSEMBLY_NAME = $(notdir $(basename $(ASSEMBLY))).resources.dll PROGRAMFILES = \ $(MONO_UPNP_TESTS_DLL_MDB) \ $(MONO_UPNP_DLL) \ $(MONO_SSDP_DLL) \ $(MONO_SSDP_DLL_MDB) \ $(MONO_UPNP_DLL_MDB) RESGEN = resgen2 FILES = \ ClientTests.cs \ DeviceDescriptionTests.cs \ DummyDeserializer.cs \ DummyDeserializerFactory.cs \ DummyIcon.cs \ DummyRoot.cs \ DummyService.cs \ DummyServiceAction.cs \ DummyServiceController.cs \ DummyStateVariable.cs \ DummyStateVariableEventer.cs \ ServerTests.cs \ ServiceDescriptionTests.cs \ ServiceTests.cs \ TypeInfoTests.cs \ Xml.cs \ XmlDeserializationTests.cs \ XmlSerializationTests.cs DATA_FILES = RESOURCES = EXTRAS = REFERENCES = \ -pkg:nunit \ System \ System.Xml DLL_REFERENCES = CLEANFILES = $(PROGRAMFILES) $(ASSEMBLY) $(ASSEMBLY).mdb $(BINARIES) \ $(build_resx_resources) $(build_satellite_assembly_list) VALID_CULTURES = ar bg ca zh-CHS cs da de el en es fi fr he hu is it ja ko nl no pl pt ro ru hr sk sq sv th tr id uk be sl et lv lt fa vi hy eu mk af ka fo hi sw gu ta te kn mr gl kok ar-SA bg-BG ca-ES zh-TW cs-CZ da-DK de-DE el-GR en-US fi-FI fr-FR he-IL hu-HU is-IS it-IT ja-JP ko-KR nl-NL nb-NO pl-PL pt-BR ro-RO ru-RU hr-HR sk-SK sq-AL sv-SE th-TH tr-TR id-ID uk-UA be-BY sl-SI et-EE lv-LV lt-LT fa-IR vi-VN hy-AM eu-ES mk-MK af-ZA ka-GE fo-FO hi-IN sw-KE gu-IN ta-IN te-IN kn-IN mr-IN gl-ES kok-IN ar-IQ zh-CN de-CH en-GB es-MX fr-BE it-CH nl-BE nn-NO pt-PT sv-FI ar-EG zh-HK de-AT en-AU es-ES fr-CA ar-LY zh-SG de-LU en-CA es-GT fr-CH ar-DZ zh-MO en-NZ es-CR fr-LU ar-MA en-IE es-PA ar-TN en-ZA es-DO ar-OM es-VE ar-YE es-CO ar-SY es-PE ar-JO en-TT es-AR ar-LB en-ZW es-EC ar-KW en-PH es-CL ar-AE es-UY ar-BH es-PY ar-QA es-BO es-SV es-HN es-NI es-PR zh-CHT s2q = $(subst \ ,?,$1) q2s = $(subst ?,\ ,$1) # use this when result will be quoted unesc2 = $(subst ?, ,$1) build_sources = $(FILES) $(GENERATED_FILES) build_sources_esc = $(call s2q,$(build_sources)) # use unesc2, as build_sources_embed is quoted build_sources_embed = $(call unesc2,$(build_sources_esc:%='$(srcdir)/%')) comma__ = , get_resource_name = $(firstword $(subst $(comma__), ,$1)) get_culture = $(lastword $(subst ., ,$(basename $1))) is_cultured_resource = $(and $(word 3,$(subst ., ,$1)), $(filter $(VALID_CULTURES),$(lastword $(subst ., ,$(basename $1))))) RESOURCES_ESC = $(call s2q,$(RESOURCES)) build_resx_list = $(foreach res, $(RESOURCES_ESC), $(if $(filter %.resx, $(call get_resource_name,$(res))),$(res),)) build_non_culture_resx_list = $(foreach res, $(build_resx_list),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_non_culture_others_list = $(foreach res, $(filter-out $(build_resx_list),$(RESOURCES_ESC)),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_others_list = $(build_non_culture_others_list) build_xamlg_list = $(filter %.xaml.g.cs, $(FILES)) # resgen all .resx resources build_resx_files = $(foreach res, $(build_resx_list), $(call get_resource_name,$(res))) build_resx_resources_esc = $(build_resx_files:.resx=.resources) build_resx_resources = $(call q2s,$(build_resx_resources_esc)) # embed resources for the main assembly build_resx_resources_hack = $(subst .resx,.resources, $(build_non_culture_resx_list)) # use unesc2, as build_resx_resources_embed is quoted build_resx_resources_embed = $(call unesc2,$(build_resx_resources_hack:%='-resource:%')) build_others_files = $(call q2s,$(foreach res, $(build_others_list),$(call get_resource_name,$(res)))) build_others_resources = $(build_others_files) # use unesc2, as build_others_resources_embed is quoted build_others_resources_embed = $(call unesc2,$(build_others_list:%='-resource:$(srcdir)/%')) build_resources = $(build_resx_resources) $(build_others_resources) build_resources_embed = $(build_resx_resources_embed) $(build_others_resources_embed) # -usesourcepath is available only for resgen2 emit_resgen_target_1 = $(call q2s,$1) : $(call q2s,$(subst .resources,.resx,$1)); cd '$$(shell dirname '$$<')' && MONO_IOMAP=drive $$(RESGEN) '$$(shell basename '$$<')' '$$(shell basename '$$@')' emit_resgen_target_2 = $(call q2s,$1) : $(call q2s,$(subst .resources,.resx,$1)); MONO_IOMAP=drive $$(RESGEN) -usesourcepath '$$<' '$$@' emit_resgen_target = $(if $(filter resgen2,$(RESGEN)),$(emit_resgen_target_2),$(emit_resgen_target_1)) emit_resgen_targets = $(foreach res,$(build_resx_resources_esc),$(eval $(call emit_resgen_target,$(res)))) build_references_ref = $(call q2s,$(foreach ref, $(call \ s2q,$(REFERENCES)), $(if $(filter -pkg:%, $(ref)), $(ref), \ $(if $(filter -r:%, $(ref)), $(ref), -r:$(ref))))) $(call \ q2s,$(foreach ref, $(call s2q,$(DLL_REFERENCES)), -r:$(ref))) \ $(call q2s,$(foreach ref, $(call s2q,$(PROJECT_REFERENCES)), \ -r:$(ref))) s2q2s = $(call unesc2,$(call s2q,$1)) cp_actual = test -z $1 || cp $1 $2 cp = $(call cp_actual,'$(call s2q2s,$1)','$(call s2q2s,$2)') rm_actual = test -z '$1' || rm -f '$2' rm = $(call rm_actual,$(call s2q2s,$1),$(call s2q2s,$2)/$(shell basename '$(call s2q2s,$1)')) DISTCLEANFILES = $(GENERATED_FILES) $(pc_files) $(BUILD_DIR)/* assemblyfilesdir = $(pkglibdir) assemblyfiles_DATA = $(ASSEMBLY) bin_SCRIPTS = $(BINARIES) programfilesdir = @libdir@/@PACKAGE@ programfiles_DATA = $(PROGRAMFILES) linuxpkgconfigdir = @libdir@/pkgconfig linuxpkgconfig_DATA = $(LINUX_PKGCONFIG) # generating satellite assemblies culture_resources = $(foreach res, $(RESOURCES_ESC), $(if $(call is_cultured_resource,$(call get_resource_name, $(res))),$(res))) cultures = $(sort $(foreach res, $(culture_resources), $(call get_culture,$(call get_resource_name,$(res))))) culture_resource_dependencies = $(call q2s,$(BUILD_DIR)/$1/$(SATELLITE_ASSEMBLY_NAME): $(subst .resx,.resources,$2)) culture_resource_commandlines = $(call unesc2,cmd_line_satellite_$1 += '/embed:$(subst .resx,.resources,$2)') build_satellite_assembly_list = $(call q2s,$(cultures:%=$(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME))) build_culture_res_files = $(call q2s,$(foreach res, $(culture_resources),$(call get_resource_name,$(res)))) install_satellite_assembly_list = $(subst $(BUILD_DIR),$(DESTDIR)$(libdir)/$(PACKAGE),$(build_satellite_assembly_list)) MONO_UPNP_DLL = $(BUILD_DIR)/Mono.Upnp.dll MONO_SSDP_DLL = $(BUILD_DIR)/Mono.Ssdp.dll all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.include $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/Mono.Upnp.Tests/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign tests/Mono.Upnp.Tests/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/Makefile.include: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) install-assemblyfilesDATA: $(assemblyfiles_DATA) @$(NORMAL_INSTALL) test -z "$(assemblyfilesdir)" || $(MKDIR_P) "$(DESTDIR)$(assemblyfilesdir)" @list='$(assemblyfiles_DATA)'; test -n "$(assemblyfilesdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(assemblyfilesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(assemblyfilesdir)" || exit $$?; \ done uninstall-assemblyfilesDATA: @$(NORMAL_UNINSTALL) @list='$(assemblyfiles_DATA)'; test -n "$(assemblyfilesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(assemblyfilesdir)'; $(am__uninstall_files_from_dir) install-linuxpkgconfigDATA: $(linuxpkgconfig_DATA) @$(NORMAL_INSTALL) test -z "$(linuxpkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(linuxpkgconfigdir)" @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(linuxpkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(linuxpkgconfigdir)" || exit $$?; \ done uninstall-linuxpkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(linuxpkgconfigdir)'; $(am__uninstall_files_from_dir) install-programfilesDATA: $(programfiles_DATA) @$(NORMAL_INSTALL) test -z "$(programfilesdir)" || $(MKDIR_P) "$(DESTDIR)$(programfilesdir)" @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(programfilesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(programfilesdir)" || exit $$?; \ done uninstall-programfilesDATA: @$(NORMAL_UNINSTALL) @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(programfilesdir)'; $(am__uninstall_files_from_dir) tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(assemblyfilesdir)" "$(DESTDIR)$(linuxpkgconfigdir)" "$(DESTDIR)$(programfilesdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-assemblyfilesDATA install-linuxpkgconfigDATA \ install-programfilesDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binSCRIPTS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-assemblyfilesDATA uninstall-binSCRIPTS \ uninstall-linuxpkgconfigDATA uninstall-programfilesDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-assemblyfilesDATA \ install-binSCRIPTS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-linuxpkgconfigDATA install-man install-pdf \ install-pdf-am install-programfilesDATA install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \ uninstall-am uninstall-assemblyfilesDATA uninstall-binSCRIPTS \ uninstall-linuxpkgconfigDATA uninstall-programfilesDATA all: $(ASSEMBLY) $(PROGRAMFILES) # macros # $(call emit-deploy-target,deploy-variable-name) define emit-deploy-target $($1): $($1_SOURCE) mkdir -p '$$(shell dirname '$$@')' cp '$$<' '$$@' endef # $(call emit-deploy-wrapper,wrapper-variable-name,wrapper-sourcefile,x) # assumes that for a wrapper foo.pc its source template is foo.pc.in # if $3 is non-empty then wrapper is marked exec define emit-deploy-wrapper $($1): $2 mkdir -p '$$(shell dirname '$$@')' cp '$$<' '$$@' $(if $3,chmod +x '$$@') endef $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_dependencies,$(call get_culture,$(call get_resource_name,$(res))),$(call get_resource_name,$(res)))))) $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_commandlines,$(call get_culture,$(call get_resource_name,$(res))),$(res))))) $(build_satellite_assembly_list): $(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME): mkdir -p '$(@D)' $(AL) -out:'$@' -culture:$* -t:lib $(cmd_line_satellite_$*) $(install_satellite_assembly_list): mkdir -p '$(@D)' cp $(subst $(DESTDIR)$(libdir)/$(PACKAGE), $(BUILD_DIR), $@) $@ install-satellite-assemblies: $(install_satellite_assembly_list) uninstall-satellite-assemblies: rm -rf $(install_satellite_assembly_list) $(eval $(call emit_resgen_targets)) $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(ASSEMBLY_MDB): $(ASSEMBLY) $(ASSEMBLY): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(shell dirname $(ASSEMBLY)) $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: mono-upnp-0.1.2/tests/Mono.Upnp.Tests/ClientTests.cs0000664000175000017500000003565711714307244023627 0ustar00lorentzlorentz00000000000000// // ClientTests.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using System.Threading; using NUnit.Framework; using Mono.Upnp.Control; namespace Mono.Upnp.Tests { [TestFixture] public class ClientTests { readonly object mutex = new object (); volatile bool flag; [Test] public void DescriptionCacheTest() { var factory = new DummyDeserializerFactory (); using (var server = new Server (CreateRoot ())) { using (var client = new Client (factory.CreateDeserializer)) { client.Browse (new ServiceType ("schemas-upnp-org", "mono-upnp-test-service", new Version (1, 0))); client.Browse (new ServiceType ("schemas-upnp-org", "mono-upnp-test-service", new Version (2, 0))); flag = false; client.ServiceAdded += (sender, args) => { lock (mutex) { var service = args.Service.GetService (); Assert.IsNotNull (service); if (flag) { Monitor.Pulse (mutex); } else { flag = true; } } }; lock (mutex) { server.Start (); if (!Monitor.Wait (mutex, TimeSpan.FromSeconds (30))) { Assert.Fail ("The server announcement timed out."); } Assert.AreEqual (1, factory.InstantiationCount); } } } } [Test] public void AnnouncementTest () { using (var server = new Server (CreateRoot ())) { using (var client = new Client ()) { client.DeviceAdded += AnnouncementTestClientDeviceAdded; client.ServiceAdded += AnnouncementTestClientServiceAdded; client.BrowseAll (); lock (mutex) { flag = false; server.Start (); if (!Monitor.Wait (mutex, TimeSpan.FromSeconds (30))) { Assert.Fail ("The UPnP server announcement timed out."); } } } } } void AnnouncementTestClientServiceAdded (object sender, ServiceEventArgs e) { lock (mutex) { Assert.AreEqual (new ServiceType ("schemas-upnp-org", "mono-upnp-test-service", new Version (1, 0)), e.Service.Type); Assert.AreEqual ("uuid:d1", e.Service.DeviceUdn); Assert.IsTrue (e.Service.Locations.GetEnumerator ().MoveNext ()); if (flag) { Monitor.Pulse (mutex); } else { flag = true; } } } void AnnouncementTestClientDeviceAdded (object sender, DeviceEventArgs e) { lock (mutex) { Assert.AreEqual (new DeviceType ("schemas-upnp-org", "mono-upnp-test-device", new Version (1, 0)), e.Device.Type); Assert.AreEqual ("uuid:d1", e.Device.Udn); Assert.IsTrue (e.Device.Locations.GetEnumerator ().MoveNext ()); if (flag) { Monitor.Pulse (mutex); } else { flag = true; } } } [Test] public void GetDeviceTest () { using (var server = new Server (CreateRoot ())) { using (var client = new Client ()) { client.BrowseAll (); client.DeviceAdded += (obj, args) => { lock (mutex) { var device = args.Device.GetDevice (); Assert.AreEqual ("uuid:d1", device.Udn); Monitor.Pulse (mutex); } }; lock (mutex) { server.Start (); if (!Monitor.Wait (mutex, TimeSpan.FromSeconds (30))) { Assert.Fail ("The UPnP server announcement timed out."); } } } } } [Test] public void GetServiceTest () { using (var server = new Server (CreateRoot ())) { using (var client = new Client ()) { client.BrowseAll (); client.ServiceAdded += (obj, args) => { lock (mutex) { var service = args.Service.GetService (); Assert.AreEqual ("urn:upnp-org:serviceId:testService1", service.Id); Monitor.Pulse (mutex); } }; lock (mutex) { server.Start (); if (!Monitor.Wait (mutex, TimeSpan.FromSeconds (30))) { Assert.Fail ("The UPnP server announcement timed out."); } } } } } [Test] public void GetServiceControllerTest () { using (var server = new Server (CreateRoot ())) { using (var client = new Client ()) { client.BrowseAll (); client.ServiceAdded += (obj, args) => { lock (mutex) { try { var controller = args.Service.GetService ().GetController (); Assert.IsNotNull (controller); } finally { Monitor.Pulse (mutex); } } }; lock (mutex) { server.Start (); if (!Monitor.Wait (mutex, TimeSpan.FromSeconds (30))) { Assert.Fail ("The UPnP server announcement timed out."); } } } } } class ControlTestClass { [UpnpAction] public string Foo (string bar) { return string.Format ("You said {0}", bar); } } [Test] public void ControlTest () { var root = new Root ( new DeviceType ("schemas-upnp-org", "mono-upnp-test-device", new Version (1, 0)), "uuid:d1", "Mono.Upnp.Tests Device", "Mono Project", "Device", new DeviceOptions { Services = new[] { new Service ( new ServiceType ("schemas-upnp-org", "mono-upnp-test-service", new Version (1, 0)), "urn:upnp-org:serviceId:testService1", new ControlTestClass () ) } } ); using (var client = new Client ()) { client.Browse (new ServiceType ("schemas-upnp-org", "mono-upnp-test-service", new Version (1, 0))); Exception exception = null; client.ServiceAdded += (sender, args) => { lock (mutex) { try { var controller = args.Service.GetService ().GetController (); var arguments = new Dictionary (1); arguments["bar"] = "hello world!"; var results = controller.Actions["Foo"].Invoke (arguments); Assert.AreEqual ("You said hello world!", results["result"]); } catch (Exception e) { exception = e; } finally { Monitor.Pulse (mutex); } } }; using (var server = new Server (root)) { lock (mutex) { server.Start (); if (!Monitor.Wait (mutex, TimeSpan.FromSeconds (30))) { Assert.Fail ("The server control timed out."); } else if (exception != null) { throw exception; } } } } } class EventTestClass { [UpnpStateVariable] public event EventHandler> FooChanged; string foo; public string Foo { get { return foo; } set { foo = value; if (FooChanged != null) { FooChanged (this, new StateVariableChangedArgs (value)); } } } } class EventTestHelperClass { readonly EventTestClass service; readonly object mutex; public Exception Exception; public EventTestHelperClass (EventTestClass service, object mutex) { this.service = service; this.mutex = mutex; } public void FirstEventHandler (object sender, StateVariableChangedArgs args) { try { Assert.AreEqual ("Hello World!", args.NewValue); var state_variable = (StateVariable)sender; state_variable.ValueChanged -= FirstEventHandler; state_variable.ValueChanged += SecondEventHandler; service.Foo = "Hello Universe!"; } catch (Exception e) { Exception = e; lock (mutex) { Monitor.Pulse (mutex); } } } public void SecondEventHandler (object sender, StateVariableChangedArgs args) { try { Assert.AreEqual ("Hello Universe!", args.NewValue); } catch (Exception e) { Exception = e; } lock (mutex) { Monitor.Pulse (mutex); } } } [Test] public void EventTest () { var service = new EventTestClass (); var root = new Root ( new DeviceType ("schemas-upnp-org", "mono-upnp-test-device", new Version (1, 0)), "uuid:d1", "Mono.Upnp.Tests Device", "Mono Project", "Device", new DeviceOptions { Services = new[] { new Service ( new ServiceType ("schemas-upnp-org", "mono-upnp-test-service", new Version (1, 0)), "urn:upnp-org:serviceId:testService1", service ) } } ); var helper = new EventTestHelperClass (service, mutex); using (var server = new Server (root)) { using (var client = new Client ()) { client.ServiceAdded += (sender, args) => { try { var controller = args.Service.GetService ().GetController (); controller.StateVariables["FooChanged"].ValueChanged += helper.FirstEventHandler; } catch (Exception e) { helper.Exception = e; lock (mutex) { Monitor.Pulse (mutex); } } }; client.Browse (new ServiceType ("schemas-upnp-org", "mono-upnp-test-service", new Version (1, 0))); lock (mutex) { server.Start (); service.Foo = "Hello World!"; if (!Monitor.Wait (mutex, TimeSpan.FromSeconds (30))) { Assert.Fail ("The event timed out."); } } } } if (helper.Exception != null) { throw helper.Exception; } } static Root CreateRoot () { return new DummyRoot ( new DeviceType ("schemas-upnp-org", "mono-upnp-test-device", new Version (1, 0)), "uuid:d1", "Mono.Upnp.Tests Device", "Mono Project", "Device", new DeviceOptions { Services = new[] { new DummyService ( new ServiceType ("schemas-upnp-org", "mono-upnp-test-service", new Version (1, 0)), "urn:upnp-org:serviceId:testService1" ), new DummyService ( new ServiceType ("schemas-upnp-org", "mono-upnp-test-service", new Version (2, 0)), "urn:upnp-org:serviceId:testService2" ) } } ); } } } mono-upnp-0.1.2/tests/Mono.Upnp.Tests/DummyService.cs0000664000175000017500000000353411714307244023767 0ustar00lorentzlorentz00000000000000// // DummyService.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; namespace Mono.Upnp.Tests { public class DummyService : Service { static readonly DummyServiceController controller = new DummyServiceController (); public DummyService (ServiceType type, string id) : base (type, id, controller) { ScpdUrlFragment = ControlUrlFragment = EventUrlFragment = "http://localhost/"; } } public class DummyService : Service where T : new () { public DummyService () : base (new T ()) { } public DummyService (T service) : base (service) { } } } mono-upnp-0.1.2/tests/Mono.Upnp.Tests/DummyStateVariableEventer.cs0000664000175000017500000000267011714307244026446 0ustar00lorentzlorentz00000000000000// // DummyStateVariableEventer.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using Mono.Upnp.Control; namespace Mono.Upnp.Tests { public class DummyStateVariableEventer : StateVariableEventer { public void SetValue (string value) { OnStateVariableUpdated (value); } } } mono-upnp-0.1.2/tests/Mono.Upnp.Tests/DummyServiceController.cs0000664000175000017500000000336311714307244026033 0ustar00lorentzlorentz00000000000000// // DummyServiceController.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System.Collections.Generic; using Mono.Upnp.Control; using Mono.Upnp.Xml; namespace Mono.Upnp.Tests { public class DummyServiceController : ServiceController { public DummyServiceController () : base ((IEnumerable)null, null) { } protected override void Initialize (XmlSerializer serializer, Service service) { } protected override void Start () { } protected override void Stop () { } } } mono-upnp-0.1.2/tests/Mono.Upnp.Tests/DummyIcon.cs0000664000175000017500000000262711714307244023261 0ustar00lorentzlorentz00000000000000// // DummyIcon.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. namespace Mono.Upnp.Tests { public class DummyIcon : Icon { public DummyIcon (int width, int height, int depth, string mimetype) : base (width, height, depth, mimetype) { } } } mono-upnp-0.1.2/tests/Mono.Upnp.Tests/XmlDeserializationTests.cs0000664000175000017500000010624211714307244026205 0ustar00lorentzlorentz00000000000000// // XmlDeserializationTests.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using System.IO; using System.Xml; using NUnit.Framework; using Mono.Upnp.Xml; namespace Mono.Upnp.Tests { [TestFixture] public class XmlDeserializationTests { readonly XmlDeserializer deserializer = new XmlDeserializer (); T Deserialize (string xml) { return Deserialize (xml, null); } T Deserialize (string xml, Deserializer deserializer) { using (var string_reader = new StringReader (xml)) { using (var xml_reader = XmlReader.Create (string_reader)) { xml_reader.Read (); return this.deserializer.Deserialize (xml_reader, deserializer); } } } class ElementTestClass { [XmlElement] public string Foo { get; set; } } [Test] public void ElementTest () { var deserialized_object = Deserialize ("Bar"); Assert.AreEqual ("Bar", deserialized_object.Foo); } class ElementNameTestClass { [XmlElement ("foo")] public string Foo { get; set; } } [Test] public void ElementNameTest () { var deserialized_object = Deserialize ("Bar"); Assert.AreEqual ("Bar", deserialized_object.Foo); } class ElementNamespaceTestClass { [XmlElement ("foo", "urn:mono-upnp:tests")] public string Foo { get; set; } } [Test] public void ElementNamespaceTest () { var deserialized_object = Deserialize (@"Bar"); Assert.AreEqual ("Bar", deserialized_object.Foo); deserialized_object = Deserialize (@"Bar"); Assert.IsNull (deserialized_object.Foo); } class ElementTestClass { [XmlElement] public T Foo { get; set; } } [Test] public void IntElementTest () { var deserialized_object = Deserialize> ("42"); Assert.AreEqual (42, deserialized_object.Foo); } [Test] public void DoubleElementTest () { var deserialized_object = Deserialize> ("3.14"); Assert.AreEqual (3.14, deserialized_object.Foo); } [Test] public void BoolElementTest () { var deserialized_object = Deserialize> ("true"); Assert.IsTrue (deserialized_object.Foo); } [Test] public void LongElementTest () { var deserialized_object = Deserialize> ("300000000000"); Assert.AreEqual (300000000000L, deserialized_object.Foo); } [Test] public void FloatElementTest () { var deserialized_object = Deserialize> ("1.5"); Assert.AreEqual (1.5, deserialized_object.Foo); } [Test] public void DecimalElementTest () { var deserialized_object = Deserialize> (".00005"); Assert.AreEqual (0.00005, deserialized_object.Foo); } // TODO DateTime test [Test] public void UriElementTest () { var deserialized_object = Deserialize> ("http://localhost/"); Assert.AreEqual (new Uri ("http://localhost/"), deserialized_object.Foo); } class NestedElementTestClass { [XmlElement] public ElementTestClass Child { get; set; } } [Test] public void NestedElementTest () { var deserialized_object = Deserialize ("Bar"); Assert.AreEqual ("Bar", deserialized_object.Child.Foo); } class AttributeTestClass { [XmlAttribute] public string Foo { get; set; } } [Test] public void AttributeTest () { var deserialized_object = Deserialize (@""); Assert.AreEqual ("Bar", deserialized_object.Foo); } class AttributeNameTestClass { [XmlAttribute ("foo")] public string Foo { get; set; } } [Test] public void AttributeNameTest () { var deserialized_object = Deserialize (@""); Assert.AreEqual ("Bar", deserialized_object.Foo); } class AttributeNamespaceTestClass { [XmlAttribute ("foo", "urn:mono-upnp:tests")] public string Foo { get; set; } } [Test] public void AttributeNamespaceTest () { var deserialized_object = Deserialize (@""); Assert.AreEqual ("Bar", deserialized_object.Foo); deserialized_object = Deserialize (@""); Assert.IsNull (deserialized_object.Foo); } class AttributeTestClass { [XmlAttribute] public T Foo { get; set; } } [Test] public void IntAttributeTest () { var deserialized_object = Deserialize> (@""); Assert.AreEqual (42, deserialized_object.Foo); } [Test] public void DoubleAttributeTest () { var deserialized_object = Deserialize> (@""); Assert.AreEqual (3.14, deserialized_object.Foo); } [Test] public void BoolAttributeTest () { var deserialized_object = Deserialize> (@""); Assert.IsTrue (deserialized_object.Foo); } [Test] public void LongAttributeTest () { var deserialized_object = Deserialize> (@""); Assert.AreEqual (300000000000L, deserialized_object.Foo); } [Test] public void FloatAttributeTest () { var deserialized_object = Deserialize> (@""); Assert.AreEqual (1.5, deserialized_object.Foo); } [Test] public void DecimalAttributeTest () { var deserialized_object = Deserialize> (@""); Assert.AreEqual (0.00005, deserialized_object.Foo); } // TODO DateTime test [Test] public void UriAttributeTest () { var deserialized_object = Deserialize> (@""); Assert.AreEqual (new Uri ("http://localhost/"), deserialized_object.Foo); } class FlagTestClass { [XmlFlag] public bool Foo { get; set; } } [Test] public void FlagTest () { var deserialized_object = Deserialize (@""); Assert.IsTrue (deserialized_object.Foo); } class FlagNameTestClass { [XmlFlag ("foo")] public bool Foo { get; set; } } [Test] public void FlagNameTest () { var deserialized_object = Deserialize (@""); Assert.IsTrue (deserialized_object.Foo); } class FlagNamespaceTestClass { [XmlFlag ("foo", "urn:mono-upnp:tests")] public bool Foo { get; set; } } [Test] public void FlagNamespaceTest () { var deserialized_object = Deserialize (@""); Assert.IsTrue (deserialized_object.Foo); deserialized_object = Deserialize (@""); Assert.IsFalse (deserialized_object.Foo); } class ArrayStringTestClass { readonly List items = new List (); [XmlArray] public List Items { get { return items; } } } [Test] public void ArrayStringTest () { var deserialized_object = Deserialize (@"FooBar"); Assert.AreEqual (2, deserialized_object.Items.Count); Assert.Contains ("Foo", deserialized_object.Items); Assert.Contains ("Bar", deserialized_object.Items); } class ArrayItemTestClass { readonly List items = new List (); [XmlArray] public List Items { get { return items; } } } [Test] public void ArrayItemTest () { var deserialized_object = Deserialize (@""); Assert.AreEqual (2, deserialized_object.Items.Count); Assert.AreEqual ("bat", deserialized_object.Items[0].Foo); Assert.AreEqual ("baz", deserialized_object.Items[1].Foo); } class ArrayNameTestClass { readonly List items = new List (); [XmlArray ("items")] public List Items { get { return items; } } } [Test] public void ArrayNameTest () { var deserialized_object = Deserialize (@"FooBar"); Assert.AreEqual (2, deserialized_object.Items.Count); Assert.Contains ("Foo", deserialized_object.Items); Assert.Contains ("Bar", deserialized_object.Items); } class ArrayNamespaceTestClass { readonly List items = new List (); [XmlArray ("items", "urn:mono-upnp:tests")] public List Items { get { return items; } } } [Test] public void ArrayNamespaceTest () { var deserialized_object = Deserialize (@"FooBar"); Assert.AreEqual (2, deserialized_object.Items.Count); Assert.Contains ("Foo", deserialized_object.Items); Assert.Contains ("Bar", deserialized_object.Items); deserialized_object = Deserialize (@"FooBar"); Assert.AreEqual (0, deserialized_object.Items.Count); } class ArrayICollectionTestClass { readonly List items = new List (); [XmlArray] public ICollection Items { get { return items; } } } [Test] public void ArrayICollectionTest () { var deserialized_object = Deserialize (@"FooBar"); Assert.AreEqual (2, deserialized_object.Items.Count); Assert.IsTrue (deserialized_object.Items.Contains("Foo")); Assert.IsTrue (deserialized_object.Items.Contains("Bar")); } class RecursiveTestClass { [XmlElement] public string Foo { get; set; } [XmlElement] public RecursiveTestClass Child { get; set; } } [Test] public void RecursiveTest () { var deserialized_object = Deserialize (@"barbat"); Assert.AreEqual ("bar", deserialized_object.Foo); Assert.AreEqual ("bat", deserialized_object.Child.Foo); } class PrivateTestClass { [XmlAttribute] public string Foo { get; private set; } } [Test] public void PrivateTest () { var deserialized_object = Deserialize (@""); Assert.AreEqual ("bar", deserialized_object.Foo); } class IXmlDeserializableDeserializeTestClass : IXmlDeserializable { public string Foo { get; private set; } public void Deserialize (XmlDeserializationContext context) { Foo = context.Reader.LocalName; } public void DeserializeAttribute (XmlDeserializationContext context) { } public void DeserializeElement (XmlDeserializationContext context) { } } [Test] public void IXmlDeserializableDeserializeTest () { var deserialized_object = Deserialize (@""); Assert.AreEqual ("Bar", deserialized_object.Foo); } class IXmlDeserializableDeserializeAttributeTestClass : IXmlDeserializable { public string Foo { get; private set; } public void Deserialize (XmlDeserializationContext context) { context.AutoDeserialize (this); } public void DeserializeAttribute (XmlDeserializationContext context) { Foo = context.Reader.ReadContentAsString (); } public void DeserializeElement (XmlDeserializationContext context) { } } [Test] public void IXmlDeserializableDeserializeAttributeTest () { var deserialized_object = Deserialize (@""); Assert.AreEqual ("hello world", deserialized_object.Foo); } class IXmlDeserializableDeserializeElementTestClass : IXmlDeserializable { [XmlElement] public string Foo { get; private set; } [XmlElement] public string Bar { get; private set; } public void Deserialize (XmlDeserializationContext context) { context.AutoDeserialize (this); } public void DeserializeAttribute (XmlDeserializationContext context) { } public void DeserializeElement (XmlDeserializationContext context) { if (context.Reader.LocalName == "Foo") { Foo = "Foo is " + context.Reader.ReadElementContentAsString (); } else { context.AutoDeserializeElement (this); } } } [Test] public void IXmlDeserializableDeserializeElementTest () { var deserialized_object = Deserialize (@"barbat"); Assert.AreEqual ("Foo is bar", deserialized_object.Foo); Assert.AreEqual ("bat", deserialized_object.Bar); } class OverrideTestBaseClass { [XmlElement] public virtual string Foo { get; set; } } class OverrideTestSubClass : OverrideTestBaseClass { [XmlElement ("foo")] public override string Foo { get { return base.Foo; } set { base.Foo = value; } } } [Test] public void OverrideTest () { var deserialized_object = Deserialize (@"bar"); Assert.AreEqual ("bar", deserialized_object.Foo); deserialized_object = Deserialize (@"bar"); Assert.IsNull (deserialized_object.Foo); var base_deserialized_object = Deserialize (@"bar"); Assert.IsNull (base_deserialized_object.Foo); } class OverrideOmitTestSubClass : OverrideTestBaseClass { public override string Foo { get { return base.Foo; } set { base.Foo = value; } } } [Test] public void OverrideOmitTest () { var deserialized_object = Deserialize (@"bar"); Assert.IsNull (deserialized_object.Foo); } class DeserializerTestClass { readonly string foo; public DeserializerTestClass (string foo) { this.foo = foo; } public string Foo { get { return foo; } } [XmlAttribute] public string Bar { get; set; } } [Test] public void DeserializerTest () { var deserialized_object = Deserialize (@"", context => { var obj = new DeserializerTestClass ("baz"); context.AutoDeserialize (obj); return obj; }); Assert.AreEqual ("baz", deserialized_object.Foo); Assert.AreEqual ("bat", deserialized_object.Bar); } class TypeDeserializerTestClass : IXmlDeserializer { [XmlElement] public DeserializerTestClass Child { get; set; } DeserializerTestClass IXmlDeserializer.Deserialize (XmlDeserializationContext context) { return DeserializeChild (context); } protected virtual DeserializerTestClass DeserializeChild (XmlDeserializationContext context) { var child = new DeserializerTestClass ("hello world"); context.AutoDeserialize (child); return child; } } [Test] public void TypeDeserializerTest () { var deserialized_object = Deserialize (@""); Assert.AreEqual ("hello world", deserialized_object.Child.Foo); Assert.AreEqual ("bat", deserialized_object.Child.Bar); } [Test] public void TypeDeserializerDeserializerTest () { var deserialized_object = Deserialize (@"", (context) => { var obj = new TypeDeserializerTestClass (); context.AutoDeserialize (obj); return obj; }); Assert.AreEqual ("hello world", deserialized_object.Child.Foo); Assert.AreEqual ("bat", deserialized_object.Child.Bar); } class XmlDeserializableTestBaseClass : XmlDeserializable { [XmlAttribute] public virtual string Foo { get; protected set; } public string ElementName { get; private set; } protected override void Deserialize (XmlDeserializationContext context) { ElementName = context.Reader.LocalName; base.Deserialize (context); } protected override void DeserializeAttribute (XmlDeserializationContext context) { context.AutoDeserializeAttribute (this); } } class XmlDeserializableTestSubClass : XmlDeserializableTestBaseClass { [XmlAttribute ("foo")] public override string Foo { get { return base.Foo; } protected set { base.Foo = value; } } protected override void DeserializeAttribute (XmlDeserializationContext context) { context.AutoDeserializeAttribute (this); } } class XmlDeserializableContainerTestBaseClass : IXmlDeserializer { [XmlElement] public XmlDeserializableTestBaseClass Child { get; set; } XmlDeserializableTestBaseClass IXmlDeserializer.Deserialize (XmlDeserializationContext context) { return DeserializeChild (context); } protected virtual XmlDeserializableTestBaseClass DeserializeChild (XmlDeserializationContext context) { var child = new XmlDeserializableTestBaseClass (); ((IXmlDeserializable)child).Deserialize (context); return child; } } class XmlDeserializableContainerTestSubClass : XmlDeserializableContainerTestBaseClass { protected override XmlDeserializableTestBaseClass DeserializeChild (XmlDeserializationContext context) { var child = new XmlDeserializableTestSubClass (); ((IXmlDeserializable)child).Deserialize(context); return child; } } [Test] public void XmlDeserializableTest () { var deserialized_object = Deserialize ( @""); Assert.AreEqual ("bar", deserialized_object.Child.Foo); Assert.AreEqual ("Child", deserialized_object.Child.ElementName); } class XmlDeserializableTypeDeserializerTestClass : XmlDeserializable, IXmlDeserializer { [XmlElement] public DeserializerTestClass Child { get; private set; } DeserializerTestClass IXmlDeserializer.Deserialize (XmlDeserializationContext context) { var child = new DeserializerTestClass ("blah"); context.AutoDeserialize (child); return child; } protected override void DeserializeElement (XmlDeserializationContext context) { context.AutoDeserializeElement (this); } } [Test] public void XmlDeserializableTypeDeserializerTest () { var deserialized_object = Deserialize ( @""); Assert.AreEqual ("blah", deserialized_object.Child.Foo); Assert.AreEqual ("bat", deserialized_object.Child.Bar); } class DeserializerArrayTestClass : IXmlDeserializer { readonly List list = new List (); [XmlArray] public List Children { get { return list; } } DeserializerTestClass IXmlDeserializer.Deserialize (XmlDeserializationContext context) { var child = new DeserializerTestClass ("blah"); context.AutoDeserialize (child); return child; } } [Test] public void DeserializerArrayTest () { var deserialized_object = Deserialize ( @""); Assert.AreEqual (3, deserialized_object.Children.Count); Assert.AreEqual ("one", deserialized_object.Children[0].Bar); Assert.AreEqual ("two", deserialized_object.Children[1].Bar); Assert.AreEqual ("five", deserialized_object.Children[2].Bar); } class NonPublicConstructorTestClass { NonPublicConstructorTestClass () { } [XmlAttribute] public string Foo { get; set; } } class NonPublicConstructorContainerClass { [XmlElement] public NonPublicConstructorTestClass Child { get; set; } } [Test] public void NonPublicConstructorTest () { var deserialized_object = Deserialize ( @""); Assert.AreEqual ("bar", deserialized_object.Child.Foo); } class DoNotDeserializeTestClass { [DoNotDeserialize, XmlAttribute] public string Foo { get; set; } [DoNotDeserialize, XmlElement] public string Bar { get; set; } [XmlAttribute] public string Bat { get; set; } [XmlElement] public string Baz { get; set; } } [Test] public void DoNotDeserializeTest () { var deserialized_object = Deserialize ( @"barbaz"); Assert.IsNull (deserialized_object.Foo); Assert.IsNull (deserialized_object.Bar); Assert.AreEqual ("bat", deserialized_object.Bat); Assert.AreEqual ("baz", deserialized_object.Baz); } enum EnumTestEnum { [XmlEnum ("foo")] Foo, [XmlEnum ("bar")] Bar, [XmlEnum ("bat")] Bat } class EnumTestClass { [XmlAttribute] public EnumTestEnum Thing { get; set; } [XmlElement] public EnumTestEnum Doohicky { get; set; } } [Test] public void EnumTest () { var deserialized_object = Deserialize (@"bat"); Assert.AreEqual (EnumTestEnum.Bar, deserialized_object.Thing); Assert.AreEqual (EnumTestEnum.Bat, deserialized_object.Doohicky); } [Test] public void NoNamespaceTest () { var deserialized_object = Deserialize (@"bar"); Assert.AreEqual ("bar", deserialized_object.Foo); } class ValueTestClass { [XmlValue] public string Foo { get; set; } } [Test] public void ValueTest () { var deserialized_object = Deserialize (@"bar"); Assert.AreEqual ("bar", deserialized_object.Foo); } class FreeNamedArrayItemTestClass { readonly List values = new List (); [XmlArrayItem ("Foo")] public IList Values { get { return values; } } } [Test] public void FreeNamedArrayItemTest () { var deserialized_object = Deserialize (@"foobarbat"); Assert.AreEqual (2, deserialized_object.Values.Count); Assert.AreEqual ("foo", deserialized_object.Values[0]); Assert.AreEqual ("bar", deserialized_object.Values[1]); } class FreeEmptyNameArrayItemTestClass { readonly IList values = new List (); [XmlArrayItem ("")] public IList Values { get { return values; } } } [Test] public void FreeEmptyNameArrayItemTest () { var deserialized_object = Deserialize (@"foobarbat"); Assert.AreEqual (2, deserialized_object.Values.Count); Assert.AreEqual ("foo", deserialized_object.Values[0]); Assert.AreEqual ("bar", deserialized_object.Values[1]); } class FreeUnnamedArrayItemTestClass { readonly IList values = new List (); [XmlArrayItem] public IList Values { get { return values; } } } [Test] public void FreeUnnamedArrayItemTest () { var deserialized_object = Deserialize (@"foobarbat"); Assert.AreEqual (2, deserialized_object.Values.Count); Assert.AreEqual ("foo", deserialized_object.Values[0]); Assert.AreEqual ("bar", deserialized_object.Values[1]); } [XmlType ("test")] class NamedItem { [XmlValue] public string Value { get; private set; } } class FreeNamedTypeArrayItemTestClass { readonly IList values = new List (); [XmlArrayItem] public IList Values { get { return values; } } } [Test] public void FreeNamedTypeArrayItemTest () { var deserialized_object = Deserialize (@"foobarbat"); Assert.AreEqual (2, deserialized_object.Values.Count); Assert.AreEqual ("foo", deserialized_object.Values[0].Value); Assert.AreEqual ("bar", deserialized_object.Values[1].Value); } [XmlType ("")] class EmptyNameItem { [XmlValue] public string Value { get; private set; } } class FreeEmptyNameTypeArrayItemTestClass { readonly IList values = new List (); [XmlArrayItem] public IList Values { get { return values; } } } [Test] public void FreeEmptyNameTypeArrayItemTest () { var deserialized_object = Deserialize (@"foobarbat"); Assert.AreEqual (2, deserialized_object.Values.Count); Assert.AreEqual ("foo", deserialized_object.Values[0].Value); Assert.AreEqual ("bar", deserialized_object.Values[1].Value); } class NullableElementTestClass { [XmlElement] public int? Foo { get; set; } } [Test] public void NullableElementTest () { var deserialized_object = Deserialize (@"42"); Assert.AreEqual (42, deserialized_object.Foo); } class NullableAttributeTestClass { [XmlAttribute] public int? Foo { get; set; } } [Test] public void NullableAttributeTest () { var deserialized_object = Deserialize (@""); Assert.AreEqual (42, deserialized_object.Foo); } [Test] public void WhiteSpaceAndCommentsTest () { var deserialized_object = Deserialize ("\n\t bar"); Assert.AreEqual ("bar", deserialized_object.Foo); } class PrivateConstructorClass { PrivateConstructorClass () { } [XmlAttribute] public string Bar { get; set; } } [Test] public void PrivateConstructorTest () { var deserialized_object = Deserialize> (@""); Assert.AreEqual ("bar", deserialized_object.Foo.Bar); } class DeserializablePrivateConstructorClass : XmlDeserializable { DeserializablePrivateConstructorClass () { } public string Bar { get; set; } protected override void DeserializeAttribute (XmlDeserializationContext context) { Bar = context.Reader["Bar"]; } } [Test] public void DeserializablePrivateConstructorTest () { var deserialized_object = Deserialize> (@""); Assert.AreEqual ("bar", deserialized_object.Foo.Bar); } class AttributeAndValueTestClass { [XmlAttribute] public string Foo { get; set; } [XmlValue] public string Bar { get; set; } } [Test] public void AttributeAndValueTest () { var deserialized_object = Deserialize (@"bar"); Assert.AreEqual ("foo", deserialized_object.Foo); Assert.AreEqual ("bar", deserialized_object.Bar); } } } mono-upnp-0.1.2/tests/Mono.Upnp.Tests/Xml.cs0000664000175000017500000004160111714307244022110 0ustar00lorentzlorentz00000000000000// // Xml.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. namespace Mono.Upnp.Tests { public static class Xml { public const string FullDeviceDescription = @"" + @"" + "" + "1" + "1" + "" + "" + "urn:schemas-upnp-org:device:mono-upnp-tests-full-device:1" + "Mono.Upnp.Tests Full Device" + "Mono Project" + "http://www.mono-project.org/" + "A device description with all optional information." + "Full Device" + "1" + "http://www.mono-project.org/Mono.Upnp" + "12345" + "uuid:fd1" + "67890" + "" + "" + "image/png" + "100" + "100" + "32" + "/icon/0/" + "" + "" + "image/jpeg" + "100" + "100" + "32" + "/icon/1/" + "" + "" + "" + "" + "urn:schemas-upnp-org:service:mono-upnp-test-service:1" + "urn:upnp-org:serviceId:testService1" + "/service/0/scpd/" + "/service/0/control/" + "/service/0/event/" + "" + "" + "urn:schemas-upnp-org:service:mono-upnp-test-service:2" + "urn:upnp-org:serviceId:testService2" + "/service/1/scpd/" + "/service/1/control/" + "/service/1/event/" + "" + "" + "" + "" + "urn:schemas-upnp-org:device:mono-upnp-tests-full-embedded-device:1" + "Mono.Upnp.Tests Full Embedded Device" + "Mono Project" + "http://www.mono-project.org/" + "An embedded device description with all optional information." + "Full Embedded Device" + "1" + "http://www.mono-project.org/Mono.Upnp" + "12345" + "uuid:fed1" + "67890" + "" + "" + "image/png" + "100" + "100" + "32" + "/device/0/icon/0/" + "" + "" + "image/jpeg" + "100" + "100" + "32" + "/device/0/icon/1/" + "" + "" + "" + "" + "urn:schemas-upnp-org:service:mono-upnp-test-service:1" + "urn:upnp-org:serviceId:testService1" + "/device/0/service/0/scpd/" + "/device/0/service/0/control/" + "/device/0/service/0/event/" + "" + "" + "urn:schemas-upnp-org:service:mono-upnp-test-service:2" + "urn:upnp-org:serviceId:testService2" + "/device/0/service/1/scpd/" + "/device/0/service/1/control/" + "/device/0/service/1/event/" + "" + "" + "" + "" + "" + ""; public const string UrlBaseDeviceDescription = @"" + @"" + "" + "1" + "1" + "" + "" + "urn:schemas-upnp-org:device:mono-upnp-tests-full-device:1" + "Mono.Upnp.Tests Full Device" + "Mono Project" + "http://www.mono-project.org/" + "A device description with all optional information." + "Full Device" + "1" + "http://www.mono-project.org/Mono.Upnp" + "12345" + "uuid:fd1" + "67890" + "" + "" + "image/png" + "100" + "100" + "32" + "/icon/0/" + "" + "" + "" + "" + "urn:schemas-upnp-org:service:mono-upnp-test-service:1" + "urn:upnp-org:serviceId:testService1" + "/service/0/scpd/" + "/service/0/control/" + "/service/0/event/" + "" + "" + "" + "http://www.mono-project.com" + ""; public const string FullScpd = @"" + @"" + "" + "1" + "1" + "" + "" + "" + "Browse" + "" + "" + "browseFlag" + "in" + "A_ARG_TYPE_BrowseFlag" + "" + "" + "offset" + "in" + "A_ARG_TYPE_Offset" + "" + "" + "requestCount" + "in" + "A_ARG_TYPE_RequestCount" + "" + "" + "resultCount" + "out" + "A_ARG_TYPE_ResultCount" + "" + "" + "result" + "out" + "" + "A_ARG_TYPE_Result" + "" + "" + "" + "" + "Search" + "" + "" + "searchFlag" + "in" + "A_ARG_TYPE_SearchFlag" + "" + "" + "offset" + "in" + "A_ARG_TYPE_Offset" + "" + "" + "requestCount" + "in" + "A_ARG_TYPE_RequestCount" + "" + "" + "resultCount" + "out" + "A_ARG_TYPE_ResultCount" + "" + "" + "result" + "out" + "" + "A_ARG_TYPE_Result" + "" + "" + "" + "" + "" + "" + "A_ARG_TYPE_BrowseFlag" + "string" + "" + "BrowseMetadata" + "BrowseObjects" + "" + "" + "" + "A_ARG_TYPE_SearchFlag" + "string" + "" + "SearchMetadata" + "SearchObjects" + "" + "" + "" + "A_ARG_TYPE_Offset" + "ui4" + "" + "" + "A_ARG_TYPE_RequestCount" + "ui4" + "50" + "" + "1" + "100" + "" + "" + "" + "A_ARG_TYPE_ResultCount" + "ui4" + "" + "" + "A_ARG_TYPE_Result" + "string" + "" + @"" + "SystemId" + "ui4" + "" + "" + ""; public const string SimpleSoapRequest = @"" + @"" + "" + @"" + "hello world!" + "" + "" + ""; public const string SingleEventReport = @"" + @"" + "" + "foo" + "" + ""; public const string DoubleEventReport = @"" + @"" + "" + "foo" + "" + "" + "bar" + "" + ""; } } mono-upnp-0.1.2/tests/Mono.Upnp.Tests/DummyDeserializer.cs0000664000175000017500000000573511714307244025016 0ustar00lorentzlorentz00000000000000// // DummyDeserializer.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.IO; using System.Xml; using Mono.Upnp.Control; using Mono.Upnp.Xml; namespace Mono.Upnp.Tests { public class DummyDeserializer : Deserializer { static readonly XmlDeserializer deserializer = new XmlDeserializer (); public DummyDeserializer () : base (deserializer) { } public Root DeserializeRoot (string xml) { using (var string_reader = new StringReader (xml)) { using (var xml_reader = XmlReader.Create (string_reader)) { return DeserializeRoot (xml_reader); } } } public Root DeserializeRoot (XmlReader reader) { return DeserializeRoot (reader, new Uri ("http://localhost:8080")); } public Root DeserializeRoot (XmlReader reader, Uri url) { reader.ReadToFollowing ("root"); return XmlDeserializer.Deserialize (reader, context => DeserializeRoot (url, context)); } public ServiceController DeserializeServiceController (string xml) { using (var string_reader = new StringReader (xml)) { using (var xml_reader = XmlReader.Create (string_reader)) { return DeserializeServiceController (xml_reader); } } } public ServiceController DeserializeServiceController (XmlReader reader) { reader.ReadToFollowing ("scpd"); return XmlDeserializer.Deserialize (reader, context => DeserializeServiceController ( new DummyService (new ServiceType ("schemas-upnp-org", "mono-upnp-test-service", new Version (1, 0)), "testService1"), context)); } } } mono-upnp-0.1.2/tests/Mono.Upnp.Tests/DummyDeserializerFactory.cs0000664000175000017500000000303511714307244026335 0ustar00lorentzlorentz00000000000000// // DummyDeserializerFactory.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using Mono.Upnp.Xml; namespace Mono.Upnp.Tests { public class DummyDeserializerFactory { public int InstantiationCount; public Deserializer CreateDeserializer (XmlDeserializer xmlDeserializer) { InstantiationCount++; return new Deserializer (xmlDeserializer); } } } mono-upnp-0.1.2/tests/Mono.Upnp.Tests/ServerTests.cs0000664000175000017500000006327511714307244023654 0ustar00lorentzlorentz00000000000000// // ServerTests.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using System.IO; using System.Net; using System.Net.Sockets; using System.Threading; using System.Xml; using Mono.Ssdp; using Mono.Upnp.Control; using NUnit.Framework; namespace Mono.Upnp.Tests { [TestFixture] public class ServerTests { readonly object mutex = new object (); readonly DummyDeserializer deserializer = new DummyDeserializer (); [Test] public void InitialUnicastEventTest () { var eventer = new DummyStateVariableEventer (); var root = CreateRoot (CreateServiceController (new StateVariable ("Foo", "string", new StateVariableOptions { Eventer = eventer }))); eventer.SetValue ("foo"); using (var server = new Server (root)) { server.Start (); var prefix = GeneratePrefix (); using (var listener = new HttpListener ()) { listener.Prefixes.Add (prefix); listener.Start (); Exception exception = null; listener.BeginGetContext (result => { try { var context = listener.EndGetContext (result); using (var reader = new StreamReader (context.Request.InputStream)) { Assert.AreEqual (Xml.SingleEventReport, reader.ReadToEnd ()); } context.Response.Close (); } catch (Exception e) { exception = e; } lock (mutex) { Monitor.Pulse (mutex); } }, null); Subscribe (root, prefix); if (exception != null) { throw exception; } } } } [Test] public void SingleUpdateUnicastEventTest () { var eventer1 = new DummyStateVariableEventer (); var eventer2 = new DummyStateVariableEventer (); var root = CreateRoot (CreateServiceController ( new StateVariable ("Foo", "string", new StateVariableOptions { Eventer = eventer1 }), new StateVariable ("Bar", "string", new StateVariableOptions { Eventer = eventer2 }) )); eventer1.SetValue ("foo"); eventer2.SetValue ("bar"); using (var server = new Server (root)) { server.Start (); var prefix = GeneratePrefix (); using (var listener = new HttpListener ()) { listener.Prefixes.Add (prefix); listener.Start (); Exception exception = null; listener.BeginGetContext (result => { try { var context = listener.EndGetContext (result); using (var reader = new StreamReader (context.Request.InputStream)) { Assert.AreEqual (Xml.DoubleEventReport, reader.ReadToEnd ()); } context.Response.Close (); listener.BeginGetContext (r => { try { var c = listener.EndGetContext (r); using (var reader = new StreamReader (c.Request.InputStream)) { Assert.AreEqual (Xml.SingleEventReport, reader.ReadToEnd ()); } c.Response.Close (); } catch (Exception e) { exception = e; } lock (mutex) { Monitor.Pulse (mutex); } }, null); } catch (Exception e) { exception = e; lock (mutex) { Monitor.Pulse (mutex); } } eventer1.SetValue ("foo"); }, null); Subscribe (root, prefix); if (exception != null) { throw exception; } } } } [Test] public void MultipleUpdateUnicastEventTest () { var eventer1 = new DummyStateVariableEventer (); var eventer2 = new DummyStateVariableEventer (); var root = CreateRoot (CreateServiceController ( new StateVariable ("Foo", "string", new StateVariableOptions { Eventer = eventer1 }), new StateVariable ("Bar", "string", new StateVariableOptions { Eventer = eventer2 }) )); eventer1.SetValue ("foo"); eventer2.SetValue ("bar"); using (var server = new Server (root)) { server.Start (); var prefix = GeneratePrefix (); using (var listener = new HttpListener ()) { listener.Prefixes.Add (prefix); listener.Start (); Exception exception = null; listener.BeginGetContext (result => { try { var context = listener.EndGetContext (result); using (var reader = new StreamReader (context.Request.InputStream)) { Assert.AreEqual (Xml.DoubleEventReport, reader.ReadToEnd ()); } context.Response.Close (); listener.BeginGetContext (resp => { try { var con = listener.EndGetContext (resp); using (var reader = new StreamReader (con.Request.InputStream)) { Assert.AreEqual (Xml.SingleEventReport, reader.ReadToEnd ()); } con.Response.Close (); listener.BeginGetContext (r => { try { var c = listener.EndGetContext (r); using (var reader = new StreamReader (c.Request.InputStream)) { Assert.AreEqual (Xml.DoubleEventReport, reader.ReadToEnd ()); } c.Response.Close (); } catch (Exception e) { exception = e; } lock (mutex) { Monitor.Pulse (mutex); } }, null); eventer1.SetValue ("foo"); eventer2.SetValue ("bar"); } catch (Exception e) { exception = e; lock (mutex) { Monitor.Pulse (mutex); } } }, null); eventer1.SetValue ("foo"); } catch (Exception e) { exception = e; lock (mutex) { Monitor.Pulse (mutex); } } }, null); Subscribe (root, prefix); if (exception != null) { throw exception; } } } } void Subscribe (Root root, string prefix) { var request = WebRequest.Create (new Uri (root.UrlBase, "/service/0/event/")); request.Method = "SUBSCRIBE"; request.Headers.Add ("CALLBACK", string.Format ("<{0}>", prefix)); request.Headers.Add ("NT", "upnp:event"); lock (mutex) { using (var response = (HttpWebResponse)request.GetResponse ()) { Assert.AreEqual (HttpStatusCode.OK, response.StatusCode); Assert.IsNotNull (response.Headers["SID"]); Assert.AreEqual ("Second-1800", response.Headers["TIMEOUT"]); } if (!Monitor.Wait (mutex, TimeSpan.FromSeconds (30))) { Assert.Fail ("Event publishing timed out."); } } } [Test] public void UnsubscribeUnicastEventTest () { string sid = null; var eventer = new DummyStateVariableEventer (); var root = CreateRoot (CreateServiceController (new StateVariable ("Foo", "string", new StateVariableOptions { Eventer = eventer }))); eventer.SetValue ("foo"); using (var server = new Server (root)) { server.Start (); var prefix = GeneratePrefix (); var url = new Uri (root.UrlBase, "/service/0/event/"); using (var listener = new HttpListener ()) { listener.Prefixes.Add (prefix); listener.Start (); Exception exception = null; listener.BeginGetContext (result => { lock (mutex) { try { var context = listener.EndGetContext (result); using (var reader = new StreamReader (context.Request.InputStream)) { Assert.AreEqual (Xml.SingleEventReport, reader.ReadToEnd ()); } context.Response.Close (); var unsub_request = WebRequest.Create (url); unsub_request.Method = "UNSUBSCRIBE"; unsub_request.Headers.Add ("SID", sid); using (var response = (HttpWebResponse)unsub_request.GetResponse ()) { Assert.AreEqual (HttpStatusCode.OK, response.StatusCode); } listener.BeginGetContext (r => { lock (mutex) { Monitor.Pulse (mutex); } }, null); eventer.SetValue ("foo"); } catch (Exception e) { exception = e; Monitor.Pulse (mutex); } } }, null); var request = WebRequest.Create (url); request.Method = "SUBSCRIBE"; request.Headers.Add ("CALLBACK", string.Format ("<{0}>", prefix)); request.Headers.Add ("NT", "upnp:event"); lock (mutex) { using (var response = (HttpWebResponse)request.GetResponse ()) { Assert.AreEqual (HttpStatusCode.OK, response.StatusCode); Assert.IsNotNull (response.Headers["SID"]); sid = response.Headers["SID"]; } if (Monitor.Wait (mutex, TimeSpan.FromSeconds (10))) { Assert.Fail ("The event server sent updates to an unsubscribed client."); } } if (exception != null) { throw exception; } } } } static ServiceController CreateServiceController () { return CreateServiceController (null); } static ServiceController CreateServiceController (StateVariable stateVariable) { return CreateServiceController (stateVariable, null); } static ServiceController CreateServiceController (StateVariable stateVariable1, StateVariable stateVariable2) { return new ServiceController ( new[] { new ServiceAction ( "Foo", new[] { new Argument ("bar", "X_ARG_bar", ArgumentDirection.In), new Argument ("result", "X_ARG_result", ArgumentDirection.Out) }, arguments => { var out_arguments = new Dictionary (1); out_arguments["result"] = string.Format ("You said {0}", arguments["bar"]); return out_arguments; } ) }, new[] { new StateVariable ("X_ARG_bar", "string"), new StateVariable ("X_ARG_result", "string"), stateVariable1, stateVariable2 } ); } [Test] public void ControlTest () { var root = CreateRoot (CreateServiceController ()); using (var server = new Server (root)) { server.Start (); var request = (HttpWebRequest)WebRequest.Create (new Uri (root.UrlBase, "/service/0/control/")); request.Method = "POST"; request.Headers.Add ("SOAPACTION", "urn:schemas-upnp-org:service:mono-upnp-test-service:1#Foo"); request.ContentType = @"text/xml; charset=""utf-8"""; var bytes = System.Text.Encoding.UTF8.GetBytes (Xml.SimpleSoapRequest); using (var stream = request.GetRequestStream ()) { stream.Write (bytes, 0, bytes.Length); } using (var response = (HttpWebResponse)request.GetResponse ()) { Assert.AreEqual (HttpStatusCode.OK, response.StatusCode); using (var stream = response.GetResponseStream ()) { using (var reader = XmlReader.Create (stream)) { reader.ReadToFollowing ("result"); Assert.AreEqual ("You said hello world!", reader.ReadElementContentAsString ()); } } } } } static Root CreateRoot (ServiceController controller) { return new DummyRoot ( new DeviceType ("schemas-upnp-org", "mono-upnp-tests-device", new Version (1, 0)), "uuid:d1", "Mono.Upnp.Tests Device", "Mono Project", "Device", new DeviceOptions { Services = new[] { new Service ( new ServiceType ("schemas-upnp-org", "mono-upnp-test-service", new Version (1, 0)), "urn:upnp-org:serviceId:testService1", controller ) } } ); } static Root CreateRoot () { return CreateRoot (null, null); } static Root CreateRoot (IEnumerable icons1, IEnumerable icons2) { return new DummyRoot ( new DeviceType ("schemas-upnp-org", "mono-upnp-tests-device", new Version (1, 0)), "uuid:d1", "Mono.Upnp.Tests Device", "Mono Project", "Device", new DeviceOptions { Icons = icons1, Services = new[] { new DummyService (new ServiceType ("schemas-upnp-org", "mono-upnp-test-service", new Version (1, 0)), "urn:upnp-org:serviceId:testService1"), new DummyService (new ServiceType ("schemas-upnp-org", "mono-upnp-test-service", new Version (2, 0)), "urn:upnp-org:serviceId:testService2"), }, EmbeddedDevices = new[] { new Device ( new DeviceType ("schemas-upnp-org", "mono-upnp-tests-embedded-device", new Version (1, 0)), "uuid:ed1", "Mono.Upnp.Tests Embedded Device", "Mono Project", "Embedded Device", new DeviceOptions { Icons = icons2, Services = new[] { new DummyService (new ServiceType ("schemas-upnp-org", "mono-upnp-test-service", new Version (1, 0)), "urn:upnp-org:serviceId:testService1"), new DummyService (new ServiceType ("schemas-upnp-org", "mono-upnp-test-service", new Version (2, 0)), "urn:upnp-org:serviceId:testService2"), } } ) } } ); } [Test] public void DescriptionTest () { var root = CreateRoot (); using (var server = new Server (root)) { server.Start (); var request = WebRequest.Create (root.UrlBase); using (var response = (HttpWebResponse)request.GetResponse ()) { Assert.AreEqual (HttpStatusCode.OK, response.StatusCode); using (var reader = XmlReader.Create (response.GetResponseStream ())) { var target_root = deserializer.DeserializeRoot (reader, root.UrlBase); DeviceDescriptionTests.AssertEquality (root, target_root); } } } } [Test] public void ScpdTest () { var controller = CreateServiceController (); var root = new DummyRoot ( new DeviceType ("schemas-upnp-org", "mono-upnp-tests-device", new Version (1, 0)), "uuid:d1", "Mono.Upnp.Tests Device", "Mono Project", "Device", new DeviceOptions { Services = new[] { new Service ( new ServiceType ("uschemas-upnp-org", "mono-upnp-test-service", new Version (1, 0)), "urn:upnp-org:serviceId:testService1", controller ) } } ); using (var server = new Server (root)) { server.Start (); var request = WebRequest.Create (new Uri (root.UrlBase, "/service/0/scpd/")); using (var response = (HttpWebResponse)request.GetResponse ()) { Assert.AreEqual (HttpStatusCode.OK, response.StatusCode); using (var reader = XmlReader.Create (response.GetResponseStream ())) { var target_controller = deserializer.DeserializeServiceController (reader); ServiceDescriptionTests.AssertEquality (controller, target_controller); } } } } [Test] public void IconTest () { var root = CreateRoot ( new[] { new Icon (100, 100, 32, "image/jpeg", new byte[] { 0 }), new Icon (100, 100, 32, "image/png", new byte[] { 1 }) }, new[] { new Icon (100, 100, 32, "image/jpeg", new byte[] { 2 }), new Icon (100, 100, 32, "image/png", new byte[] { 3 }) } ); using (var server = new Server (root)) { server.Start (); var url = new Uri (root.UrlBase, "/icon/"); AssertEquality (url, 0, 0); AssertEquality (url, 1, 1); url = new Uri (root.UrlBase, "/device/0/icon/"); AssertEquality (url, 0, 2); AssertEquality (url, 1, 3); } } static void AssertEquality (Uri url, int iconIndex, int iconValue) { var request = WebRequest.Create (new Uri (url, iconIndex.ToString ())); using (var response = (HttpWebResponse)request.GetResponse ()) { Assert.AreEqual (HttpStatusCode.OK, response.StatusCode); using (var stream = response.GetResponseStream ()) { Assert.AreEqual (iconValue, stream.ReadByte ()); Assert.AreEqual (-1, stream.ReadByte ()); } } } [Test] public void AnnouncementTest () { using (var server = new Server (CreateRoot ())) { using (var client = new Mono.Ssdp.Client ()) { var announcements = new Dictionary (); announcements.Add ("upnp:rootdevice/uuid:d1::upnp:rootdevice", null); announcements.Add ("uuid:d1/uuid:d1", null); announcements.Add ("urn:schemas-upnp-org:device:mono-upnp-tests-device:1/uuid:d1::urn:schemas-upnp-org:device:mono-upnp-tests-device:1", null); announcements.Add ("uuid:ed1/uuid:ed1", null); announcements.Add ("urn:schemas-upnp-org:device:mono-upnp-tests-embedded-device:1/uuid:ed1::urn:schemas-upnp-org:device:mono-upnp-tests-embedded-device:1", null); announcements.Add ("urn:schemas-upnp-org:service:mono-upnp-test-service:1/uuid:d1::urn:schemas-upnp-org:service:mono-upnp-test-service:1", null); announcements.Add ("urn:schemas-upnp-org:service:mono-upnp-test-service:2/uuid:d1::urn:schemas-upnp-org:service:mono-upnp-test-service:2", null); announcements.Add ("urn:schemas-upnp-org:service:mono-upnp-test-service:1/uuid:ed1::urn:schemas-upnp-org:service:mono-upnp-test-service:1", null); announcements.Add ("urn:schemas-upnp-org:service:mono-upnp-test-service:2/uuid:ed1::urn:schemas-upnp-org:service:mono-upnp-test-service:2", null); client.ServiceAdded += (obj, args) => { lock (mutex) { Assert.AreEqual (ServiceOperation.Added, args.Operation); var announcement = string.Format ("{0}/{1}", args.Service.ServiceType, args.Service.Usn); if (announcements.ContainsKey (announcement)) { announcements.Remove (announcement); } if (announcements.Count == 0) { Monitor.Pulse (mutex); } } }; client.BrowseAll (); lock (mutex) { server.Start (); if (!Monitor.Wait (mutex, TimeSpan.FromSeconds (30))) { Assert.Fail ("The UPnP server announcement timed out."); } } } } } static readonly Random random = new Random (); static string GeneratePrefix () { foreach (var address in Dns.GetHostAddresses (Dns.GetHostName ())) { if (address.AddressFamily == AddressFamily.InterNetwork) { return string.Format ( "http://{0}:{1}/mono-upnp-tests/event-subscriber/", address, random.Next (1024, 5000)); } } return null; } } } mono-upnp-0.1.2/tests/Mono.Upnp.Tests/XmlSerializationTests.cs0000664000175000017500000010206511714307244025673 0ustar00lorentzlorentz00000000000000// // XmlSerializationTests.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using System.Text; using NUnit.Framework; using Mono.Upnp.Xml; namespace Mono.Upnp.Tests { [TestFixture] public class XmlSerializationTests { readonly XmlSerializer serializer = new XmlSerializer (); class EmptyTestClass { public override string ToString () { return "Blarg!"; } } [Test] public void EmptyTest () { Assert.AreEqual ( @"Blarg!", serializer.GetString (new EmptyTestClass ()) ); } [Test] public void GetBytesTest () { Assert.AreEqual ( @"Blarg!", Encoding.UTF8.GetString (serializer.GetBytes (new EmptyTestClass ())) ); } [XmlType ("test")] class TypeTestClass { public override string ToString () { return "Blarg!"; } } [Test] public void TypeTest () { Assert.AreEqual ( @"Blarg!", serializer.GetString (new TypeTestClass ()) ); } [XmlType ("")] class TypeNameFallbackTestClass { public override string ToString () { return "Blarg!"; } } [Test] public void TypeNameFallbackTest () { Assert.AreEqual ( @"Blarg!", serializer.GetString (new TypeNameFallbackTestClass ()) ); } [XmlType ("test", "urn:mono-upnp:tests")] class TypeNamespaceTestClass { public override string ToString () { return "Blarg!"; } } [Test] public void TypeNamespaceTest () { Assert.AreEqual ( @"Blarg!", serializer.GetString (new TypeNamespaceTestClass ()) ); } [XmlType ("test", "urn:mono-upnp:tests", "test")] class TypePrefixTestClass { public override string ToString () { return "Blarg!"; } } [Test] public void TypePrefixTest () { Assert.AreEqual ( @"Blarg!", serializer.GetString (new TypePrefixTestClass ()) ); } class ElementTestClass { [XmlElement] public string Foo { get; set; } } [Test] public void ElementTest () { Assert.AreEqual ( @"bar", serializer.GetString (new ElementTestClass { Foo = "bar" }) ); } [Test] public void ElementIncludeIfNullTest () { Assert.AreEqual ( @"", serializer.GetString (new ElementTestClass ()) ); } class ElementOmitIfNullTestClass { [XmlElement (OmitIfNull = true)] public string Foo { get; set; } } [Test] public void ElementOmitIfNullTest () { Assert.AreEqual ( @"", serializer.GetString (new ElementOmitIfNullTestClass ()) ); } class ElementNameTestClass { [XmlElement ("foo")] public string Foo { get; set; } } [Test] public void ElementNameTest () { Assert.AreEqual ( @"bar", serializer.GetString (new ElementNameTestClass { Foo = "bar" }) ); } class ElementNameFallbackTestClass { [XmlElement ("")] public string Foo { get; set; } } [Test] public void ElementNameFallbackTest () { Assert.AreEqual ( @"bar", serializer.GetString (new ElementNameFallbackTestClass { Foo = "bar" }) ); } class ElementNamespaceTestClass { [XmlElement ("foo", "urn:mono-upnp:tests")] public string Foo { get; set; } } [Test] public void ElementNamespaceTest () { Assert.AreEqual ( @"bar", serializer.GetString (new ElementNamespaceTestClass { Foo = "bar" }) ); } class ElementPrefixTestClass { [XmlElement ("foo", "urn:mono-upnp:tests", "test")] public string Foo { get; set; } } [Test] public void ElementPrefixTest () { Assert.AreEqual ( @"bar", serializer.GetString (new ElementPrefixTestClass { Foo = "bar" }) ); } class AttributeTestClass { [XmlAttribute] public string Foo { get; set; } } [Test] public void AttributeTest () { Assert.AreEqual ( @"", serializer.GetString (new AttributeTestClass { Foo = "bar" }) ); } [Test] public void AttributeIncludeIfNullTest () { Assert.AreEqual ( @"", serializer.GetString (new AttributeTestClass ()) ); } class AttributeOmitIfNullTestClass { [XmlAttribute (OmitIfNull = true)] public string Foo { get; set; } } [Test] public void AttributeOmitIfNullTest () { Assert.AreEqual ( @"", serializer.GetString (new AttributeOmitIfNullTestClass ()) ); } class AttributeNameTestClass { [XmlAttribute ("foo")] public string Foo { get; set; } } [Test] public void AttributeNameTest () { Assert.AreEqual ( @"", serializer.GetString (new AttributeNameTestClass { Foo = "bar" }) ); } class AttributeNameFallbackTestClass { [XmlAttribute ("")] public string Foo { get; set; } } [Test] public void AttributeNameFallbackTest () { Assert.AreEqual ( @"", serializer.GetString (new AttributeNameFallbackTestClass { Foo = "bar" }) ); } class AttributeNamespaceTestClass { [XmlAttribute ("foo", "urn:mono-upnp:tests")] public string Foo { get; set; } } [Test] public void AttributeNamespaceTest () { var xml = serializer.GetString (new AttributeNamespaceTestClass { Foo = "bar" }); using (var string_reader = new System.IO.StringReader (xml)) { using (var xml_reader = System.Xml.XmlReader.Create (string_reader)) { Assert.IsTrue (xml_reader.ReadToFollowing ("AttributeNamespaceTestClass")); Assert.IsTrue (xml_reader.MoveToFirstAttribute ()); Assert.AreEqual ("foo", xml_reader.LocalName); Assert.AreEqual ("urn:mono-upnp:tests", xml_reader.NamespaceURI); Assert.AreEqual ("bar", xml_reader.Value); } } } class AttributePrefixTestClass { [XmlAttribute ("foo", "urn:mono-upnp:tests", "test")] public string Foo { get; set; } } [Test] public void AttributePrefixTest () { Assert.AreEqual ( @"", serializer.GetString (new AttributePrefixTestClass { Foo = "bar" }) ); } class FlagTestClass { [XmlFlag] public bool Foo { get; set; } } [Test] public void FlagPresentTest () { Assert.AreEqual ( @"", serializer.GetString (new FlagTestClass { Foo = true }) ); } [Test] public void FlagAbsentTest () { Assert.AreEqual ( @"", serializer.GetString (new FlagTestClass { Foo = false }) ); } class FlagNameTestClass { [XmlFlag ("foo")] public bool Foo { get; set; } } [Test] public void FlagNameTest () { Assert.AreEqual ( @"", serializer.GetString (new FlagNameTestClass { Foo = true }) ); } class FlagNameFallbackTestClass { [XmlFlag ("")] public bool Foo { get; set; } } [Test] public void FlagNameFallbackTest () { Assert.AreEqual ( @"", serializer.GetString (new FlagNameFallbackTestClass { Foo = true }) ); } class FlagNamespaceTestClass { [XmlFlag ("foo", "urn:mono-upnp:tests")] public bool Foo { get; set; } } [Test] public void FlagNamespaceTest () { Assert.AreEqual ( @"", serializer.GetString (new FlagNamespaceTestClass { Foo = true }) ); } class FlagPrefixTestClass { [XmlFlag ("foo", "urn:mono-upnp:tests", "test")] public bool Foo { get; set; } } [Test] public void FlagPrefixTest () { Assert.AreEqual ( @"", serializer.GetString (new FlagPrefixTestClass { Foo = true }) ); } class Item { [XmlAttribute] public string Name { get; set; } } class ArrayTestClass { [XmlArray] public Item[] Items { get; set; } } [Test] public void ArrayTest () { Assert.AreEqual ( @"", serializer.GetString (new ArrayTestClass { Items = new[] { new Item { Name = "Foo" }, new Item { Name = "Bar"} } }) ); } class ArrayNameTestClass { [XmlArray ("items")] public Item[] Items { get; set; } } [Test] public void ArrayNameTest () { Assert.AreEqual ( @"", serializer.GetString (new ArrayNameTestClass { Items = new[] { new Item { Name = "Foo" }, new Item { Name = "Bar"} } }) ); } class ArrayNameFallbackTestClass { [XmlArray ("")] public Item[] Items { get; set; } } [Test] public void ArrayNameFallbackTest () { Assert.AreEqual ( @"", serializer.GetString (new ArrayNameFallbackTestClass { Items = new[] { new Item { Name = "Foo" }, new Item { Name = "Bar"} } }) ); } class ArrayNamespaceTestClass { [XmlArray ("items", "udn:mono-upnp:tests")] public Item[] Items { get; set; } } [Test] public void ArrayNamespaceTest () { Assert.AreEqual ( @"", serializer.GetString (new ArrayNamespaceTestClass { Items = new[] { new Item { Name = "Foo" }, new Item { Name = "Bar"} } }) ); } class ArrayPrefixTestClass { [XmlArray ("items", "udn:mono-upnp:tests", "test")] public Item[] Items { get; set; } } [Test] public void ArrayPrefixTest () { Assert.AreEqual ( @"", serializer.GetString (new ArrayPrefixTestClass { Items = new[] { new Item { Name = "Foo" }, new Item { Name = "Bar"} } }) ); } [XmlType ("item")] class NamedItem { [XmlAttribute] public string Value { get; set; } } class NamedArrayItemTestClass { [XmlArray] public NamedItem[] Items { get; set; } } [Test] public void NamedArrayItemTest () { Assert.AreEqual ( @"", serializer.GetString (new NamedArrayItemTestClass { Items = new[] { new NamedItem { Value = "Foo" }, new NamedItem { Value = "Bar"} } }) ); } class NamelessArrayItemTestClass { [XmlArray, XmlArrayItem] public Item[] Items { get; set; } } [Test] public void NamelessArrayItemTest () { Assert.AreEqual ( @"", serializer.GetString (new NamelessArrayItemTestClass { Items = new[] { new Item { Name = "Foo" }, new Item { Name = "Bar"} } }) ); } class ArrayItemNameTestClass { [XmlArray, XmlArrayItem ("item")] public Item[] Items { get; set; } } [Test] public void ArrayItemNameTest () { Assert.AreEqual ( @"", serializer.GetString (new ArrayItemNameTestClass { Items = new[] { new Item { Name = "Foo" }, new Item { Name = "Bar"} } }) ); } class ArrayItemNameFallbackTestClass { [XmlArray, XmlArrayItem ("")] public Item[] Items { get; set; } } [Test] public void ArrayItemNameFallbackTest () { Assert.AreEqual ( @"", serializer.GetString (new ArrayItemNameFallbackTestClass { Items = new[] { new Item { Name = "Foo" }, new Item { Name = "Bar"} } }) ); } class ArrayItemNamespaceTestClass { [XmlArray, XmlArrayItem ("item", "udn:mono-upnp:tests")] public Item[] Items { get; set; } } [Test] public void ArrayItemNamespaceTest () { Assert.AreEqual ( @"", serializer.GetString (new ArrayItemNamespaceTestClass { Items = new[] { new Item { Name = "Foo" }, new Item { Name = "Bar"} } }) ); } class ArrayItemPrefixTestClass { [XmlArray, XmlArrayItem ("item", "udn:mono-upnp:tests", "test")] public Item[] Items { get; set; } } [Test] public void ArrayItemPrefixTest () { Assert.AreEqual ( @"", serializer.GetString (new ArrayItemPrefixTestClass { Items = new[] { new Item { Name = "Foo" }, new Item { Name = "Bar"} } }) ); } class ArrayIEnumerableTestClass { [XmlArray] public IEnumerable Items { get; set; } } [Test] public void ArrayIEnumerableTest () { Assert.AreEqual ( @"", serializer.GetString (new ArrayIEnumerableTestClass { Items = new[] { new Item { Name = "Foo" }, new Item { Name = "Bar"} } }) ); } class RecursiveTestClass { [XmlElement (OmitIfNull = true)] public RecursiveTestClass Child { get; set; } } [Test] public void RecursiveTest () { Assert.AreEqual ( @"", serializer.GetString (new RecursiveTestClass { Child = new RecursiveTestClass () }) ); } class PrivateTestClass { readonly string foo; public PrivateTestClass (string foo) { this.foo = foo; } #pragma warning disable 0169 [XmlAttribute] string Foo { get { return foo; } } #pragma warning restore 0169 } [Test] public void PrivateTest () { Assert.AreEqual ( @"", serializer.GetString (new PrivateTestClass ("bar")) ); } class IXmlSerializableTypeTestClass : IXmlSerializable { public string Foo { get; set; } public void Serialize (XmlSerializationContext context) { context.Writer.WriteStartElement ("test"); SerializeMembers (context); context.Writer.WriteEndElement (); } public void SerializeMembers (XmlSerializationContext context) { context.Writer.WriteAttributeString ("foo", Foo); } } [Test] public void IXmlSerializationTypeTest () { Assert.AreEqual ( @"", serializer.GetString (new IXmlSerializableTypeTestClass { Foo = "bar" }) ); } class IXmlSerializableMembersTestClass { [XmlElement] public IXmlSerializableTypeTestClass Info { get; set; } } [Test] public void IXmlSerializationMembersTest () { Assert.AreEqual ( @"", serializer.GetString (new IXmlSerializableMembersTestClass { Info = new IXmlSerializableTypeTestClass { Foo = "bar" } }) ); } class OverrideTestBaseClass { [XmlElement] public virtual string Foo { get; set; } } class OverrideTestSubClass : OverrideTestBaseClass { [XmlElement ("foo")] public override string Foo { get { return base.Foo; } set { base.Foo = value; } } } [Test] public void OverrideTest () { Assert.AreEqual ( @"bar", serializer.GetString (new OverrideTestSubClass { Foo = "bar" }) ); Assert.AreEqual ( @"bar", serializer.GetString (new OverrideTestSubClass { Foo = "bar" }) ); } class OverrideOmitTestSubClass : OverrideTestBaseClass { public override string Foo { get { return base.Foo; } set { base.Foo = value; } } public override string ToString () { return null; } } [Test] public void OverrideOmitTest () { Assert.AreEqual ( @"", serializer.GetString (new OverrideOmitTestSubClass { Foo = "bar" }) ); Assert.AreEqual ( @"bar", serializer.GetString (new OverrideOmitTestSubClass { Foo = "bar" }) ); } [XmlType ("test")] class XmlSerializableTestBaseClass : XmlSerializable { [XmlAttribute] public virtual string Foo { get; set; } protected override void Serialize (XmlSerializationContext context) { context.AutoSerializeObjectStart (this); SerializeMembers (context); context.AutoSerializeObjectEnd (this); } protected override void SerializeMembers (XmlSerializationContext context) { context.AutoSerializeMembers (this); } } class XmlSerializableTestSubClass : XmlSerializableTestBaseClass { [XmlAttribute ("foo")] public override string Foo { get { return base.Foo; } set { base.Foo = value; } } protected override void SerializeMembers (XmlSerializationContext context) { context.AutoSerializeMembers (this); } } [Test] public void XmlSerializableTest () { Assert.AreEqual ( @"", serializer.GetString (new XmlSerializableTestSubClass { Foo = "bar" }) ); Assert.AreEqual ( @"", serializer.GetString (new XmlSerializableTestSubClass { Foo = "bar" }) ); } class DoNotSerializeTestClass { [DoNotSerialize, XmlAttribute] public string Foo { get; set; } [DoNotSerialize, XmlElement] public string Bar { get; set; } [XmlAttribute] public string Bat { get; set; } [XmlElement] public string Baz { get; set; } } [Test] public void DoNotSerializeTest () { Assert.AreEqual ( @"baz", serializer.GetString (new DoNotSerializeTestClass { Foo = "foo", Bar = "bar", Bat = "bat", Baz = "baz" }) ); } enum EnumTestEnum { [XmlEnum ("foo")] Foo, [XmlEnum ("bar")] Bar, [XmlEnum ("bat")] Bat } class EnumTestClass { [XmlAttribute] public EnumTestEnum Thing { get; set; } [XmlElement] public EnumTestEnum Doohicky { get; set; } } [Test] public void EnumTest () { Assert.AreEqual ( @"bat", serializer.GetString (new EnumTestClass { Thing = EnumTestEnum.Bar, Doohicky = EnumTestEnum.Bat }) ); } [XmlNamespace ("udn:mono-upnp:bar", "b")] [XmlNamespace ("udn:mono-upnp:foo", "f")] class NamespaceTestClass { [XmlElement (Namespace = "udn:mono-upnp:foo")] public string Foo { get; set; } [XmlElement (Namespace = "udn:mono-upnp:bar")] public string Bar { get; set; } } [Test] public void NamespaceTest () { Assert.AreEqual ( @"foobar", serializer.GetString (new NamespaceTestClass { Foo = "foo", Bar = "bar" })); } class ValueTestClass { [XmlValue] public string Foo { get; set; } } [Test] public void ValueTest () { Assert.AreEqual ( @"bar", serializer.GetString (new ValueTestClass { Foo = "bar" })); } class FreeArrayItemTestClass { [XmlArrayItem ("Foo")] public IEnumerable Foos { get; set; } } [Test] public void FreeArrayItemTest () { Assert.AreEqual ( @"foobarbat", serializer.GetString (new FreeArrayItemTestClass { Foos = new[] { "foo", "bar", "bat" } })); } class FreeNamelessArrayItemTestClass { [XmlArrayItem] public IEnumerable Foos { get; set; } } [Test] public void FreeNamelessArrayItemTest () { Assert.AreEqual ( @"Blarg!Blarg!", serializer.GetString (new FreeNamelessArrayItemTestClass { Foos = new[] { new TypeTestClass (), new TypeTestClass () } })); } class NullableOmitIfNullClass { [XmlElement (OmitIfNull = true)] public int? Foo { get; set; } } [Test] public void NullableNotNullTest () { Assert.AreEqual ( @"42", serializer.GetString (new NullableOmitIfNullClass { Foo = 42 })); } [Test] public void NullableOmitIfNullTest () { Assert.AreEqual ( @"", serializer.GetString (new NullableOmitIfNullClass ())); } class NullableIncludeIfNullTestClass { [XmlElement] public int? Foo { get; set; } } [Test] public void NullableIncludeIfNullTest () { Assert.AreEqual ( @"", serializer.GetString (new NullableIncludeIfNullTestClass ())); } class SerializationContextTestClass : IXmlSerializable { [XmlElement (OmitIfNull = true)] public SerializationContextTestClass Child { get; set; } public void Serialize (XmlSerializationContext context) { context.AutoSerializeObjectStart (this); SerializeMembers (context); context.AutoSerializeObjectEnd (this); } public void SerializeMembers (XmlSerializationContext context) { context.Writer.WriteAttributeString ("depth", context.Context.ToString ()); context.AutoSerializeMembers (this, context.Context + 1); } } [Test] public void SerializationContextTest () { var serializer = new XmlSerializer (); Assert.AreEqual ( @"", serializer.GetString (new SerializationContextTestClass { Child = new SerializationContextTestClass { Child = new SerializationContextTestClass () } }, new XmlSerializationOptions { Context = 0 })); } [Test] public void DeclarationTest () { Assert.AreEqual ( @"Blarg!", serializer.GetString (new EmptyTestClass (), new XmlSerializationOptions { XmlDeclarationType = XmlDeclarationType.VersionAndEncoding }) ); Assert.AreEqual ( @"Blarg!", serializer.GetString (new EmptyTestClass (), new XmlSerializationOptions { XmlDeclarationType = XmlDeclarationType.VersionAndEncoding, Encoding = new UTF32Encoding(false, false) } ) ); Assert.AreEqual ( @"Blarg!", serializer.GetString (new EmptyTestClass (), new XmlSerializationOptions { XmlDeclarationType = XmlDeclarationType.Version }) ); Assert.AreEqual ( @"Blarg!", serializer.GetString (new EmptyTestClass (), new XmlSerializationOptions { XmlDeclarationType = XmlDeclarationType.None }) ); } } } mono-upnp-0.1.2/tests/Mono.Upnp.Tests/DummyRoot.cs0000664000175000017500000000357511714307244023317 0ustar00lorentzlorentz00000000000000// // DummyRoot.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; namespace Mono.Upnp.Tests { public class DummyRoot : Root { public DummyRoot (DeviceType type, string udn, string friendlyName, string manufacturer, string modelName) : this (type, udn, friendlyName, manufacturer, modelName, null) { } public DummyRoot (DeviceType type, string udn, string friendlyName, string manufacturer, string modelName, DeviceOptions options) : base (type, udn, friendlyName, manufacturer, modelName, options) { } public void Initialize () { Initialize (null, new Uri ("http://localhost:8080")); } } } mono-upnp-0.1.2/tests/Mono.Upnp.Tests/DummyServiceAction.cs0000664000175000017500000000340011714307244025115 0ustar00lorentzlorentz00000000000000// // DummyServiceAction.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using Mono.Upnp.Control; namespace Mono.Upnp.Tests { public class DummyServiceAction : ServiceAction { static IDictionary Executor (IDictionary arguments) { return arguments; } public DummyServiceAction (string name) : this (name, null) { } public DummyServiceAction (string name, IEnumerable arguments) : base (name, arguments, Executor) { } } } mono-upnp-0.1.2/tests/Mono.Upnp.Tests/ServiceTests.cs0000664000175000017500000011012011714307244023764 0ustar00lorentzlorentz00000000000000// // ServiceTests.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using NUnit.Framework; using Mono.Upnp.Control; namespace Mono.Upnp.Tests { [TestFixture] public class ServiceTests { class ActionTestClass { [UpnpAction] public void Foo () { } } [Test] public void ActionTest () { var service = new DummyService (); var controller = new ServiceController (new[] { new DummyServiceAction ("Foo") }, null); ServiceDescriptionTests.AssertEquality (controller, service.GetController ()); } class ActionNameTestClass { [UpnpAction ("foo")] public void Foo () { } } [Test] public void ActionNameTest () { var service = new DummyService (); var controller = new ServiceController (new[] { new DummyServiceAction ("foo") }, null); ServiceDescriptionTests.AssertEquality (controller, service.GetController ()); } class ArgumentTestClass { [UpnpAction] public void Foo (string bar) { } } [Test] public void ArgumentTest () { var service = new DummyService (); var controller = new ServiceController ( new[] { new DummyServiceAction ("Foo", new[] { new Argument ("bar", "A_ARG_bar", ArgumentDirection.In) }) }, new[] { new StateVariable ("A_ARG_bar", "string") } ); ServiceDescriptionTests.AssertEquality (controller, service.GetController ()); } class OutArgumentTestClass { [UpnpAction] public void Foo (out string bar) { bar = string.Empty; } } [Test] public void OutArgumentTest () { var service = new DummyService (); var controller = new ServiceController ( new[] { new DummyServiceAction ("Foo", new[] { new Argument ("bar", "A_ARG_bar", ArgumentDirection.Out) }) }, new[] { new StateVariable ("A_ARG_bar", "string") } ); ServiceDescriptionTests.AssertEquality (controller, service.GetController ()); } class RefArgumentTestClass { [UpnpAction] public void Foo (ref string bar) { } } [Test] public void RefArgumentTest () { var service = new DummyService (); var controller = new ServiceController ( new[] { new DummyServiceAction ("Foo", new[] { new Argument ("bar", "A_ARG_bar", ArgumentDirection.Out) }) }, new[] { new StateVariable ("A_ARG_bar", "string") } ); ServiceDescriptionTests.AssertEquality (controller, service.GetController ()); } class ReturnArgumentTestClass { [UpnpAction] public string Foo () { return string.Empty; } } [Test] public void ReturnArgumentTest () { var service = new DummyService (); var controller = new ServiceController ( new[] { new DummyServiceAction ("Foo", new[] { new Argument ("result", "A_ARG_result", ArgumentDirection.Out, true) }) }, new[] { new StateVariable ("A_ARG_result", "string") } ); ServiceDescriptionTests.AssertEquality (controller, service.GetController ()); } class ArgumentNameTestClass { [UpnpAction] public void Foo ([UpnpArgument ("Bar")]string bar) { } } [Test] public void ArgumentNameTest () { var service = new DummyService (); var controller = new ServiceController ( new[] { new DummyServiceAction ("Foo", new[] { new Argument ("Bar", "A_ARG_Bar", ArgumentDirection.In) }) }, new[] { new StateVariable ("A_ARG_Bar", "string") } ); ServiceDescriptionTests.AssertEquality (controller, service.GetController ()); } class ReturnArgumentNameTestClass { [UpnpAction] [return: UpnpArgument ("foo")] public string Foo () { return null; } } [Test] public void ReturnArgumentNameTest () { var service = new DummyService (); var controller = new ServiceController ( new[] { new DummyServiceAction ("Foo", new[] { new Argument ("foo", "A_ARG_foo", ArgumentDirection.Out, true) }) }, new[] { new StateVariable ("A_ARG_foo", "string") } ); ServiceDescriptionTests.AssertEquality (controller, service.GetController ()); } class ReturnArgumentDirectionTestClass { [UpnpAction] public string Foo() { return null; } } [Test] public void ReturnArgumentDirectionTest () { var service = new DummyService (); var controller = new ServiceController ( new[] { new DummyServiceAction ("Foo", new[] { new Argument ("result", "A_ARG_result", ArgumentDirection.Out, true) }) }, new[] { new StateVariable ("A_ARG_result", "string") } ); ServiceDescriptionTests.AssertEquality (controller, service.GetController()); } class RelatedStateVariableNameTestClass { [UpnpAction] public void Foo ([UpnpRelatedStateVariable ("X_ARG_bar")]string bar) { } } [Test] public void RelatedStateVariableNameTest () { var service = new DummyService (); var controller = new ServiceController ( new[] { new DummyServiceAction ("Foo", new[] { new Argument ("bar", "X_ARG_bar", ArgumentDirection.In) }) }, new[] { new StateVariable ("X_ARG_bar", "string") } ); ServiceDescriptionTests.AssertEquality (controller, service.GetController ()); } class ReturnArgumentRelatedStateVariableNameTestClass { [UpnpAction] [return: UpnpRelatedStateVariable ("X_ARG_foo")] public string Foo () { return null; } } [Test] public void ReturnArgumentRelatedStateVariableNameTest () { var service = new DummyService (); var controller = new ServiceController ( new[] { new DummyServiceAction ("Foo", new[] { new Argument ("result", "X_ARG_foo", ArgumentDirection.Out, true) }) }, new[] { new StateVariable ("X_ARG_foo", "string") } ); ServiceDescriptionTests.AssertEquality (controller, service.GetController ()); } class RelatedStateVariableDataTypeTestClass { [UpnpAction] public void Foo ([UpnpRelatedStateVariable (DataType = "string.foo")]string bar) { } } [Test] public void RelatedStateVariableDataTypeTest () { var service = new DummyService (); var controller = new ServiceController ( new[] { new DummyServiceAction ("Foo", new[] { new Argument ("bar", "A_ARG_bar", ArgumentDirection.In) }) }, new[] { new StateVariable ("A_ARG_bar", "string.foo") } ); ServiceDescriptionTests.AssertEquality (controller, service.GetController ()); } class RelatedStateVariableDefaultValueTestClass { [UpnpAction] public void Foo ([UpnpRelatedStateVariable (DefaultValue = "hey")]string bar) { } } [Test] public void RelatedStateVariableDefaultValueTest () { var service = new DummyService (); var controller = new ServiceController ( new[] { new DummyServiceAction ("Foo", new[] { new Argument ("bar", "A_ARG_bar", ArgumentDirection.In) }) }, new[] { new StateVariable ("A_ARG_bar", "string", new StateVariableOptions { DefaultValue = "hey" }) } ); ServiceDescriptionTests.AssertEquality (controller, service.GetController ()); } class RelatedStateVariableAllowedValueRangeTestClass { [UpnpAction] public void Foo ([UpnpRelatedStateVariable ("0", "100", StepValue = "2")]int bar) { } } [Test] public void RelatedStateVariableAllowedValueRangeTest () { var service = new DummyService (); var controller = new ServiceController ( new[] { new DummyServiceAction ("Foo", new[] { new Argument ("bar", "A_ARG_bar", ArgumentDirection.In) }) }, new[] { new StateVariable ("A_ARG_bar", "i4", new AllowedValueRange ("0", "100", "2")) } ); ServiceDescriptionTests.AssertEquality (controller, service.GetController ()); } enum EnumArgumentTestEnum { Foo, Bar } class EnumArgumentTestClass { [UpnpAction] public void Foo (EnumArgumentTestEnum bar) { } } [Test] public void EnumArgumentTest () { var service = new DummyService (); var controller = new ServiceController ( new[] { new DummyServiceAction ("Foo", new[] { new Argument ("bar", "A_ARG_bar", ArgumentDirection.In) }) }, new[] { new StateVariable ("A_ARG_bar", new[] { "Foo", "Bar" }) } ); ServiceDescriptionTests.AssertEquality (controller, service.GetController ()); } enum EnumArgumentNameTestEnum { [UpnpEnum ("foo")] Foo, [UpnpEnum ("bar")] Bar } class EnumArgumentNameTestClass { [UpnpAction] public void Foo (EnumArgumentNameTestEnum bar) { } } [Test] public void EnumArgumentNameTest () { var service = new DummyService (); var controller = new ServiceController ( new[] { new DummyServiceAction ("Foo", new[] { new Argument ("bar", "A_ARG_bar", ArgumentDirection.In) }) }, new[] { new StateVariable ("A_ARG_bar", new[] { "foo", "bar" }) } ); ServiceDescriptionTests.AssertEquality (controller, service.GetController ()); } class ArgumentNameAgreementTestClass { [UpnpAction] public void Foo (string bar) { } [UpnpAction] public void Bar (string bar) { } } [Test] public void ArgumentNameAgreementTest () { var service = new DummyService (); var controller = new ServiceController ( new[] { new DummyServiceAction ("Foo", new[] { new Argument ("bar", "A_ARG_bar", ArgumentDirection.In) }), new DummyServiceAction ("Bar", new[] { new Argument ("bar", "A_ARG_bar", ArgumentDirection.In) }) }, new[] { new StateVariable ("A_ARG_bar", "string") } ); ServiceDescriptionTests.AssertEquality (controller, service.GetController ()); } class ArgumentTypeConflictTestClass { [UpnpAction] public void Foo (string bar) { } [UpnpAction] public void Bar (int bar) { } } [Test] public void ArgumentTypeConflictTest () { var service = new DummyService (); var controller = new ServiceController ( new[] { new DummyServiceAction ("Foo", new[] { new Argument ("bar", "A_ARG_bar", ArgumentDirection.In) }), new DummyServiceAction ("Bar", new[] { new Argument ("bar", "A_ARG_Bar_bar", ArgumentDirection.In) }) }, new[] { new StateVariable ("A_ARG_bar", "string"), new StateVariable ("A_ARG_Bar_bar", "i4") } ); ServiceDescriptionTests.AssertEquality (controller, service.GetController ()); } class RelatedStateVariableAllowedValueRangeConflictTest1Class { [UpnpAction] public void Foo (int bar) { } [UpnpAction] public void Bar ([UpnpRelatedStateVariable("0", "100")] int bar) { } } [Test] public void RelatedStateVariableAllowedValueRangeConflictTest1 () { var service = new DummyService (); var controller = new ServiceController ( new[] { new DummyServiceAction ("Foo", new[] { new Argument ("bar", "A_ARG_bar", ArgumentDirection.In) }), new DummyServiceAction ("Bar", new[] { new Argument ("bar", "A_ARG_Bar_bar", ArgumentDirection.In) }) }, new[] { new StateVariable ("A_ARG_bar", "i4"), new StateVariable ("A_ARG_Bar_bar", "i4", new AllowedValueRange ("0", "100")) } ); ServiceDescriptionTests.AssertEquality (controller, service.GetController ()); } class RelatedStateVariableAllowedValueRangeConflictTest2Class { [UpnpAction] public void Foo ([UpnpRelatedStateVariable("0", "100")] int bar) { } [UpnpAction] public void Bar (int bar) { } } [Test] public void RelatedStateVariableAllowedValueRangeConflictTest2 () { var service = new DummyService (); var controller = new ServiceController ( new[] { new DummyServiceAction ("Foo", new[] { new Argument ("bar", "A_ARG_bar", ArgumentDirection.In) }), new DummyServiceAction ("Bar", new[] { new Argument ("bar", "A_ARG_Bar_bar", ArgumentDirection.In) }) }, new[] { new StateVariable ("A_ARG_bar", "i4", new AllowedValueRange ("0", "100")), new StateVariable ("A_ARG_Bar_bar", "i4") } ); ServiceDescriptionTests.AssertEquality (controller, service.GetController ()); } class RelatedStateVariableAllowedValueRangeConflictTest3Class { [UpnpAction] public void Foo ([UpnpRelatedStateVariable("0", "100")] int bar) { } [UpnpAction] public void Bar ([UpnpRelatedStateVariable("0", "101")] int bar) { } } [Test] public void RelatedStateVariableAllowedValueRangeConflictTest3 () { var service = new DummyService (); var controller = new ServiceController ( new[] { new DummyServiceAction ("Foo", new[] { new Argument ("bar", "A_ARG_bar", ArgumentDirection.In) }), new DummyServiceAction ("Bar", new[] { new Argument ("bar", "A_ARG_Bar_bar", ArgumentDirection.In) }) }, new[] { new StateVariable ("A_ARG_bar", "i4", new AllowedValueRange ("0", "100")), new StateVariable ("A_ARG_Bar_bar", "i4", new AllowedValueRange ("0", "101")) } ); ServiceDescriptionTests.AssertEquality (controller, service.GetController ()); } class RelatedStateVariableAllowedValuesConflictTest1Class { [UpnpAction] public void Foo (string bar) { } [UpnpAction] public void Bar (EnumArgumentTestEnum bar) { } } [Test] public void RelatedStateVariableAllowedValuesConflictTest1 () { var service = new DummyService (); var controller = new ServiceController ( new[] { new DummyServiceAction ("Foo", new[] { new Argument ("bar", "A_ARG_bar", ArgumentDirection.In) }), new DummyServiceAction ("Bar", new[] { new Argument ("bar", "A_ARG_Bar_bar", ArgumentDirection.In) }) }, new[] { new StateVariable ("A_ARG_bar", "string"), new StateVariable ("A_ARG_Bar_bar", new[] { "Foo", "Bar" }) } ); ServiceDescriptionTests.AssertEquality (controller, service.GetController ()); } class RelatedStateVariableAllowedValuesConflictTest2Class { [UpnpAction] public void Foo (EnumArgumentTestEnum bar) { } [UpnpAction] public void Bar (string bar) { } } [Test] public void RelatedStateVariableAllowedValuesConflictTest2 () { var service = new DummyService (); var controller = new ServiceController ( new[] { new DummyServiceAction ("Foo", new[] { new Argument ("bar", "A_ARG_bar", ArgumentDirection.In) }), new DummyServiceAction ("Bar", new[] { new Argument ("bar", "A_ARG_Bar_bar", ArgumentDirection.In) }) }, new[] { new StateVariable ("A_ARG_bar", new[] { "Foo", "Bar" }), new StateVariable ("A_ARG_Bar_bar", "string") } ); ServiceDescriptionTests.AssertEquality (controller, service.GetController ()); } class RelatedStateVariableAllowedValuesConflictTest3Class { [UpnpAction] public void Foo (EnumArgumentTestEnum bar) { } [UpnpAction] public void Bar (EnumArgumentNameTestEnum bar) { } } [Test] public void RelatedStateVariableAllowedValuesConflictTest3 () { var service = new DummyService (); var controller = new ServiceController ( new[] { new DummyServiceAction ("Foo", new[] { new Argument ("bar", "A_ARG_bar", ArgumentDirection.In) }), new DummyServiceAction ("Bar", new[] { new Argument ("bar", "A_ARG_Bar_bar", ArgumentDirection.In) }) }, new[] { new StateVariable ("A_ARG_bar", new[] { "Foo", "Bar" }), new StateVariable ("A_ARG_Bar_bar", new[] { "foo", "bar" }) } ); ServiceDescriptionTests.AssertEquality (controller, service.GetController ()); } class ArgumentsTestClass { [UpnpAction] public void Foo (string stringArg, int intArg, byte byteArg, ushort ushortArg, uint uintArg, sbyte sbyteArg, short shortArg, long longArg, float floatArg, double doubleArg, char charArg, DateTime dateTimeArg, bool boolArg, byte[] byteArrayArg, Uri uriArg) { } } [Test] public void ArgumentsTest () { var service = new DummyService (); var controller = new ServiceController ( new[] { new DummyServiceAction ("Foo", new[] { new Argument ("stringArg", "A_ARG_stringArg", ArgumentDirection.In), new Argument ("intArg", "A_ARG_intArg", ArgumentDirection.In), new Argument ("byteArg", "A_ARG_byteArg", ArgumentDirection.In), new Argument ("ushortArg", "A_ARG_ushortArg", ArgumentDirection.In), new Argument ("uintArg", "A_ARG_uintArg", ArgumentDirection.In), new Argument ("sbyteArg", "A_ARG_sbyteArg", ArgumentDirection.In), new Argument ("shortArg", "A_ARG_shortArg", ArgumentDirection.In), new Argument ("longArg", "A_ARG_longArg", ArgumentDirection.In), new Argument ("floatArg", "A_ARG_floatArg", ArgumentDirection.In), new Argument ("doubleArg", "A_ARG_doubleArg", ArgumentDirection.In), new Argument ("charArg", "A_ARG_charArg", ArgumentDirection.In), new Argument ("dateTimeArg", "A_ARG_dateTimeArg", ArgumentDirection.In), new Argument ("boolArg", "A_ARG_boolArg", ArgumentDirection.In), new Argument ("byteArrayArg", "A_ARG_byteArrayArg", ArgumentDirection.In), new Argument ("uriArg", "A_ARG_uriArg", ArgumentDirection.In) }) }, new[] { new StateVariable ("A_ARG_stringArg", "string"), new StateVariable ("A_ARG_intArg", "i4"), new StateVariable ("A_ARG_byteArg", "ui1"), new StateVariable ("A_ARG_ushortArg", "ui2"), new StateVariable ("A_ARG_uintArg", "ui4"), new StateVariable ("A_ARG_sbyteArg", "i1"), new StateVariable ("A_ARG_shortArg", "i2"), new StateVariable ("A_ARG_longArg", "int"), new StateVariable ("A_ARG_floatArg", "r4"), new StateVariable ("A_ARG_doubleArg", "r8"), new StateVariable ("A_ARG_charArg", "char"), new StateVariable ("A_ARG_dateTimeArg", "date"), new StateVariable ("A_ARG_boolArg", "boolean"), new StateVariable ("A_ARG_byteArrayArg", "bin"), new StateVariable ("A_ARG_uriArg", "uri") } ); ServiceDescriptionTests.AssertEquality (controller, service.GetController ()); } class StateVariableTestClass { [UpnpStateVariable] public event EventHandler> FooChanged; } [Test] public void StateVariableTest () { var service = new DummyService (); var controller = new ServiceController (null, new[] { new DummyStateVariable ("FooChanged", "string") } ); ServiceDescriptionTests.AssertEquality (controller, service.GetController ()); } class StateVariableNameTestClass { [UpnpStateVariable ("fooChanged")] public event EventHandler> FooChanged; } [Test] public void StateVariableNameTest () { var service = new DummyService (); var controller = new ServiceController (null, new[] { new DummyStateVariable ("fooChanged", "string") } ); ServiceDescriptionTests.AssertEquality (controller, service.GetController ()); } class StateVariableDataTypeTestClass { [UpnpStateVariable (DataType = "string.foo")] public event EventHandler> FooChanged; } [Test] public void StateVariableDataTypeTest () { var service = new DummyService (); var controller = new ServiceController (null, new[] { new DummyStateVariable ("FooChanged", "string.foo") } ); ServiceDescriptionTests.AssertEquality (controller, service.GetController ()); } class StateVariableIsMulticastTestClass { [UpnpStateVariable (IsMulticast = true)] public event EventHandler> FooChanged; } [Test] public void StateVariableIsMulticastTest () { var service = new DummyService (); var controller = new ServiceController (null, new[] { new DummyStateVariable ("FooChanged", "string", true) } ); ServiceDescriptionTests.AssertEquality (controller, service.GetController ()); } class StateVariablesTestClass { [UpnpStateVariable] public event EventHandler> StringChanged; [UpnpStateVariable] public event EventHandler> IntChanged; [UpnpStateVariable] public event EventHandler> ByteChanged; [UpnpStateVariable] public event EventHandler> UshortChanged; [UpnpStateVariable] public event EventHandler> UintChanged; [UpnpStateVariable] public event EventHandler> SbyteChanged; [UpnpStateVariable] public event EventHandler> ShortChanged; [UpnpStateVariable] public event EventHandler> LongChanged; [UpnpStateVariable] public event EventHandler> FloatChanged; [UpnpStateVariable] public event EventHandler> DoubleChanged; [UpnpStateVariable] public event EventHandler> CharChanged; [UpnpStateVariable] public event EventHandler> BoolChanged; [UpnpStateVariable] public event EventHandler> ByteArrayChanged; [UpnpStateVariable] public event EventHandler> UriChanged; } [Test] public void StateVariablesTest () { var service = new DummyService (); var controller = new ServiceController (null, new[] { new DummyStateVariable ("StringChanged", "string"), new DummyStateVariable ("IntChanged", "i4"), new DummyStateVariable ("ByteChanged", "ui1"), new DummyStateVariable ("UshortChanged", "ui2"), new DummyStateVariable ("UintChanged", "ui4"), new DummyStateVariable ("SbyteChanged", "i1"), new DummyStateVariable ("ShortChanged", "i2"), new DummyStateVariable ("LongChanged", "int"), new DummyStateVariable ("FloatChanged", "r4"), new DummyStateVariable ("DoubleChanged", "r8"), new DummyStateVariable ("CharChanged", "char"), new DummyStateVariable ("BoolChanged", "boolean"), new DummyStateVariable ("ByteArrayChanged", "bin"), new DummyStateVariable ("UriChanged", "uri") } ); ServiceDescriptionTests.AssertEquality (controller, service.GetController ()); } class EventedRelatedStateVariableTestClass { [UpnpAction] public void GetFoo ([UpnpRelatedStateVariable ("Foo")] out string foo) { foo = null; } [UpnpStateVariable ("Foo")] public event EventHandler> FooChanged; } [Test] public void EventedRelatedStateVariableTest () { var service = new DummyService (); var controller = new ServiceController ( new[] { new DummyServiceAction ("GetFoo", new[] { new Argument ("foo", "Foo", ArgumentDirection.Out) }) }, new[] { new DummyStateVariable ("Foo", "string") } ); ServiceDescriptionTests.AssertEquality (controller, service.GetController ()); } class OptionalActionClass { [UpnpAction (OmitUnless = "CanFoo")] public void Foo (string foo) { } [UpnpAction] public void Bar (string bar) { } public bool CanFoo { get; set; } } [Test] public void UnimplementedOptionalAction () { var service = new DummyService (); var controller = new ServiceController ( new[] { new DummyServiceAction ("Bar", new [] { new Argument ("bar", "A_ARG_bar", ArgumentDirection.In) }) }, new[] { new StateVariable ("A_ARG_bar", "string") }); ServiceDescriptionTests.AssertEquality (controller, service.GetController ()); } [Test] public void ImplementedOptionalAction () { var service = new DummyService (new OptionalActionClass { CanFoo = true }); var controller = new ServiceController ( new[] { new DummyServiceAction ("Foo", new [] { new Argument ("foo", "A_ARG_foo", ArgumentDirection.In) }), new DummyServiceAction ("Bar", new [] { new Argument ("bar", "A_ARG_bar", ArgumentDirection.In) }) }, new[] { new StateVariable ("A_ARG_foo", "string"), new StateVariable ("A_ARG_bar", "string") }); ServiceDescriptionTests.AssertEquality (controller, service.GetController ()); } class ErroneousOptionalActionClass { [UpnpAction (OmitUnless = "CanFoo")] public void Foo () { } } [Test, ExpectedException (typeof (UpnpServiceDefinitionException))] public void ErroneousOptionalAction () { new DummyService (); } class OptionalStateVariablesClass { [UpnpStateVariable (OmitUnless = "HasFoo")] public event EventHandler> FooChanged; [UpnpStateVariable] public event EventHandler> BarChanged; public bool HasFoo { get; set; } } [Test] public void UnimplementedOptionalStateVariable () { var service = new DummyService (); var controller = new ServiceController (null, new[] { new DummyStateVariable ("BarChanged", "string") }); ServiceDescriptionTests.AssertEquality (controller, service.GetController ()); } [Test] public void ImplementedOptionalStateVariable () { var service = new DummyService (new OptionalStateVariablesClass { HasFoo = true }); var controller = new ServiceController (null, new[] { new DummyStateVariable ("FooChanged", "string"), new DummyStateVariable ("BarChanged", "string") }); ServiceDescriptionTests.AssertEquality (controller, service.GetController ()); } class ErroneousOptionalStateVariablesClass { [UpnpStateVariable (OmitUnless = "HasFoo")] public event EventHandler> FooChanged; } [Test, ExpectedException (typeof (UpnpServiceDefinitionException))] public void ErroneousOptionalStateVariable () { new DummyService (); } class ErroneousArgumentTypeClass { [UpnpAction] public void Foo (Exception e) { } } [Test, ExpectedException (typeof (UpnpServiceDefinitionException))] public void ErroneousArgumentType () { new DummyService (); } } } mono-upnp-0.1.2/tests/Mono.Upnp.Tests/ServiceDescriptionTests.cs0000664000175000017500000004047411714307244026206 0ustar00lorentzlorentz00000000000000// // ServiceDescriptionTests.cs // // Author: // Scott Peterson // // Copyright (c) 2009 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using NUnit.Framework; using Mono.Upnp.Control; using Mono.Upnp.Xml; namespace Mono.Upnp.Tests { [TestFixture] public class ServiceDescriptionTests { readonly XmlSerializer serializer = new XmlSerializer (); readonly DummyDeserializer deserializer = new DummyDeserializer (); static ServiceController CreateServiceController () { return new ServiceController ( new[] { new DummyServiceAction ( "Browse", new[] { new Argument ("browseFlag", "A_ARG_TYPE_BrowseFlag", ArgumentDirection.In), new Argument ("offset", "A_ARG_TYPE_Offset", ArgumentDirection.In), new Argument ("requestCount", "A_ARG_TYPE_RequestCount", ArgumentDirection.In), new Argument ("resultCount", "A_ARG_TYPE_ResultCount", ArgumentDirection.Out), new Argument ("result", "A_ARG_TYPE_Result", ArgumentDirection.Out, true) } ), new DummyServiceAction ( "Search", new[] { new Argument ("searchFlag", "A_ARG_TYPE_SearchFlag", ArgumentDirection.In), new Argument ("offset", "A_ARG_TYPE_Offset", ArgumentDirection.In), new Argument ("requestCount", "A_ARG_TYPE_RequestCount", ArgumentDirection.In), new Argument ("resultCount", "A_ARG_TYPE_ResultCount", ArgumentDirection.Out), new Argument ("result", "A_ARG_TYPE_Result", ArgumentDirection.Out, true) } ), }, new[] { new StateVariable ("A_ARG_TYPE_BrowseFlag", new[] { "BrowseMetadata", "BrowseObjects" }), new StateVariable ("A_ARG_TYPE_SearchFlag", new[] { "SearchMetadata", "SearchObjects" }), new StateVariable ("A_ARG_TYPE_Offset", "ui4"), new StateVariable ("A_ARG_TYPE_RequestCount", "ui4", new AllowedValueRange ("1", "100"), new StateVariableOptions { DefaultValue = "50" }), new StateVariable ("A_ARG_TYPE_ResultCount", "ui4"), new StateVariable ("A_ARG_TYPE_Result", "string"), new DummyStateVariable ("SystemId", "ui4") } ); } public static void AssertEquality (ServiceController sourceController, ServiceController targetController) { Assert.IsNotNull (targetController); Assert.AreEqual (sourceController.SpecVersion.Major, targetController.SpecVersion.Major); Assert.AreEqual (sourceController.SpecVersion.Minor, targetController.SpecVersion.Minor); var source_actions = sourceController.Actions.Values.GetEnumerator (); var target_actions = targetController.Actions.Values.GetEnumerator (); while (source_actions.MoveNext ()) { Assert.IsTrue (target_actions.MoveNext ()); AssertEquality (source_actions.Current, target_actions.Current); } Assert.IsFalse (target_actions.MoveNext ()); var source_state_variables = sourceController.StateVariables.Values.GetEnumerator (); var target_state_variables = targetController.StateVariables.Values.GetEnumerator (); while (source_state_variables.MoveNext ()) { Assert.IsTrue (target_state_variables.MoveNext ()); AssertEquality (source_state_variables.Current, target_state_variables.Current); } Assert.IsFalse (target_state_variables.MoveNext ()); } public static void AssertEquality (ServiceAction sourceAction, ServiceAction targetAction) { Assert.AreEqual (sourceAction.Name, targetAction.Name); var source_arguments = sourceAction.Arguments.Values.GetEnumerator (); var target_arguments = targetAction.Arguments.Values.GetEnumerator (); while (source_arguments.MoveNext ()) { Assert.IsTrue (target_arguments.MoveNext ()); AssertEquality (source_arguments.Current, target_arguments.Current); } Assert.IsFalse (target_arguments.MoveNext ()); } public static void AssertEquality (Argument sourceArgument, Argument targetArgument) { Assert.AreEqual (sourceArgument.Name, targetArgument.Name); Assert.AreEqual (sourceArgument.Direction, targetArgument.Direction); Assert.AreEqual (sourceArgument.IsReturnValue, targetArgument.IsReturnValue); Assert.AreEqual (sourceArgument.RelatedStateVariable, targetArgument.RelatedStateVariable); } public static void AssertEquality (StateVariable sourceStateVariable, StateVariable targetStateVariable) { Assert.AreEqual (sourceStateVariable.Name, targetStateVariable.Name); Assert.AreEqual (sourceStateVariable.DataType, targetStateVariable.DataType); Assert.AreEqual (sourceStateVariable.SendsEvents, targetStateVariable.SendsEvents); Assert.AreEqual (sourceStateVariable.IsMulticast, targetStateVariable.IsMulticast); Assert.AreEqual (sourceStateVariable.DefaultValue, targetStateVariable.DefaultValue); if (sourceStateVariable.AllowedValues != null) { var source_values = sourceStateVariable.AllowedValues.GetEnumerator (); var target_values = targetStateVariable.AllowedValues.GetEnumerator (); while (source_values.MoveNext ()) { Assert.IsTrue (target_values.MoveNext ()); Assert.AreEqual (source_values.Current, target_values.Current); } Assert.IsFalse (target_values.MoveNext ()); } if (sourceStateVariable.AllowedValueRange != null) { Assert.AreEqual (sourceStateVariable.AllowedValueRange.Minimum, targetStateVariable.AllowedValueRange.Minimum); Assert.AreEqual (sourceStateVariable.AllowedValueRange.Maximum, targetStateVariable.AllowedValueRange.Maximum); Assert.AreEqual (sourceStateVariable.AllowedValueRange.Step, targetStateVariable.AllowedValueRange.Step); } } [Test] public void OfflineFullScpdTest () { var source_controller = CreateServiceController (); var target_controller = deserializer.DeserializeServiceController (serializer.GetString (source_controller)); AssertEquality (source_controller, target_controller); } [Test] public void FullScpdDeserializationTest () { var controller = deserializer.DeserializeServiceController (Mono.Upnp.Tests.Xml.FullScpd); Assert.AreEqual (1, controller.SpecVersion.Major); Assert.AreEqual (1, controller.SpecVersion.Minor); Assert.AreEqual (2, controller.Actions.Count); var action = controller.Actions["Browse"]; Assert.AreEqual ("Browse", action.Name); Assert.AreEqual (5, action.Arguments.Count); var argument = action.Arguments["browseFlag"]; Assert.AreEqual ("browseFlag", argument.Name); Assert.AreEqual (ArgumentDirection.In, argument.Direction); Assert.IsFalse (argument.IsReturnValue); Assert.AreEqual ("A_ARG_TYPE_BrowseFlag", argument.RelatedStateVariable); argument = action.Arguments["offset"]; Assert.AreEqual ("offset", argument.Name); Assert.AreEqual (ArgumentDirection.In, argument.Direction); Assert.IsFalse (argument.IsReturnValue); Assert.AreEqual ("A_ARG_TYPE_Offset", argument.RelatedStateVariable); argument = action.Arguments["requestCount"]; Assert.AreEqual ("requestCount", argument.Name); Assert.AreEqual (ArgumentDirection.In, argument.Direction); Assert.IsFalse (argument.IsReturnValue); Assert.AreEqual ("A_ARG_TYPE_RequestCount", argument.RelatedStateVariable); argument = action.Arguments["resultCount"]; Assert.AreEqual ("resultCount", argument.Name); Assert.AreEqual (ArgumentDirection.Out, argument.Direction); Assert.IsFalse (argument.IsReturnValue); Assert.AreEqual ("A_ARG_TYPE_ResultCount", argument.RelatedStateVariable); argument = action.Arguments["result"]; Assert.AreEqual ("result", argument.Name); Assert.AreEqual (ArgumentDirection.Out, argument.Direction); Assert.IsTrue (argument.IsReturnValue); Assert.AreEqual ("A_ARG_TYPE_Result", argument.RelatedStateVariable); action = controller.Actions["Search"]; Assert.AreEqual ("Search", action.Name); Assert.AreEqual (5, action.Arguments.Count); argument = action.Arguments["searchFlag"]; Assert.AreEqual ("searchFlag", argument.Name); Assert.AreEqual (ArgumentDirection.In, argument.Direction); Assert.IsFalse (argument.IsReturnValue); Assert.AreEqual ("A_ARG_TYPE_SearchFlag", argument.RelatedStateVariable); argument = action.Arguments["offset"]; Assert.AreEqual ("offset", argument.Name); Assert.AreEqual (ArgumentDirection.In, argument.Direction); Assert.IsFalse (argument.IsReturnValue); Assert.AreEqual ("A_ARG_TYPE_Offset", argument.RelatedStateVariable); argument = action.Arguments["requestCount"]; Assert.AreEqual ("requestCount", argument.Name); Assert.AreEqual (ArgumentDirection.In, argument.Direction); Assert.IsFalse (argument.IsReturnValue); Assert.AreEqual ("A_ARG_TYPE_RequestCount", argument.RelatedStateVariable); argument = action.Arguments["resultCount"]; Assert.AreEqual ("resultCount", argument.Name); Assert.AreEqual (ArgumentDirection.Out, argument.Direction); Assert.IsFalse (argument.IsReturnValue); Assert.AreEqual ("A_ARG_TYPE_ResultCount", argument.RelatedStateVariable); argument = action.Arguments["result"]; Assert.AreEqual ("result", argument.Name); Assert.AreEqual (ArgumentDirection.Out, argument.Direction); Assert.IsTrue (argument.IsReturnValue); Assert.AreEqual ("A_ARG_TYPE_Result", argument.RelatedStateVariable); Assert.AreEqual (7, controller.StateVariables.Count); var state_variable = controller.StateVariables["A_ARG_TYPE_BrowseFlag"]; Assert.AreEqual ("A_ARG_TYPE_BrowseFlag", state_variable.Name); Assert.AreEqual ("string", state_variable.DataType); Assert.IsNull (state_variable.AllowedValueRange); Assert.IsFalse (state_variable.SendsEvents); Assert.IsFalse (state_variable.IsMulticast); Assert.IsNull (state_variable.DefaultValue); var allowed_values = state_variable.AllowedValues.GetEnumerator (); Assert.IsTrue (allowed_values.MoveNext ()); Assert.AreEqual ("BrowseMetadata", allowed_values.Current); Assert.IsTrue (allowed_values.MoveNext ()); Assert.AreEqual ("BrowseObjects", allowed_values.Current); Assert.IsFalse (allowed_values.MoveNext ()); state_variable = controller.StateVariables["A_ARG_TYPE_SearchFlag"]; Assert.AreEqual ("A_ARG_TYPE_SearchFlag", state_variable.Name); Assert.AreEqual ("string", state_variable.DataType); Assert.IsNull (state_variable.AllowedValueRange); Assert.IsFalse (state_variable.SendsEvents); Assert.IsFalse (state_variable.IsMulticast); Assert.IsNull (state_variable.DefaultValue); allowed_values = state_variable.AllowedValues.GetEnumerator (); Assert.IsTrue (allowed_values.MoveNext ()); Assert.AreEqual ("SearchMetadata", allowed_values.Current); Assert.IsTrue (allowed_values.MoveNext ()); Assert.AreEqual ("SearchObjects", allowed_values.Current); Assert.IsFalse (allowed_values.MoveNext ()); state_variable = controller.StateVariables["A_ARG_TYPE_Offset"]; Assert.AreEqual ("A_ARG_TYPE_Offset", state_variable.Name); Assert.AreEqual ("ui4", state_variable.DataType); Assert.IsNull (state_variable.AllowedValues); Assert.IsNull (state_variable.AllowedValueRange); Assert.IsFalse (state_variable.SendsEvents); Assert.IsFalse (state_variable.IsMulticast); Assert.IsNull (state_variable.DefaultValue); state_variable = controller.StateVariables["A_ARG_TYPE_RequestCount"]; Assert.AreEqual ("A_ARG_TYPE_RequestCount", state_variable.Name); Assert.AreEqual ("ui4", state_variable.DataType); Assert.AreEqual ("50", state_variable.DefaultValue); Assert.AreEqual ("1", state_variable.AllowedValueRange.Minimum); Assert.AreEqual ("100", state_variable.AllowedValueRange.Maximum); Assert.IsNull (state_variable.AllowedValues); Assert.IsFalse (state_variable.SendsEvents); Assert.IsFalse (state_variable.IsMulticast); state_variable = controller.StateVariables["A_ARG_TYPE_ResultCount"]; Assert.AreEqual ("A_ARG_TYPE_ResultCount", state_variable.Name); Assert.AreEqual ("ui4", state_variable.DataType); Assert.IsNull (state_variable.AllowedValues); Assert.IsNull (state_variable.AllowedValueRange); Assert.IsFalse (state_variable.SendsEvents); Assert.IsFalse (state_variable.IsMulticast); Assert.IsNull (state_variable.DefaultValue); state_variable = controller.StateVariables["A_ARG_TYPE_Result"]; Assert.AreEqual ("A_ARG_TYPE_Result", state_variable.Name); Assert.AreEqual ("string", state_variable.DataType); Assert.IsNull (state_variable.AllowedValues); Assert.IsNull (state_variable.AllowedValueRange); Assert.IsFalse (state_variable.SendsEvents); Assert.IsFalse (state_variable.IsMulticast); Assert.IsNull (state_variable.DefaultValue); state_variable = controller.StateVariables["SystemId"]; Assert.AreEqual ("SystemId", state_variable.Name); Assert.IsNull (state_variable.AllowedValues); Assert.IsNull (state_variable.AllowedValueRange); Assert.IsFalse (state_variable.IsMulticast); Assert.IsNull (state_variable.DefaultValue); Assert.IsTrue (state_variable.SendsEvents); Assert.AreEqual ("ui4", state_variable.DataType); } [Test] public void FullScpdSerializationTest () { var controller = CreateServiceController (); Assert.AreEqual (Mono.Upnp.Tests.Xml.FullScpd, serializer.GetString (controller)); } } } mono-upnp-0.1.2/tests/Mono.Upnp.Tests/TypeInfoTests.cs0000664000175000017500000000636111714307244024134 0ustar00lorentzlorentz00000000000000// // TypeInfoTests.cs // // Author: // Scott Peterson // // Copyright (c) 2010 Scott Peterson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using NUnit.Framework; namespace Mono.Upnp.Tests { [TestFixture] public class TypeInfoTests { delegate T Constructor (string domainName, string type, Version version); delegate T Parser (string typeDescription); [Test] public void ParseDeviceType () { ParseType ((domainName, type, version) => new DeviceType (domainName, type, version), DeviceType.Parse, "device"); } [Test] public void ParseServiceType () { ParseType ((domainName, type, version) => new ServiceType (domainName, type, version), ServiceType.Parse, "service"); } [Test, ExpectedException (typeof (UpnpDeserializationException))] public void ParseTooFewComponents () { DeviceType.Parse ("urn:mydomain.com:device:mytype"); } [Test, ExpectedException (typeof (UpnpDeserializationException))] public void ParseBadVersion () { DeviceType.Parse ("urn:mydomain.com:device:mytype:a"); } [Test, ExpectedException (typeof (UpnpDeserializationException))] public void ParseBadMinorVersion () { DeviceType.Parse ("urn:mydomain.com:device:mytype:1.a"); } void ParseType (Constructor constructor, Parser parser, string kind) { Assert.AreEqual ( constructor ("mydomain.com", "mytype", new Version (1, 0)), parser ("urn:mydomain.com:" + kind + ":mytype:1")); Assert.AreEqual ( constructor ("mydomain.com", "mytype", new Version (2, 0)), parser ("urn:mydomain.com:" + kind + ":mytype:2")); Assert.AreEqual ( constructor ("mydomain.com", "mytype", new Version (1, 0)), parser ("urn:mydomain.com:" + kind + ":mytype:1.0")); Assert.AreEqual ( constructor ("mydomain.com", "mytype", new Version (1, 1)), parser ("urn:mydomain.com:" + kind + ":mytype:1.1")); } } } mono-upnp-0.1.2/tests/Mono.Upnp.Dcp.MediaServer1.FileSystem.Tests/0000775000175000017500000000000011761740037026100 5ustar00lorentzlorentz00000000000000mono-upnp-0.1.2/tests/Mono.Upnp.Dcp.MediaServer1.FileSystem.Tests/Makefile.am0000664000175000017500000001000211715013277030123 0ustar00lorentzlorentz00000000000000 EXTRA_DIST = # Warning: This is an automatically generated file, do not edit! if ENABLE_DEBUG ASSEMBLY_COMPILER_COMMAND = gmcs ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug "-define:DEBUG" ASSEMBLY = ../../bin/Mono.Upnp.Dcp.MediaServer1.FileSystem.Tests.dll ASSEMBLY_MDB = $(ASSEMBLY).mdb COMPILE_TARGET = library PROJECT_REFERENCES = \ ../../bin/Mono.Upnp.dll \ ../../bin/Mono.Upnp.Dcp.MediaServer1.FileSystem.dll \ ../../bin/Mono.Upnp.Dcp.MediaServer1.dll BUILD_DIR = ../../bin MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_TESTS_DLL_MDB_SOURCE=../../bin/Mono.Upnp.Dcp.MediaServer1.FileSystem.Tests.dll.mdb MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_TESTS_DLL_MDB=$(BUILD_DIR)/Mono.Upnp.Dcp.MediaServer1.FileSystem.Tests.dll.mdb MONO_UPNP_DLL_SOURCE=../../bin/Mono.Upnp.dll MONO_SSDP_DLL_SOURCE=../../bin/Mono.Ssdp.dll MONO_SSDP_DLL_MDB_SOURCE=../../bin/Mono.Ssdp.dll.mdb MONO_SSDP_DLL_MDB=$(BUILD_DIR)/Mono.Ssdp.dll.mdb MONO_UPNP_DLL_MDB_SOURCE=../../bin/Mono.Upnp.dll.mdb MONO_UPNP_DLL_MDB=$(BUILD_DIR)/Mono.Upnp.dll.mdb MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_DLL_SOURCE=../../bin/Mono.Upnp.Dcp.MediaServer1.FileSystem.dll MONO_UPNP_DCP_MEDIASERVER1_DLL_SOURCE=../../bin/Mono.Upnp.Dcp.MediaServer1.dll MONO_UPNP_DCP_MEDIASERVER1_DLL_MDB_SOURCE=../../bin/Mono.Upnp.Dcp.MediaServer1.dll.mdb MONO_UPNP_DCP_MEDIASERVER1_DLL_MDB=$(BUILD_DIR)/Mono.Upnp.Dcp.MediaServer1.dll.mdb MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_DLL_MDB_SOURCE=../../bin/Mono.Upnp.Dcp.MediaServer1.FileSystem.dll.mdb MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_DLL_MDB=$(BUILD_DIR)/Mono.Upnp.Dcp.MediaServer1.FileSystem.dll.mdb endif if ENABLE_RELEASE ASSEMBLY_COMPILER_COMMAND = gmcs ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ ASSEMBLY = ../../bin/Mono.Upnp.Dcp.MediaServer1.FileSystem.Tests.dll ASSEMBLY_MDB = COMPILE_TARGET = library PROJECT_REFERENCES = \ ../../bin/Mono.Upnp.dll \ ../../bin/Mono.Upnp.Dcp.MediaServer1.FileSystem.dll \ ../../bin/Mono.Upnp.Dcp.MediaServer1.dll BUILD_DIR = ../../bin MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_TESTS_DLL_MDB= MONO_UPNP_DLL_SOURCE=../../bin/Mono.Upnp.dll MONO_SSDP_DLL_SOURCE=../../bin/Mono.Ssdp.dll MONO_SSDP_DLL_MDB= MONO_UPNP_DLL_MDB= MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_DLL_SOURCE=../../bin/Mono.Upnp.Dcp.MediaServer1.FileSystem.dll MONO_UPNP_DCP_MEDIASERVER1_DLL_SOURCE=../../bin/Mono.Upnp.Dcp.MediaServer1.dll MONO_UPNP_DCP_MEDIASERVER1_DLL_MDB= MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_DLL_MDB= endif AL=al2 SATELLITE_ASSEMBLY_NAME=$(notdir $(basename $(ASSEMBLY))).resources.dll PROGRAMFILES = \ $(MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_TESTS_DLL_MDB) \ $(MONO_UPNP_DLL) \ $(MONO_SSDP_DLL) \ $(MONO_SSDP_DLL_MDB) \ $(MONO_UPNP_DLL_MDB) \ $(MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_DLL) \ $(MONO_UPNP_DCP_MEDIASERVER1_DLL) \ $(MONO_UPNP_DCP_MEDIASERVER1_DLL_MDB) \ $(MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_DLL_MDB) RESGEN=resgen2 all: $(ASSEMBLY) $(PROGRAMFILES) FILES = \ DummyConnectionManager.cs \ Wmp11MusicBuilderTests.cs DATA_FILES = RESOURCES = EXTRAS = REFERENCES = \ ../../bin/Mono.Upnp.Dcp.MediaServer1.dll \ ../../bin/Mono.Upnp.Dcp.MediaServer1.FileSystem.dll \ ../../bin/Mono.Upnp.dll \ -pkg:nunit \ -pkg:taglib-sharp \ System DLL_REFERENCES = CLEANFILES = $(PROGRAMFILES) include $(top_srcdir)/Makefile.include MONO_UPNP_DLL = $(BUILD_DIR)/Mono.Upnp.dll MONO_SSDP_DLL = $(BUILD_DIR)/Mono.Ssdp.dll MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_DLL = $(BUILD_DIR)/Mono.Upnp.Dcp.MediaServer1.FileSystem.dll MONO_UPNP_DCP_MEDIASERVER1_DLL = $(BUILD_DIR)/Mono.Upnp.Dcp.MediaServer1.dll $(eval $(call emit_resgen_targets)) $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(ASSEMBLY_MDB): $(ASSEMBLY) $(ASSEMBLY): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(shell dirname $(ASSEMBLY)) $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) mono-upnp-0.1.2/tests/Mono.Upnp.Dcp.MediaServer1.FileSystem.Tests/Makefile.in0000664000175000017500000006473511761736756030201 0ustar00lorentzlorentz00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/Makefile.include subdir = tests/Mono.Upnp.Dcp.MediaServer1.FileSystem.Tests ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/expansions.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(bindir)" \ "$(DESTDIR)$(assemblyfilesdir)" \ "$(DESTDIR)$(linuxpkgconfigdir)" \ "$(DESTDIR)$(programfilesdir)" SCRIPTS = $(bin_SCRIPTS) SOURCES = DIST_SOURCES = DATA = $(assemblyfiles_DATA) $(linuxpkgconfig_DATA) \ $(programfiles_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ GLADE_SHARP_20_CFLAGS = @GLADE_SHARP_20_CFLAGS@ GLADE_SHARP_20_LIBS = @GLADE_SHARP_20_LIBS@ GLIB_SHARP_20_CFLAGS = @GLIB_SHARP_20_CFLAGS@ GLIB_SHARP_20_LIBS = @GLIB_SHARP_20_LIBS@ GMCS = @GMCS@ GTK_SHARP_20_CFLAGS = @GTK_SHARP_20_CFLAGS@ GTK_SHARP_20_LIBS = @GTK_SHARP_20_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MONO_ADDINS_CFLAGS = @MONO_ADDINS_CFLAGS@ MONO_ADDINS_LIBS = @MONO_ADDINS_LIBS@ NUNIT_CFLAGS = @NUNIT_CFLAGS@ NUNIT_CMD = @NUNIT_CMD@ NUNIT_LIBS = @NUNIT_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TAGLIB_SHARP_CFLAGS = @TAGLIB_SHARP_CFLAGS@ TAGLIB_SHARP_LIBS = @TAGLIB_SHARP_LIBS@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_bindir = @expanded_bindir@ expanded_datadir = @expanded_datadir@ expanded_libdir = @expanded_libdir@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = $(build_sources) $(build_resx_files) \ $(build_others_files) $(ASSEMBLY_WRAPPER_IN) $(EXTRAS) \ $(DATA_FILES) $(build_culture_res_files) # Warning: This is an automatically generated file, do not edit! @ENABLE_DEBUG_TRUE@ASSEMBLY_COMPILER_COMMAND = gmcs @ENABLE_RELEASE_TRUE@ASSEMBLY_COMPILER_COMMAND = gmcs @ENABLE_DEBUG_TRUE@ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug "-define:DEBUG" @ENABLE_RELEASE_TRUE@ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ @ENABLE_DEBUG_TRUE@ASSEMBLY = ../../bin/Mono.Upnp.Dcp.MediaServer1.FileSystem.Tests.dll @ENABLE_RELEASE_TRUE@ASSEMBLY = ../../bin/Mono.Upnp.Dcp.MediaServer1.FileSystem.Tests.dll @ENABLE_DEBUG_TRUE@ASSEMBLY_MDB = $(ASSEMBLY).mdb @ENABLE_RELEASE_TRUE@ASSEMBLY_MDB = @ENABLE_DEBUG_TRUE@COMPILE_TARGET = library @ENABLE_RELEASE_TRUE@COMPILE_TARGET = library @ENABLE_DEBUG_TRUE@PROJECT_REFERENCES = \ @ENABLE_DEBUG_TRUE@ ../../bin/Mono.Upnp.dll \ @ENABLE_DEBUG_TRUE@ ../../bin/Mono.Upnp.Dcp.MediaServer1.FileSystem.dll \ @ENABLE_DEBUG_TRUE@ ../../bin/Mono.Upnp.Dcp.MediaServer1.dll @ENABLE_RELEASE_TRUE@PROJECT_REFERENCES = \ @ENABLE_RELEASE_TRUE@ ../../bin/Mono.Upnp.dll \ @ENABLE_RELEASE_TRUE@ ../../bin/Mono.Upnp.Dcp.MediaServer1.FileSystem.dll \ @ENABLE_RELEASE_TRUE@ ../../bin/Mono.Upnp.Dcp.MediaServer1.dll @ENABLE_DEBUG_TRUE@BUILD_DIR = ../../bin @ENABLE_RELEASE_TRUE@BUILD_DIR = ../../bin @ENABLE_DEBUG_TRUE@MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_TESTS_DLL_MDB_SOURCE = ../../bin/Mono.Upnp.Dcp.MediaServer1.FileSystem.Tests.dll.mdb @ENABLE_DEBUG_TRUE@MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_TESTS_DLL_MDB = $(BUILD_DIR)/Mono.Upnp.Dcp.MediaServer1.FileSystem.Tests.dll.mdb @ENABLE_RELEASE_TRUE@MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_TESTS_DLL_MDB = @ENABLE_DEBUG_TRUE@MONO_UPNP_DLL_SOURCE = ../../bin/Mono.Upnp.dll @ENABLE_RELEASE_TRUE@MONO_UPNP_DLL_SOURCE = ../../bin/Mono.Upnp.dll @ENABLE_DEBUG_TRUE@MONO_SSDP_DLL_SOURCE = ../../bin/Mono.Ssdp.dll @ENABLE_RELEASE_TRUE@MONO_SSDP_DLL_SOURCE = ../../bin/Mono.Ssdp.dll @ENABLE_DEBUG_TRUE@MONO_SSDP_DLL_MDB_SOURCE = ../../bin/Mono.Ssdp.dll.mdb @ENABLE_DEBUG_TRUE@MONO_SSDP_DLL_MDB = $(BUILD_DIR)/Mono.Ssdp.dll.mdb @ENABLE_RELEASE_TRUE@MONO_SSDP_DLL_MDB = @ENABLE_DEBUG_TRUE@MONO_UPNP_DLL_MDB_SOURCE = ../../bin/Mono.Upnp.dll.mdb @ENABLE_DEBUG_TRUE@MONO_UPNP_DLL_MDB = $(BUILD_DIR)/Mono.Upnp.dll.mdb @ENABLE_RELEASE_TRUE@MONO_UPNP_DLL_MDB = @ENABLE_DEBUG_TRUE@MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_DLL_SOURCE = ../../bin/Mono.Upnp.Dcp.MediaServer1.FileSystem.dll @ENABLE_RELEASE_TRUE@MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_DLL_SOURCE = ../../bin/Mono.Upnp.Dcp.MediaServer1.FileSystem.dll @ENABLE_DEBUG_TRUE@MONO_UPNP_DCP_MEDIASERVER1_DLL_SOURCE = ../../bin/Mono.Upnp.Dcp.MediaServer1.dll @ENABLE_RELEASE_TRUE@MONO_UPNP_DCP_MEDIASERVER1_DLL_SOURCE = ../../bin/Mono.Upnp.Dcp.MediaServer1.dll @ENABLE_DEBUG_TRUE@MONO_UPNP_DCP_MEDIASERVER1_DLL_MDB_SOURCE = ../../bin/Mono.Upnp.Dcp.MediaServer1.dll.mdb @ENABLE_DEBUG_TRUE@MONO_UPNP_DCP_MEDIASERVER1_DLL_MDB = $(BUILD_DIR)/Mono.Upnp.Dcp.MediaServer1.dll.mdb @ENABLE_RELEASE_TRUE@MONO_UPNP_DCP_MEDIASERVER1_DLL_MDB = @ENABLE_DEBUG_TRUE@MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_DLL_MDB_SOURCE = ../../bin/Mono.Upnp.Dcp.MediaServer1.FileSystem.dll.mdb @ENABLE_DEBUG_TRUE@MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_DLL_MDB = $(BUILD_DIR)/Mono.Upnp.Dcp.MediaServer1.FileSystem.dll.mdb @ENABLE_RELEASE_TRUE@MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_DLL_MDB = AL = al2 SATELLITE_ASSEMBLY_NAME = $(notdir $(basename $(ASSEMBLY))).resources.dll PROGRAMFILES = \ $(MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_TESTS_DLL_MDB) \ $(MONO_UPNP_DLL) \ $(MONO_SSDP_DLL) \ $(MONO_SSDP_DLL_MDB) \ $(MONO_UPNP_DLL_MDB) \ $(MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_DLL) \ $(MONO_UPNP_DCP_MEDIASERVER1_DLL) \ $(MONO_UPNP_DCP_MEDIASERVER1_DLL_MDB) \ $(MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_DLL_MDB) RESGEN = resgen2 FILES = \ DummyConnectionManager.cs \ Wmp11MusicBuilderTests.cs DATA_FILES = RESOURCES = EXTRAS = REFERENCES = \ ../../bin/Mono.Upnp.Dcp.MediaServer1.dll \ ../../bin/Mono.Upnp.Dcp.MediaServer1.FileSystem.dll \ ../../bin/Mono.Upnp.dll \ -pkg:nunit \ -pkg:taglib-sharp \ System DLL_REFERENCES = CLEANFILES = $(PROGRAMFILES) $(ASSEMBLY) $(ASSEMBLY).mdb $(BINARIES) \ $(build_resx_resources) $(build_satellite_assembly_list) VALID_CULTURES = ar bg ca zh-CHS cs da de el en es fi fr he hu is it ja ko nl no pl pt ro ru hr sk sq sv th tr id uk be sl et lv lt fa vi hy eu mk af ka fo hi sw gu ta te kn mr gl kok ar-SA bg-BG ca-ES zh-TW cs-CZ da-DK de-DE el-GR en-US fi-FI fr-FR he-IL hu-HU is-IS it-IT ja-JP ko-KR nl-NL nb-NO pl-PL pt-BR ro-RO ru-RU hr-HR sk-SK sq-AL sv-SE th-TH tr-TR id-ID uk-UA be-BY sl-SI et-EE lv-LV lt-LT fa-IR vi-VN hy-AM eu-ES mk-MK af-ZA ka-GE fo-FO hi-IN sw-KE gu-IN ta-IN te-IN kn-IN mr-IN gl-ES kok-IN ar-IQ zh-CN de-CH en-GB es-MX fr-BE it-CH nl-BE nn-NO pt-PT sv-FI ar-EG zh-HK de-AT en-AU es-ES fr-CA ar-LY zh-SG de-LU en-CA es-GT fr-CH ar-DZ zh-MO en-NZ es-CR fr-LU ar-MA en-IE es-PA ar-TN en-ZA es-DO ar-OM es-VE ar-YE es-CO ar-SY es-PE ar-JO en-TT es-AR ar-LB en-ZW es-EC ar-KW en-PH es-CL ar-AE es-UY ar-BH es-PY ar-QA es-BO es-SV es-HN es-NI es-PR zh-CHT s2q = $(subst \ ,?,$1) q2s = $(subst ?,\ ,$1) # use this when result will be quoted unesc2 = $(subst ?, ,$1) build_sources = $(FILES) $(GENERATED_FILES) build_sources_esc = $(call s2q,$(build_sources)) # use unesc2, as build_sources_embed is quoted build_sources_embed = $(call unesc2,$(build_sources_esc:%='$(srcdir)/%')) comma__ = , get_resource_name = $(firstword $(subst $(comma__), ,$1)) get_culture = $(lastword $(subst ., ,$(basename $1))) is_cultured_resource = $(and $(word 3,$(subst ., ,$1)), $(filter $(VALID_CULTURES),$(lastword $(subst ., ,$(basename $1))))) RESOURCES_ESC = $(call s2q,$(RESOURCES)) build_resx_list = $(foreach res, $(RESOURCES_ESC), $(if $(filter %.resx, $(call get_resource_name,$(res))),$(res),)) build_non_culture_resx_list = $(foreach res, $(build_resx_list),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_non_culture_others_list = $(foreach res, $(filter-out $(build_resx_list),$(RESOURCES_ESC)),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_others_list = $(build_non_culture_others_list) build_xamlg_list = $(filter %.xaml.g.cs, $(FILES)) # resgen all .resx resources build_resx_files = $(foreach res, $(build_resx_list), $(call get_resource_name,$(res))) build_resx_resources_esc = $(build_resx_files:.resx=.resources) build_resx_resources = $(call q2s,$(build_resx_resources_esc)) # embed resources for the main assembly build_resx_resources_hack = $(subst .resx,.resources, $(build_non_culture_resx_list)) # use unesc2, as build_resx_resources_embed is quoted build_resx_resources_embed = $(call unesc2,$(build_resx_resources_hack:%='-resource:%')) build_others_files = $(call q2s,$(foreach res, $(build_others_list),$(call get_resource_name,$(res)))) build_others_resources = $(build_others_files) # use unesc2, as build_others_resources_embed is quoted build_others_resources_embed = $(call unesc2,$(build_others_list:%='-resource:$(srcdir)/%')) build_resources = $(build_resx_resources) $(build_others_resources) build_resources_embed = $(build_resx_resources_embed) $(build_others_resources_embed) # -usesourcepath is available only for resgen2 emit_resgen_target_1 = $(call q2s,$1) : $(call q2s,$(subst .resources,.resx,$1)); cd '$$(shell dirname '$$<')' && MONO_IOMAP=drive $$(RESGEN) '$$(shell basename '$$<')' '$$(shell basename '$$@')' emit_resgen_target_2 = $(call q2s,$1) : $(call q2s,$(subst .resources,.resx,$1)); MONO_IOMAP=drive $$(RESGEN) -usesourcepath '$$<' '$$@' emit_resgen_target = $(if $(filter resgen2,$(RESGEN)),$(emit_resgen_target_2),$(emit_resgen_target_1)) emit_resgen_targets = $(foreach res,$(build_resx_resources_esc),$(eval $(call emit_resgen_target,$(res)))) build_references_ref = $(call q2s,$(foreach ref, $(call \ s2q,$(REFERENCES)), $(if $(filter -pkg:%, $(ref)), $(ref), \ $(if $(filter -r:%, $(ref)), $(ref), -r:$(ref))))) $(call \ q2s,$(foreach ref, $(call s2q,$(DLL_REFERENCES)), -r:$(ref))) \ $(call q2s,$(foreach ref, $(call s2q,$(PROJECT_REFERENCES)), \ -r:$(ref))) s2q2s = $(call unesc2,$(call s2q,$1)) cp_actual = test -z $1 || cp $1 $2 cp = $(call cp_actual,'$(call s2q2s,$1)','$(call s2q2s,$2)') rm_actual = test -z '$1' || rm -f '$2' rm = $(call rm_actual,$(call s2q2s,$1),$(call s2q2s,$2)/$(shell basename '$(call s2q2s,$1)')) DISTCLEANFILES = $(GENERATED_FILES) $(pc_files) $(BUILD_DIR)/* assemblyfilesdir = $(pkglibdir) assemblyfiles_DATA = $(ASSEMBLY) bin_SCRIPTS = $(BINARIES) programfilesdir = @libdir@/@PACKAGE@ programfiles_DATA = $(PROGRAMFILES) linuxpkgconfigdir = @libdir@/pkgconfig linuxpkgconfig_DATA = $(LINUX_PKGCONFIG) # generating satellite assemblies culture_resources = $(foreach res, $(RESOURCES_ESC), $(if $(call is_cultured_resource,$(call get_resource_name, $(res))),$(res))) cultures = $(sort $(foreach res, $(culture_resources), $(call get_culture,$(call get_resource_name,$(res))))) culture_resource_dependencies = $(call q2s,$(BUILD_DIR)/$1/$(SATELLITE_ASSEMBLY_NAME): $(subst .resx,.resources,$2)) culture_resource_commandlines = $(call unesc2,cmd_line_satellite_$1 += '/embed:$(subst .resx,.resources,$2)') build_satellite_assembly_list = $(call q2s,$(cultures:%=$(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME))) build_culture_res_files = $(call q2s,$(foreach res, $(culture_resources),$(call get_resource_name,$(res)))) install_satellite_assembly_list = $(subst $(BUILD_DIR),$(DESTDIR)$(libdir)/$(PACKAGE),$(build_satellite_assembly_list)) MONO_UPNP_DLL = $(BUILD_DIR)/Mono.Upnp.dll MONO_SSDP_DLL = $(BUILD_DIR)/Mono.Ssdp.dll MONO_UPNP_DCP_MEDIASERVER1_FILESYSTEM_DLL = $(BUILD_DIR)/Mono.Upnp.Dcp.MediaServer1.FileSystem.dll MONO_UPNP_DCP_MEDIASERVER1_DLL = $(BUILD_DIR)/Mono.Upnp.Dcp.MediaServer1.dll all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.include $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/Mono.Upnp.Dcp.MediaServer1.FileSystem.Tests/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign tests/Mono.Upnp.Dcp.MediaServer1.FileSystem.Tests/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/Makefile.include: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) install-assemblyfilesDATA: $(assemblyfiles_DATA) @$(NORMAL_INSTALL) test -z "$(assemblyfilesdir)" || $(MKDIR_P) "$(DESTDIR)$(assemblyfilesdir)" @list='$(assemblyfiles_DATA)'; test -n "$(assemblyfilesdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(assemblyfilesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(assemblyfilesdir)" || exit $$?; \ done uninstall-assemblyfilesDATA: @$(NORMAL_UNINSTALL) @list='$(assemblyfiles_DATA)'; test -n "$(assemblyfilesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(assemblyfilesdir)'; $(am__uninstall_files_from_dir) install-linuxpkgconfigDATA: $(linuxpkgconfig_DATA) @$(NORMAL_INSTALL) test -z "$(linuxpkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(linuxpkgconfigdir)" @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(linuxpkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(linuxpkgconfigdir)" || exit $$?; \ done uninstall-linuxpkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(linuxpkgconfig_DATA)'; test -n "$(linuxpkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(linuxpkgconfigdir)'; $(am__uninstall_files_from_dir) install-programfilesDATA: $(programfiles_DATA) @$(NORMAL_INSTALL) test -z "$(programfilesdir)" || $(MKDIR_P) "$(DESTDIR)$(programfilesdir)" @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(programfilesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(programfilesdir)" || exit $$?; \ done uninstall-programfilesDATA: @$(NORMAL_UNINSTALL) @list='$(programfiles_DATA)'; test -n "$(programfilesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(programfilesdir)'; $(am__uninstall_files_from_dir) tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(assemblyfilesdir)" "$(DESTDIR)$(linuxpkgconfigdir)" "$(DESTDIR)$(programfilesdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-assemblyfilesDATA install-linuxpkgconfigDATA \ install-programfilesDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binSCRIPTS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-assemblyfilesDATA uninstall-binSCRIPTS \ uninstall-linuxpkgconfigDATA uninstall-programfilesDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-assemblyfilesDATA \ install-binSCRIPTS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-linuxpkgconfigDATA install-man install-pdf \ install-pdf-am install-programfilesDATA install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \ uninstall-am uninstall-assemblyfilesDATA uninstall-binSCRIPTS \ uninstall-linuxpkgconfigDATA uninstall-programfilesDATA all: $(ASSEMBLY) $(PROGRAMFILES) # macros # $(call emit-deploy-target,deploy-variable-name) define emit-deploy-target $($1): $($1_SOURCE) mkdir -p '$$(shell dirname '$$@')' cp '$$<' '$$@' endef # $(call emit-deploy-wrapper,wrapper-variable-name,wrapper-sourcefile,x) # assumes that for a wrapper foo.pc its source template is foo.pc.in # if $3 is non-empty then wrapper is marked exec define emit-deploy-wrapper $($1): $2 mkdir -p '$$(shell dirname '$$@')' cp '$$<' '$$@' $(if $3,chmod +x '$$@') endef $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_dependencies,$(call get_culture,$(call get_resource_name,$(res))),$(call get_resource_name,$(res)))))) $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_commandlines,$(call get_culture,$(call get_resource_name,$(res))),$(res))))) $(build_satellite_assembly_list): $(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME): mkdir -p '$(@D)' $(AL) -out:'$@' -culture:$* -t:lib $(cmd_line_satellite_$*) $(install_satellite_assembly_list): mkdir -p '$(@D)' cp $(subst $(DESTDIR)$(libdir)/$(PACKAGE), $(BUILD_DIR), $@) $@ install-satellite-assemblies: $(install_satellite_assembly_list) uninstall-satellite-assemblies: rm -rf $(install_satellite_assembly_list) $(eval $(call emit_resgen_targets)) $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(ASSEMBLY_MDB): $(ASSEMBLY) $(ASSEMBLY): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(shell dirname $(ASSEMBLY)) $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: mono-upnp-0.1.2/tests/Mono.Upnp.Dcp.MediaServer1.FileSystem.Tests/DummyConnectionManager.cs0000664000175000017500000000420111714307244033027 0ustar00lorentzlorentz00000000000000// // DummyConnectionManager.cs // // Author: // Scott Thomas // // Copyright (c) 2009 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using Mono.Upnp.Dcp.MediaServer1.ConnectionManager1; namespace Mono.Upnp.Dcp.MediaServer1.FileSystem.Tests { public class DummyConnectionManager : ConnectionManager { protected override string CurrentConnectionIDs { get { throw new System.NotImplementedException (); } } protected override void GetProtocolInfoCore (out string source, out string sink) { throw new System.NotImplementedException (); } protected override void GetCurrentConnectionInfoCore (int connectionId, out int resId, out int avTransportId, out string protocolInfo, out string peerConnectionManager, out int peerConnectionId, out Mono.Upnp.Dcp.MediaServer1.ConnectionManager1.Direction direction, out Mono.Upnp.Dcp.MediaServer1.ConnectionManager1.ConnectionStatus status) { throw new System.NotImplementedException (); } } } mono-upnp-0.1.2/tests/Mono.Upnp.Dcp.MediaServer1.FileSystem.Tests/Wmp11MusicBuilderTests.cs0000664000175000017500000002177111714307244032674 0ustar00lorentzlorentz00000000000000// // Wmp11MusicBuilderTests.cs // // Author: // Scott Thomas // // Copyright (c) 2010 Scott Thomas // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using NUnit.Framework; using TagLib.Id3v2; using Mono.Upnp.Dcp.MediaServer1.ContentDirectory1; using Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV; using Mono.Upnp.Dcp.MediaServer1.FileSystem.Wmp11; using Object = Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.Object; namespace Mono.Upnp.Dcp.MediaServer1.FileSystem.Tests { [TestFixture] public class Wmp11MusicBuilderTests { class Builder { Wmp11MusicBuilder builder = new Wmp11MusicBuilder (); List objects = new List (); public void OnTag (Tag tag) { builder.OnTag ("0", null, tag, item => objects.Add (item)); } public List OnDone () { builder.Build (info => objects.Add (info.Container)); return objects; } } [Test] public void BasicTag () { var builder = new Builder (); builder.OnTag (new Tag { Title = "Foo Bar", Track = 42 }); var objects = builder.OnDone (); var music_track = objects[0] as MusicTrack; Assert.AreEqual ("Foo Bar", music_track.Title); Assert.AreEqual (42, music_track.OriginalTrackNumber); } [Test] public void BasicGenreTag () { var builder = new Builder (); builder.OnTag (new Tag { Title = "Foo Bar", Track = 42, Genres = new[] { "Bat" }, }); var objects = builder.OnDone (); var music_track = objects[0] as MusicTrack; Assert.AreEqual ("Foo Bar", music_track.Title); Assert.AreEqual (42, music_track.OriginalTrackNumber); Assert.AreEqual ("Bat", music_track.Genres[0]); var reference = objects[1] as Item; Assert.AreEqual (music_track.Id, reference.RefId); var music_genre = objects[3] as MusicGenre; Assert.AreEqual ("Bat", music_genre.Title); Assert.AreEqual (1, music_genre.ChildCount); } [Test] public void MultipleGenresTag () { var builder = new Builder (); builder.OnTag (new Tag { Title = "Foo Bar", Track = 42, Genres = new[] { "Bat", "Baz" }, }); var objects = builder.OnDone (); var music_track = objects[0] as MusicTrack; Assert.AreEqual ("Foo Bar", music_track.Title); Assert.AreEqual (42, music_track.OriginalTrackNumber); Assert.AreEqual ("Bat", music_track.Genres[0]); Assert.AreEqual ("Baz", music_track.Genres[1]); Assert.AreEqual (music_track.Id, ((Item)objects[1]).RefId); Assert.AreEqual (music_track.Id, ((Item)objects[2]).RefId); var music_genre = objects[4] as MusicGenre; Assert.AreEqual ("Bat", music_genre.Title); Assert.AreEqual (1, music_genre.ChildCount); music_genre = objects[5] as MusicGenre; Assert.AreEqual ("Baz", music_genre.Title); Assert.AreEqual (1, music_genre.ChildCount); } [Test] public void BasicArtistTag () { var builder = new Builder (); builder.OnTag (new Tag { Title = "Foo Bar", Track = 42, Performers = new[] { "Boo Far" } }); var objects = builder.OnDone (); var music_track = objects[0] as MusicTrack; Assert.AreEqual ("Foo Bar", music_track.Title); Assert.AreEqual (42, music_track.OriginalTrackNumber); Assert.AreEqual ("Boo Far", music_track.Artists[0].Name); Assert.AreEqual (music_track.Id, ((Item)objects[1]).RefId); var music_artist = objects[4] as MusicArtist; Assert.AreEqual ("Boo Far", music_artist.Title); Assert.AreEqual (1, music_artist.ChildCount); } [Test] public void BasicArtistAndGenreTag () { var builder = new Builder (); builder.OnTag (new Tag { Title = "Foo Bar", Track = 42, Performers = new[] { "Boo Far" }, Genres = new[] { "Bat" } }); var objects = builder.OnDone (); var music_track = objects[0] as MusicTrack; Assert.AreEqual ("Foo Bar", music_track.Title); Assert.AreEqual (42, music_track.OriginalTrackNumber); Assert.AreEqual ("Boo Far", music_track.Artists[0].Name); Assert.AreEqual ("Bat", music_track.Genres[0]); Assert.AreEqual (music_track.Id, ((Item)objects[1]).RefId); Assert.AreEqual (music_track.Id, ((Item)objects[2]).RefId); var music_genre = objects[4] as MusicGenre; Assert.AreEqual ("Bat", music_genre.Title); Assert.AreEqual (1, music_genre.ChildCount); var music_artist = objects[6] as MusicArtist; Assert.AreEqual ("Boo Far", music_artist.Title); Assert.AreEqual (1, music_artist.ChildCount); Assert.AreEqual ("Bat", music_artist.Genres[0]); } [Test] public void MultipleArtistAndGenreTags () { var builder = new Builder (); builder.OnTag (new Tag { Title = "Foo Bar", Track = 42, Performers = new[] { "Boo Far" }, Genres = new[] { "Bazz" } }); builder.OnTag (new Tag { Title = "Hurt", Track = 1, Performers = new[] { "Our Lady J" }, Genres = new[] { "Bazz", "Electro Gospel" } }); var objects = builder.OnDone (); var music_track = objects[0] as MusicTrack; Assert.AreEqual ("Foo Bar", music_track.Title); Assert.AreEqual (42, music_track.OriginalTrackNumber); Assert.AreEqual ("Boo Far", music_track.Artists[0].Name); Assert.AreEqual ("Bazz", music_track.Genres[0]); Assert.AreEqual (music_track.Id, ((Item)objects[1]).RefId); Assert.AreEqual (music_track.Id, ((Item)objects[2]).RefId); music_track = objects[3] as MusicTrack; Assert.AreEqual ("Hurt", music_track.Title); Assert.AreEqual (1, music_track.OriginalTrackNumber); Assert.AreEqual ("Our Lady J", music_track.Artists[0].Name); Assert.AreEqual ("Bazz", music_track.Genres[0]); Assert.AreEqual ("Electro Gospel", music_track.Genres[1]); Assert.AreEqual (music_track.Id, ((Item)objects[4]).RefId); Assert.AreEqual (music_track.Id, ((Item)objects[5]).RefId); Assert.AreEqual (music_track.Id, ((Item)objects[6]).RefId); var music_genre = objects[8] as MusicGenre; Assert.AreEqual ("Bazz", music_genre.Title); Assert.AreEqual (2, music_genre.ChildCount); music_genre = objects[9] as MusicGenre; Assert.AreEqual ("Electro Gospel", music_genre.Title); Assert.AreEqual (1, music_genre.ChildCount); var music_artist = objects[11] as MusicArtist; Assert.AreEqual ("Boo Far", music_artist.Title); Assert.AreEqual (1, music_artist.ChildCount); Assert.AreEqual ("Bazz", music_artist.Genres[0]); music_artist = objects[12] as MusicArtist; Assert.AreEqual ("Our Lady J", music_artist.Title); Assert.AreEqual (1, music_artist.ChildCount); Assert.AreEqual ("Bazz", music_artist.Genres[0]); Assert.AreEqual ("Electro Gospel", music_artist.Genres[1]); } } } mono-upnp-0.1.2/expansions.m40000664000175000017500000000146611715002253017354 0ustar00lorentzlorentz00000000000000AC_DEFUN([SHAMROCK_EXPAND_LIBDIR], [ expanded_libdir=`( case $prefix in NONE) prefix=$ac_default_prefix ;; *) ;; esac case $exec_prefix in NONE) exec_prefix=$prefix ;; *) ;; esac eval echo $libdir )` AC_SUBST(expanded_libdir) ]) AC_DEFUN([SHAMROCK_EXPAND_BINDIR], [ expanded_bindir=`( case $prefix in NONE) prefix=$ac_default_prefix ;; *) ;; esac case $exec_prefix in NONE) exec_prefix=$prefix ;; *) ;; esac eval echo $bindir )` AC_SUBST(expanded_bindir) ]) AC_DEFUN([SHAMROCK_EXPAND_DATADIR], [ case $prefix in NONE) prefix=$ac_default_prefix ;; *) ;; esac case $exec_prefix in NONE) exec_prefix=$prefix ;; *) ;; esac expanded_datadir=`(eval echo $datadir)` expanded_datadir=`(eval echo $expanded_datadir)` AC_SUBST(expanded_datadir) ]) mono-upnp-0.1.2/missing0000755000175000017500000002415211736361705016332 0ustar00lorentzlorentz00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2012-01-06.13; # UTC # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, # 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # 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, 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, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file yacc create \`y.tab.[ch]', if possible, from existing .[ch] Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and \`g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # normalize program name to check for. program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). This is about non-GNU programs, so use $1 not # $program. case $1 in lex*|yacc*) # Not GNU programs, they don't have --version. ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $program in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te*) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison*|yacc*) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG=\${$#} case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex*|flex*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG=\${$#} case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit $? fi ;; makeinfo*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: