uget-2.2.0/0000755000175000000120000000000013224533052007445 500000000000000uget-2.2.0/AUTHORS0000644000175000000120000000057213203310772010440 00000000000000uGet - A download manager with GUI. ============================================= Active Developer: ------------------ C.H. Huang (plushuang.tw@gmail.com) - Maintainer Project Manager: ------------------ Michael Tunnell (visuex.com) Artists: -------- Michael Tunnell - Logo Designer saf1 (linuxac.org) - Former Logo Designer Skeleton_Eel (linuxac.org) - Former Logo improver uget-2.2.0/ar-lib0000755000175000000120000001330213144520723010462 00000000000000#! /bin/sh # Wrapper for Microsoft lib.exe me=ar-lib scriptversion=2012-03-01.08; # UTC # Copyright (C) 2010-2017 Free Software Foundation, Inc. # Written by Peter Rosin . # # 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. # This file is maintained in Automake, please report # bugs to or send patches to # . # func_error message func_error () { echo "$me: $1" 1>&2 exit 1 } file_conv= # func_file_conv build_file # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv in mingw) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin) file=`cygpath -m "$file" || echo "$file"` ;; wine) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_at_file at_file operation archive # Iterate over all members in AT_FILE performing OPERATION on ARCHIVE # for each of them. # When interpreting the content of the @FILE, do NOT use func_file_conv, # since the user would need to supply preconverted file names to # binutils ar, at least for MinGW. func_at_file () { operation=$2 archive=$3 at_file_contents=`cat "$1"` eval set x "$at_file_contents" shift for member do $AR -NOLOGO $operation:"$member" "$archive" || exit $? done } case $1 in '') func_error "no command. Try '$0 --help' for more information." ;; -h | --h*) cat < 4GB. 5. Fix: program will move download to incorrect position if user switch to offline mode. 6. Fix: Segmentation fault after pressing delete key on gtk window. 7. Fix: Wayland hidden tray. 8. update translation files. uGet 2.1.4: (2016-05-16) 1. In speed limit mode, program adjust existing task speed when adding new task. 2. Add new setting "Display large icon". 3. Add configure argument "--enable-unix-socket" to use JSON-RPC over UNIX domain socket. 4. use msys2 + mingw to build uGet for windows. 5. curl plug-in: Don't use CURLAUTH_ANY, it causes authentication failed. 6. Fix: User can't use command-line to assign config directory (ui-gtk-1to2). 7. (2.1.3-2) Fix: Incorrect encoding on some characters (e.g. French characters) 8. (2.1.3-2) Fix: Program stop download queuing in some case. * uGet for Windows upgrade GTK+ from 3.10.4 to 3.16.6 uGet 2.1.3: (2016-04-10) 1. Fix: UI freeze if user activate download in sorted list. 2. Add Keywords entry into desktop file (Elías Alejandro Año Mendoza) 3. update translation files. uGet 2.1.2: (2016-04-01) Revert URI decoder to 2.0.4, it may fix incorrect encoding on some characters. uGet 2.1.1: (2016-03-20) 1. curl plug-in: fix a bug that downloaded file may be incomplete in some case. 2. curl plug-in: improve downloaded segment handler. 3. curl plug-in: set min split size to 10 MiB. 4. curl plug-in: adjust speed if plug-in add/remove segments in speed limit mode. 5. aria2 plug-in: fix a memory leak. 6. media plug-in: report error if YouTube video has been removed. * This version fix bug that download speed is slow when progress near 100% * If you usually get error message "Incorrect source", I suggest you use this version. uGet 2.1.0: (2016-02-20) 1. Add new media plug-in to get link from media website. 2. if file "uget-portable-mode" exists, data files save in installed folder. (Windows) 3. curl plug-in: avoid showing "99:99:99" in "elapsed" when downloading start. 4. curl plug-in: avoid reporting "Incorrect source" when downloading finished. 5. Fix: Program stop running download when user set "Runnable" to it. * In Windows, If "uget-portable-mode" and "uget.exe" place in the same folder, data files will save in uGet installed folder. uget-2.2.0/pixmaps/0000755000175000000120000000000013224533052011126 500000000000000uget-2.2.0/pixmaps/Makefile.am0000644000175000000120000000364413203310773013111 00000000000000# icons installing path: # $(datadir)/icons/hicolor/16x16/apps/uget-icon.png # $(datadir)/icons/hicolor/22x22/apps/uget-icon.png # $(datadir)/icons/hicolor/24x24/apps/uget-icon.png # $(datadir)/icons/hicolor/32x32/apps/uget-icon.png # $(datadir)/icons/hicolor/48x48/apps/uget-icon.png # $(datadir)/icons/hicolor/64x64/apps/uget-icon.png # $(datadir)/icons/hicolor/96x96/apps/uget-icon.png # $(datadir)/icons/hicolor/128x128/apps/uget-icon.png # $(datadir)/icons/hicolor/scalable/apps/uget-icon.svg # iconsdir = $(datadir) nobase_dist_icons_DATA = \ icons/hicolor/16x16/apps/uget-icon.png \ icons/hicolor/22x22/apps/uget-icon.png \ icons/hicolor/24x24/apps/uget-icon.png \ icons/hicolor/32x32/apps/uget-icon.png \ icons/hicolor/48x48/apps/uget-icon.png \ icons/hicolor/64x64/apps/uget-icon.png \ icons/hicolor/96x96/apps/uget-icon.png \ icons/hicolor/128x128/apps/uget-icon.png \ icons/hicolor/scalable/apps/uget-icon.svg \ icons/hicolor/16x16/apps/uget-tray-default.png \ icons/hicolor/22x22/apps/uget-tray-default.png \ icons/hicolor/24x24/apps/uget-tray-default.png \ icons/hicolor/32x32/apps/uget-tray-default.png \ icons/hicolor/48x48/apps/uget-tray-default.png \ icons/hicolor/16x16/apps/uget-tray-downloading.png \ icons/hicolor/22x22/apps/uget-tray-downloading.png \ icons/hicolor/24x24/apps/uget-tray-downloading.png \ icons/hicolor/32x32/apps/uget-tray-downloading.png \ icons/hicolor/48x48/apps/uget-tray-downloading.png \ icons/hicolor/16x16/apps/uget-tray-error.png \ icons/hicolor/22x22/apps/uget-tray-error.png \ icons/hicolor/24x24/apps/uget-tray-error.png \ icons/hicolor/32x32/apps/uget-tray-error.png \ icons/hicolor/48x48/apps/uget-tray-error.png # pixmaps # ugetpixmapdir = $(datadir)/pixmaps/uget dist_ugetpixmap_DATA = logo.png # icons/hicolor/index.theme is needed by gtk_icon_theme_append_search_path() # EXTRA_DIST = icons/hicolor/index.theme uget-2.2.0/pixmaps/Makefile.in0000644000175000000120000004410313224532746013126 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 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@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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 = pixmaps ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(dist_ugetpixmap_DATA) \ $(nobase_dist_icons_DATA) $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac 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)$(ugetpixmapdir)" "$(DESTDIR)$(iconsdir)" DATA = $(dist_ugetpixmap_DATA) $(nobase_dist_icons_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ APP_INDICATOR_CFLAGS = @APP_INDICATOR_CFLAGS@ APP_INDICATOR_LIBS = @APP_INDICATOR_LIBS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_CONFIG = @CURL_CONFIG@ CURL_LIBS = @CURL_LIBS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GETCONF = @GETCONF@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GSTREAMER_CFLAGS = @GSTREAMER_CFLAGS@ GSTREAMER_LIBS = @GSTREAMER_LIBS@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LDFLAGS = @LDFLAGS@ LFS_CFLAGS = @LFS_CFLAGS@ LFS_LDFLAGS = @LFS_LDFLAGS@ LIBCRYPTO_CFLAGS = @LIBCRYPTO_CFLAGS@ LIBCRYPTO_LIBS = @LIBCRYPTO_LIBS@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBNOTIFY_CFLAGS = @LIBNOTIFY_CFLAGS@ LIBNOTIFY_LIBS = @LIBNOTIFY_LIBS@ LIBOBJS = @LIBOBJS@ LIBPWMD_CFLAGS = @LIBPWMD_CFLAGS@ LIBPWMD_LIBS = @LIBPWMD_LIBS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ OBJEXT = @OBJEXT@ 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@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ 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@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ 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@ # icons installing path: # $(datadir)/icons/hicolor/16x16/apps/uget-icon.png # $(datadir)/icons/hicolor/22x22/apps/uget-icon.png # $(datadir)/icons/hicolor/24x24/apps/uget-icon.png # $(datadir)/icons/hicolor/32x32/apps/uget-icon.png # $(datadir)/icons/hicolor/48x48/apps/uget-icon.png # $(datadir)/icons/hicolor/64x64/apps/uget-icon.png # $(datadir)/icons/hicolor/96x96/apps/uget-icon.png # $(datadir)/icons/hicolor/128x128/apps/uget-icon.png # $(datadir)/icons/hicolor/scalable/apps/uget-icon.svg # iconsdir = $(datadir) nobase_dist_icons_DATA = \ icons/hicolor/16x16/apps/uget-icon.png \ icons/hicolor/22x22/apps/uget-icon.png \ icons/hicolor/24x24/apps/uget-icon.png \ icons/hicolor/32x32/apps/uget-icon.png \ icons/hicolor/48x48/apps/uget-icon.png \ icons/hicolor/64x64/apps/uget-icon.png \ icons/hicolor/96x96/apps/uget-icon.png \ icons/hicolor/128x128/apps/uget-icon.png \ icons/hicolor/scalable/apps/uget-icon.svg \ icons/hicolor/16x16/apps/uget-tray-default.png \ icons/hicolor/22x22/apps/uget-tray-default.png \ icons/hicolor/24x24/apps/uget-tray-default.png \ icons/hicolor/32x32/apps/uget-tray-default.png \ icons/hicolor/48x48/apps/uget-tray-default.png \ icons/hicolor/16x16/apps/uget-tray-downloading.png \ icons/hicolor/22x22/apps/uget-tray-downloading.png \ icons/hicolor/24x24/apps/uget-tray-downloading.png \ icons/hicolor/32x32/apps/uget-tray-downloading.png \ icons/hicolor/48x48/apps/uget-tray-downloading.png \ icons/hicolor/16x16/apps/uget-tray-error.png \ icons/hicolor/22x22/apps/uget-tray-error.png \ icons/hicolor/24x24/apps/uget-tray-error.png \ icons/hicolor/32x32/apps/uget-tray-error.png \ icons/hicolor/48x48/apps/uget-tray-error.png # pixmaps # ugetpixmapdir = $(datadir)/pixmaps/uget dist_ugetpixmap_DATA = logo.png # icons/hicolor/index.theme is needed by gtk_icon_theme_append_search_path() # EXTRA_DIST = icons/hicolor/index.theme all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(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) --gnu pixmaps/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu pixmaps/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-dist_ugetpixmapDATA: $(dist_ugetpixmap_DATA) @$(NORMAL_INSTALL) @list='$(dist_ugetpixmap_DATA)'; test -n "$(ugetpixmapdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(ugetpixmapdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(ugetpixmapdir)" || exit 1; \ fi; \ 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)$(ugetpixmapdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(ugetpixmapdir)" || exit $$?; \ done uninstall-dist_ugetpixmapDATA: @$(NORMAL_UNINSTALL) @list='$(dist_ugetpixmap_DATA)'; test -n "$(ugetpixmapdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(ugetpixmapdir)'; $(am__uninstall_files_from_dir) install-nobase_dist_iconsDATA: $(nobase_dist_icons_DATA) @$(NORMAL_INSTALL) @list='$(nobase_dist_icons_DATA)'; test -n "$(iconsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(iconsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(iconsdir)" || exit 1; \ fi; \ $(am__nobase_list) | while read dir files; do \ xfiles=; for file in $$files; do \ if test -f "$$file"; then xfiles="$$xfiles $$file"; \ else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \ test -z "$$xfiles" || { \ test "x$$dir" = x. || { \ echo " $(MKDIR_P) '$(DESTDIR)$(iconsdir)/$$dir'"; \ $(MKDIR_P) "$(DESTDIR)$(iconsdir)/$$dir"; }; \ echo " $(INSTALL_DATA) $$xfiles '$(DESTDIR)$(iconsdir)/$$dir'"; \ $(INSTALL_DATA) $$xfiles "$(DESTDIR)$(iconsdir)/$$dir" || exit $$?; }; \ done uninstall-nobase_dist_iconsDATA: @$(NORMAL_UNINSTALL) @list='$(nobase_dist_icons_DATA)'; test -n "$(iconsdir)" || list=; \ $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \ dir='$(DESTDIR)$(iconsdir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: 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 $(DATA) installdirs: for dir in "$(DESTDIR)$(ugetpixmapdir)" "$(DESTDIR)$(iconsdir)"; 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: 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-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-dist_ugetpixmapDATA \ install-nobase_dist_iconsDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: 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-dist_ugetpixmapDATA \ uninstall-nobase_dist_iconsDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic cscopelist-am \ ctags-am distclean distclean-generic distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dist_ugetpixmapDATA install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-nobase_dist_iconsDATA install-pdf install-pdf-am \ 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 tags-am uninstall uninstall-am \ uninstall-dist_ugetpixmapDATA uninstall-nobase_dist_iconsDATA .PRECIOUS: 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: uget-2.2.0/pixmaps/logo.png0000644000175000000120000001640613203310774012524 00000000000000PNG  IHDR]ҙtEXtSoftwareAdobe ImageReadyqe<IDATx] |E֯}@@p.X!HVCD]@UEa/r|"࢟zs(7BBr]߫NLMOO+Lϯ~t~U`y1kNbBO3 0*"t4^00*uqD„'0ouf$(>/ RF$ <)c:=oŲLL} p"\+CsT˻+mϔёqA[`ZU `^l()( Y`Qt6M~tHAy[-"bEDLp '@ң4h Do)'Ɉ9t١A>!4b@d}em%l B#I{luF򺷿V:&5P+420LJN̤9i3:e]`MEXrEnW?dL(fД/¹ZWr|υş,0"m{$~YoAsh$]"_nXaofbiL6 a1 Sso$`5] 5gf(g;Qgx† R52gay9mz$EEŇSfNF`AZ vHCCC '][BhS$!6%?I: 6CG60GV5=Cͣ" ѤQ닀0DpPS Xۮ&iQXAtU &̘4Q hB cš:tx3,zM.PV5@`[@]R>F瓘y-fձϓBZnoAQ 1:F=\(M1ݞ ?V TTzz6xWmseG6NtcӬUQǫ@ZYP+\^S @2rq,NX-NUr+>SŊi^i8f0[@{oZMWϗI((N HjKr3 ܄->YrT:CϘ_JKAv3~/j%//)xm=OaJd9iF0ϲ6%<P HurfLY1'+jLKZeg3Jj JǬ?Pē)}yv 8Y&iAnq n'0 \e(E4O#ԋ.Vڲz&뾁d)L(g-; ΀=E/8f`|҆aqf$ߊ29> P )c(Tue8r*ޠIt PuV+IA@ա(c?V8ƄK V 9XKVM喒O>%BJ=2T^S*G6Q!}vK.㭍u"ԭLi=!.}|`V|zQނmV<`@+wA$Ti|݀M7^:"z~8sd.]6L&+>tistj3jF#pk{F3! o%4g[! ~ޜ醑o-ê"Iv0=lOa9%K:nK!E׎1hzj^ ‚Q94al96@pt@GXJ׷nblP^ p>c0D=m<{Hh7Ӎ%cH]QO@ I*tefD qpPP(xP~uotO)ՓpC[3 ẬSr|yia)D>Wr@UdϸŚ&a?S 8O{Xqȧ3$`{lTx 7pgCR7ݨۆ0P S?I7 +l{G2 jFMjp-+S^$#М}PMj5!ȋ04yί^W|RzsynLM<1Mg`2a5}MVyMe~S/ǁxFX׿3҅gpuZl h*B2?4+=YOɽBZ:.GWtQ7 RzJOtFk vYP^xd hU xE4?eNi&r7B"Ma9y><].&8k'>yK4 ~rwԁ 8 6AY?p38y"[-π=|3b>cԲCX(%F}I@]FaLx9wkgg@'1CLR<=_ļ;x/KLmhΏt#5C7IF* ݀'Mb K r3!p-j/6=l ]pU`9?,WrV̺{Mejj>pn^]X?d?UXe$&6kLI [4^Ҋp^K5zeGSӔ?k+􉙑OHվZe9i` &YM̡`Ś&C֐ftiŃw'wz˅^p 0Wzx\@7tR-S2ZŴ,$YbѓFk OҴ/);@agw;Zi:m1DI$2x:I?G?~ 浮'na~MSɊ5v,-8U;!khӿCdu6?sh@ cwtӤtD&X UExH;h+ꑠ9]t{lon2ARbHЇrKߏoyL92N/xM⇖YCp2~eFcߎ50܅o#zl6ײVK/Td϶Ub@ Z%[Fj{ ޗ;*z>P[i-Z"9Rd $Nef5 )fp PcVZǟa6zεئG @u\8;@+)/Q$M87w|pcA czw ܋Q?e5aYgDjo" [];*gmuÏ)S23×Z~窫."i0 $:{7^P⇰ĬUKT389e1c@Rh_q3Uf 4`³_q'gE!~ěG  !k2fB44&2 ̟O;Q5`}^lZe !mdSt͛qFc ,:J-1%QH1SKt ^ak9@-~A'o<)i7)suu5n,trր&VBm و3nOi_we@M _TE' ˤS|^d.A!@zuX v#BM-r {W^:Oͦ#Ƃ] 'L:cű|IR;JxʱQV6-N9X#gA 'Lf8L}PShWa*!MVm!C׷Yn ׃,٤_"2}gk%bߎ黦+I6+{tT֨2cԷl7tU$Dr-Z v:FnmN|xƸZt Dž_-s]"#GK^)wFzSZ Ė-nO V|ϗ_T"t %Pks_PF%nzm\!A*'k@n[  ss_,gnct1p|!&uIYߔf#$y嚲ȅaG\]2zܣ2[:/L=~E^:7.븦{ H/7 pB%wyQ)iv;= B[슂2~owu ߒY})to,i1"q?ȲrYLjE zʂt珯Gnh0P@l y@19?Xo^-,1EDVE09n^GmxK39u'3@f?.qх9訂ylpL20&&kiiKVZҥK]m{9걒Hsرc/_wƍE4 ~Ux]{A_X0yf0gz`٥`B #(%K䧥m5ުU=_:͚5k2(tYGUo{5m5%|o}FjE_L;7+S K}օj'/eY rJ-.ˆEonjuZpСܭ[miӦzq! Cp:2E΍(J6UUUF1ZƠf)ykа’3>J|.Vʃ H9֒)VCl{M˅`^?NÕ7) bhZSj֬+W^|7Dy,XyeeW_}u]֭,SPP0pH-[l;EW&Mꓒgf7ono%//Gz>0{ |+Ȱ}TTdS +W^žǀ=N~ ;ŋ:!33s sd3wYmo1 r} uõHr|sI;vX |B;_sٱ%ǫV _62Z=*_OK7TۦvL2wbl&YD?a8%X~{ԾĪKE칹́6mt.^8x<}V;R|rn^ r5pؑ\ fwM[r.\ȃ;+Ӈ~ƌcH `:tJݧp7""Qjr?$nocׯ_tƍ p ׮]{ܩS 1 mdJ4@7/ͭ<6e06aPtX7 '}Fr"&iw$;H!;b̙3g(pPp0s̡ݺu{hӧ~zρbŊ/9r5k֐nN0pݻA$-x-!z!>y  }!'*lG !ەHBs@tפzk#WѣG߈ seee[-ZD}txxx_IMC\aTIItG7^=e99DǤtL1kQQdXb\(ϗ5"#N D 6`PF2"V,|9++k=Q]enBKT39J5I8e=j[Ϲƒ!T<&>:t\oBBBeJz8$'G}SvR 9L']VJ-c$ti SP2r'aɹ@v̝;P #X;2oڴ ,5ˉG騨:Jq QxJoDa 7o&Ԓ+Jd2ףzq@t\V$].U*ڋE:MTQn+zrAVL8H=lذ,Qsqcp3g ;55uQJBle ` E + eĉ[Kגe {5cn>nݔ)Sz|z3PAǏ=]ᾚ^r۷39߷otB}pOzn#{.ȁS_Kk9I gϞݗt,==}%(h^{`]g@{?t[M-hiڵ߽+@^p$~ u/ٙn4{fϞM4YQ8N2ͪdZgPoX!pw:uj6 |-OkMY:9IOYqq1Ue@#piR+mfÎ;.A5u\PA1ooΝx7 &#`aR_]z>{_~I&ż>QTTƍɘUӦM; ,*le\9v=͛7!߿p!>%%%  $8&fټ|ѣt]tNpOwᄍlٲ#7o s,' 6rB$>{%e7![<8tA&ѓjsyV.#"֬"@]:qr*:&~,ӢVIENDB`uget-2.2.0/pixmaps/icons/0000755000175000000120000000000013224533052012241 500000000000000uget-2.2.0/pixmaps/icons/hicolor/0000755000175000000120000000000013224533052013700 500000000000000uget-2.2.0/pixmaps/icons/hicolor/32x32/0000755000175000000120000000000013224533052014461 500000000000000uget-2.2.0/pixmaps/icons/hicolor/32x32/apps/0000755000175000000120000000000013224533052015424 500000000000000uget-2.2.0/pixmaps/icons/hicolor/32x32/apps/uget-icon.png0000644000175000000120000000362113203310772017745 00000000000000PNG  IHDR szztEXtSoftwareAdobe ImageReadyqe<3IDATxڴWMlTU>73)F jXWvcD,؉5A\ɂrJj4hE~D(@3̼w;ymiQ0M99ORXZsGkM9#wٙ+Ny\OXEEuf_oR\&uywޮQ5fJ/q gtϜ8!8vJ=z߿ةOk C+`K3=3K)I̚j{'m8%du Pw{!^kP{cs}4|{aB+9,> ,˘EE!Z6`t7*xie4:rnN6^oI8\p6-W$`7!ʈ6ouII<#6ƵsGhַXƃƐxJ)jYOEKCK%|P֖+02 U>73mJxW2E۞\KOZ$'>Zd `QXF\NŜ/NѭZ> /m\8$p" &yQ+Ge9񢉹-۷O/ ˦g!93 Y.R1/>O$ E}VXRJA cVd^7u`]:{~0bD77@BIk-g-2=:YHըB+ֺ[&S*sX2h1#{e0 J,RI`A-Ɂ+d9+AgJ"mjɵ%Gԉ>p v"]$ޗ -,r[ ˽WXJUNqb֯YԿl?F#\mRTQaNƠ5.~^$v\: 5-@#OǶ= ǯ>%l\lBK3ʩA&BpwX(J+KTOڐ~:MB <;B9eFg=e!b񍝐tvdnsЅUJL5yF?_I ""{I'+`@kodBC-G{8WU`f;+ h? aj8ݮMBi0B4Z|6?VpyREKvm!u/&j5h :[DC,𯌆m:E=m8BC-Dgt6}JJjTߠ)`TR\SHs,JEI(p'ЃkWNgPk΢n[ac?]^JQGNCC:0`xQ6f@XV~ob9PvBkj]&]6,'(a5q4NiS`e¤$SvB$+ya\S v.! 8 %T0 Xq"NQW8pe6Y$LҺvKɣJJbũ-9ς6 h7y~) ^܄iL3ޱsN[>S " HsrW勁Sf>.Fr"DjX7=(4,>Z.[ %  ~P0Ū?}4 Ag6Jv>1=}^?,*pW_$"{H#9H pw`2\~~Ŋoe4 GhmHRAD zN^6f&&- i'_>bT(Hp@x8ɫ[K^80yC8p`5_~NK| (xrL Xٙa&~R"

Xal^bu-Yt'%> Zi@Y) / 󙈰ϯa96@1bacUb$/1T1`8BT.4Rgbf{ځ'/,]+3S$CO^m շ=3/?Aw¯tojiőI[FX5k[$1`|oRHBw<(dcuNYk FwNs&@1Kcbb| gx~2h0J(Ͽ@k$r.0>_!:`faRBhR@BfFV5D ]@ 8d UE/;oXalFay8 A?Hsr/adbDQvg7C^,HEY__LdbTpٗ¦u@*D@J'/ u ]3ղS/ R4Z/|}STCO 8׿,lLnH?. X|r>,R ix𓲤*B w)%!@r9@ x|prWe u7߅p}yCr;ۇW~Gހ,:д80Z˻`G\Ʀv6\,k}R:a_ Je[!e -5{٥vt'&fF?`J Ҙ(* y8$s @KlpX$o~MlTȖ o+l[" p:kk>XG02I-[ &tf&e8soOfj譨 7OYJD#XmP\w .>RmFފ!DŽ#=j{ Π_Tl2Tuw6"Y~"7Ju8 Jqj*sU󇟿x绀 I@TCibtbk :70'nIENDB`uget-2.2.0/pixmaps/icons/hicolor/scalable/0000755000175000000120000000000013224533052015446 500000000000000uget-2.2.0/pixmaps/icons/hicolor/scalable/apps/0000755000175000000120000000000013224533052016411 500000000000000uget-2.2.0/pixmaps/icons/hicolor/scalable/apps/uget-icon.svg0000644000175000000120000004366713203310773020764 00000000000000 image/svg+xml uget-2.2.0/pixmaps/icons/hicolor/48x48/0000755000175000000120000000000013224533052014477 500000000000000uget-2.2.0/pixmaps/icons/hicolor/48x48/apps/0000755000175000000120000000000013224533052015442 500000000000000uget-2.2.0/pixmaps/icons/hicolor/48x48/apps/uget-icon.png0000644000175000000120000000627213203310773017771 00000000000000PNG  IHDR00WtEXtSoftwareAdobe ImageReadyqe< \IDATxZ]]U^{s\_%j ڄ` $<`& } F 1"EHCV jҙ;v)MN;wk}[k}ʼn'ZB]5Y򆘛E{Ȳ_Ӵw}74 j 333⡇~d_}U5<2DY2M볩;oݩy䗢n[)%P-0wg;n~RIoJi2zag/6zɩ {yo+IFv~<(k.byG$2xTv;ߚ{]?U?5m7]'aEG{0PZ<,( "7j,F2֒0*5M|IQCu Zhk@ZYZŋ%Od*eϭF~}z{vuFu""*W~=bނž`)lKIok'"1?݅:c[1X?'Yi_00Ͻk) }+Vq? (Ye gk F,1 ( kv% $IB$0I 7~mԚD%uvv8y2AnFӿ? cC 5pYpN )z"s6bTv a$1 a7UӓEv! @]wsl6,{gcx-O(6i#S, O*Tsak 7wT] y 2'/W6 PVmsMxN~c.+C0)+G;ۙłW9 )_߉+yp}QXf:u<;іcA d(cJ p酩Yro(>+,?/~& Xe k})d5/%.89uDqb< q4.V튅~_#4]8n@c,D "RFt/["Z?KAxrgS,gnu O Y#B u?(- C`wv+DA!Q~.b"4=mjîۮ/ѐ.b463JhKc 8t qp \X?<jMd7^ϦPPƾbQ)BOpNY ;w"B, NDN6iR-o\ J]OV=-"MgPU Q\ Uӝ8›$5Ulߵ7(JC"6J 9z@6 Cѭ"QxUڍe[:@}sxn \CP@ɲS˥t"=;"Z:ȍbυsÞ .0vekUCǥ8K\IJpEyMa\3üh^P"bdAmZ:\s~Tիx1 _Md KJp/'.Tܝɠ-kv(#pl0zlqWxA!$0~Kшt J /%P»O o<axS㲻sw1倌s sBUцTX_^;@Ł"C Wř O8{pQ 2m&q4TUHV2,gMCga p Os}'9zSSHEiHh31k)QDbˇ h7֜34aK4w ^:dwԀbJ*n>T'TQ6vX,m Èt6;hqR -]K#o{?ԁRZ_>c "BLN)bxTKH.I] #z4$&%d h!G2y.їN9q eIb%}TJMP*Knk2p S=#37h?$o~r ~zGf%[<}S- -vum؂N1rBA6\:rb Hf&\ƻo9o*x)pg.!\oC#8xA0[Ǵ% TAr*Iס'f%8B _ۂ985>1@lkW8˂uק0ʶx@x墉_Sԩvqk0<\MX}h"7bV]+?ԹEJ"DCt`e<ﲁ皫u'&d7'U [ v ,g&;=O+}'RJp-u;99t1pAz*_Z[%IO_2H~Q2p C98sf-[D A*MH7{Cxkl %0 OCG\\cVyB!ʸ ae%mCn_  0o!L+m6A%XG[wBTxp*6Kyw\~W-7Vﰙjsdq‹O ZDWrԆ츻FA$kmvSp* c:gd|atrJ;@wCޠC<_ ; rR^^ᓝ+9ii&zFJ ܽ{h5r_9L[[ͭ-^ʕsy}Iӆ[6HX 3aOY/WJ<ljgpͭaHx6|ƇNZE8V$IXJ4C g;q LlVLW yr/ P7MqN5IpyE{H#[=ع{W ~zp>cTotj}?۷-@kN<VZ?\|V!R&׽ޣJ[nEٳ'b獗IENDB`uget-2.2.0/pixmaps/icons/hicolor/48x48/apps/uget-tray-default.png0000644000175000000120000000165613203310773021443 00000000000000PNG  IHDR00WtEXtSoftwareAdobe ImageReadyqe<PIDATxb?PL Cz`#,FFF 8E*^1@pL vb~5`liS@ـ C` Q5R؆I뇟.ZxHe`r=Cq5O$'0+2`&UR!=V$¿Dy_{<t<Ez WG=+1t761?R/Dy⎇ >H^ 3Rg:oGU~KXDp Lo?\p<H O,~}A3  >1 #Ӑ' `R ?O!$,=d< Pr󵠹ĹD͌ /)i̽[p2̢8TJOIvQqQ5;ꇑ?6&38 BjY[ ]׳>? lso ~yt^o~2X<ǷcipW AOUD1ݶz2^w`ͣ"ɉ`)*ӫo*@]m*@cJb*K_LC-!AZ:ʗw?;1@p,6fK]9)Z8,8r뇟; C ;zj|aj"r\@DL w?~>O^;P2Wgj{@c>4JA TixbPwQf;h["*5y`jӥd>F 1ӿ XIENDB`uget-2.2.0/pixmaps/icons/hicolor/48x48/apps/uget-tray-error.png0000644000175000000120000000253213203310773021142 00000000000000PNG  IHDR00WtEXtSoftwareAdobe ImageReadyqe<IDATxZ}L[Uo__ -¬6 %E1+a]ܨ%FctAd32q9 52Ba-/υ){I~~{=ۉ#(- X@FżTysy`V (V'ȃAe| (K` L dL7(: H+N>ϧr(-K@.M0[ǚk!Y9ҝUŅi 4fn7LZ=~7? [W * K23ƌN8 n$eĴP贶n`O Y=.hT1G!#J8CZr+z/+/r?Q}wvڠ:v۱ M@;猒,zq 6CէlJ_FwuB8ǜlk庈%4ќese 0!4@y":ӳH<4Nftgi< ܁ks+K?9DJpB>wg8)qK< sGZ"&A>#WB:bd2wdoAxD'zCs$waU4ĵ[t]g/ tǿا3;8P.km-*?L(\@W_C({ Xasu:u`!x5BX jurSvo'., [dP{lo-P)\)SLYtR/u\@#i^BMZZ(uF ]oOVZXB ersf{=I@g~aB[m0_Q  y xul)&C!c:|HuP?ZL1#;3Ih18z~.Y۰s>C[Z%o}v,ONC&S$&֏z)qe#kB8וR>I7|@Z|yݟoݐW%QRC!+hL+SwWr7۱BPu[ > )e5KEyU&Se08 U A:@5NnDrS=Z#p@6Cl#<4,ݼX{Yä#2KIENDB`uget-2.2.0/pixmaps/icons/hicolor/48x48/apps/uget-tray-downloading.png0000644000175000000120000000217413203310774022321 00000000000000PNG  IHDR00WtEXtSoftwareAdobe ImageReadyqe<IDATxb?PL Cz`#,FFF 8E*^1@ b~}`l)Q@ـ4 NC` Q5RϾ~?|spp׷?NBuK]}v7|j"۬zǟT0T)!u}^S$?8d7!Ef*SRg:ƧG"!EUd?6#FXhtSX IUTHkg>O {<t<Ez xzMG""6_i @EDy⎇Eǟiz`)c"bk`)"&hr%*C;UbT$i`xxͻO@7_>{%) qp_zye;h9xm;wHR:NtK 'Os$aŔDuX+12avq5R43@]*@}I]RZdbPS\P b[_/Bb+ Nde iڡcRi 6.O"/A"* ;G$4LZŽ^J@~肎)QCs7 Zv54Otb='WT(`i'}{R2k{>1.VY^jcm-CHQ 9^}S l,HE7q %κa-C8Aezfac˘j(%$H[>o~2+cE` fB(xHz"&\SAMmP/8r@n9ҨU<- A-HHuiAInN9^l1bϿ~yǣo>8 l@d=DH8;ƥ 4Jn#t"gp QP\71:= @ɣz9IENDB`uget-2.2.0/pixmaps/icons/hicolor/22x22/0000755000175000000120000000000013224533052014457 500000000000000uget-2.2.0/pixmaps/icons/hicolor/22x22/apps/0000755000175000000120000000000013224533052015422 500000000000000uget-2.2.0/pixmaps/icons/hicolor/22x22/apps/uget-icon.png0000644000175000000120000000205113203310774017741 00000000000000PNG  IHDRĴl;tEXtSoftwareAdobe ImageReadyqe<IDATxڤnEg;L06L8!V({Ċ% G@@X !a%Qh'a=9U=RkҢnbF7J|"/|jkr'瞋˟];A_ab8A?p~[$"D*G_% ʋ@PKd(J)BRkױ׃6Z>K3$qFVÇކv؃ak$-A$4mzȒ YgO`h-GM$.E 9\$9Kcu6+5^} 3S \8`l laoYX1hIA@ale@ JjL='pM(rB1~ cx^GdV:kPJ[w0JUsb#U(y,V;A=9"9JeRʭO߬85PfM*/?ݠB znb8,B`yGx5p͞@ڐMq\â@P( )quۦ Tc?^XȚI a󑡃E Xf>g' ?BB?,3G]|B =FJbK9*V%#;IENDB`uget-2.2.0/pixmaps/icons/hicolor/22x22/apps/uget-tray-default.png0000644000175000000120000000107213203310773021413 00000000000000PNG  IHDRĴl;tEXtSoftwareAdobe ImageReadyqe<IDATxb?--\ 2Q@0Z#  ـR !֥_H1?*C0~~FT$B,Ha:H `#YËoz>>~7?j6M /}bgecGW_f絨iXS #3 u 18wO|( 8\O| ?,Lz%عX9 ##l 6 ٸX@ g2zFLOH;mOV< )I?s[8i,)_(0 ~n;Wn- B߮oxw6<JF&FW=~M_NO;k)O8 w'/-0 PRPÖ``faB]dA @_#R]ŏ/!_;npYG+~}MtWg_xb=}tŭR]gD,L Fhj`R/FSp^DqLfV&f'ϿKE Kc+no<#yzgxD`_b]RU@KA4@Y@}d.D2A99ݦNAFP]oǔ - ^e0r0)(qbM._?솕 I <7[@(MkZ`_Ӽ#IENDB`uget-2.2.0/pixmaps/icons/hicolor/96x96/0000755000175000000120000000000013224533052014505 500000000000000uget-2.2.0/pixmaps/icons/hicolor/96x96/apps/0000755000175000000120000000000013224533052015450 500000000000000uget-2.2.0/pixmaps/icons/hicolor/96x96/apps/uget-icon.png0000644000175000000120000001420113203310772017765 00000000000000PNG  IHDR``w8tEXtSoftwareAdobe ImageReadyqe<#IDATx]YWZuս؎LNd`4K`&3 B <$xaX$$i^x` 2b$8p=qvowSuunǶ>[ݺUN!v` gvHwe燧N #tNѓK.9w|Sx/]#>36e3y5!UX<877\5/Dae|l;WWW0E ~_OC(Ȼ۶w6Ή|pU1@!jtoO_Zfwaw F-h@V؟Xv{X0 [W:mq 1'ۿ716ڽ W;[XkPu_4444+imH~a~fgfpQB+$RMN'p-˿ɇ0! u< L&hfbz 7;sC?r=diACAKASIHҀ,ZPl7P{Ft9[tQ4zU6Y->p1 T@<:.T&SD$C} RY9UPт #:R>ħK f| jIv+AKASM4afFm?o`s˟ PҚ'`&f̯2崑;|bZ3*~rJNr&' t=?Z- v䙷j>AԅEF"9ESS#;_gZ^hpk eN`yKT?2xWˋ@!`L3`9j&j92Wbon  8H+LZ*v<dvJH~Iђ ?z1%/zx'wz~_;ov& SDhi-18"Hf@ R"=EKϾ|nnCX}OdɟT+.Z+n b$#6TT&%Ԁ@rHh8W6ӵmm[\H9}"-Vs,vz%`kĄi; !0I̠<#j0z*.,wJﵛ@1q^87"3~&)Eր\obz̋<Ӥފ/LKr5DCuWNڵ1trGg!  (ZTG_ZKtHjzaҗ'f 1b&lAD5veoSaUe[ GJ=97' ###E&E96[t&]MjrT NxY%6{~\* zD]<>Bяi_h8;So=JA%aR ϭL"̈́vb,"`\c AV7H4d"#I.];ak!/I!ݨf 2{҆EnЭGazBS^P5A^!p19=үTN#B#8a; B]-# t"2H;N7Hr(Zi}'lʂ3y5#EA;a氾Nj *MNKcA\5#^s%p5;1DVS,89 #{[m`pZ'&?Xӥ>`O'>wfw&$o!/:63;[9tUq%)Ld(?/B4бT3g:.,٦Ků/ ꚧ@3=FD7R"0A]h D(᥏QI*"Ayo6]&hDG= ȹuj"  HJahCC<}AФπBLX -.Iڝ2j۪VF(fi!_tI^/oC{c4y8J's#vEd>@(t=(>3tQQh,aR^x±0 JL;:&D4b&ψigGIG<‰!z{rzE(! tf O1$;QD"=,nPZݮ ~[bfdF=@ w2w%O9fo`&v"̗N=`묡lqBC΄XyF ,uFP@wv~ ,eKI֤E%Dm&b0BEo= 2J(䟹4K;U5H` ^[SȀCͤ.^KF EgjA?3j]a1A X?Lp]h_Z,Z-ڵ/n%Go\PO?mri@F r&btsaȁݨ!h?2>369_-.C!B ALL=ǬEdI9X3bE2)-/,T9>}_ ~^~>Mǀ.z׀ 1EUP=pEd8t|c{{kGpנ2_*ג8oBkv%w) 3bP͵$LgXD&xkkw nv?@U&d^4L09_,AVnܧbkùw(^7sTd轶"u)l/#-q2D6ոOh5śk0}ǟv+p].T!>AcAD#]UDT) \ &Twgœ-nyjXyVCqH*L 6 ͒ 2a}m&+HeCP б ԙ79\`.OסCsGzMBX"Iȅ1l&,91|Qi:/)w9jvy$&9aGdn,%cwO{<BIn+Kߛ;1Unˬ` <ݷIh>d.- WsɏyUEg5]DhQ+"( J1'naYGZ M^taluW>ڂTss5L49$S|GS^c},*ŗ5AhJw+307UL%ܧZP&"*%hwRllx49+CD:CSHhxZ9`t46 .j&KW#(tܼ֛_.GP9X2e~3+蘶ġbC6fL\]}UXWfaeyzP裿{>=rib[p ؼL~cd-)/*2Qg6|UY'\eA+bX]0('m^d՞ o.kp&O֒x?J|gcz2tT4-N J4D: Ңm2كKso@a=a,\n,񅚄8eHҌ嚒:5g?;S#dz!*dr`v^Kt% ؖ Hl20ݱҌsGɧ&eYgԅ\ah4*eIXNϹpq<fmteR>1Dpg ~b/ؤ%bY}'1<"mDLgt-a djJ 6xR k1ﺄcƸ03W)PbGJҀtmW,U`ڠ`Q^[ ξy;GŜ SZ'Iz#,|fD}>*H_@_9{ЙP='op'Z}hu} țs9:Pf ,0K|I-NuCGnF: uJcbZwUc>=FdX5;lI|1oDi̟Gu?~BNpaE:=hmZT T&(`4(e)q%SwgfnAI}HlQ~Vd9%0fx]{sO7;^: #` wHUA (h l[ #ŀiV=ɓgd c#]@ ?5b}Ԕ91Lŝ5AKASI۞鿺3<ٓ+~{rSkz}Tt8˷̱o"'ShM>d%r)2#Κm[b@KKn,u&^+'1cG~bb~Xu2Y4Ps_kEt9K;EkBX6ȘNdMH]ϔ0fqWGW%M7S$ڂ!ⶫ|(becP܎[&lk|ܐĿ>V'&HQ[ C [R3m/3`(lI#$_|ۙwۆO 靶k3MtJ#hPhgP mɀNOҍ)!}[aJ~LXuɀH hI Rzmܧq)͆J6_[bIENDB`uget-2.2.0/pixmaps/icons/hicolor/index.theme0000644000175000000120000000130513203310774015753 00000000000000[Icon Theme] Name=hicolor Comment=Uget icons for hicolor Directories=16x16/apps,22x22/apps,24x24/apps,32x32/apps,48x48/apps,64x64/apps,96x96/apps,128x128/apps,scalable/apps Inherits=default [16x16/apps] Size=16 Type=Fixed Context=Applications [22x22/apps] Size=24 Type=Fixed Context=Applications [24x24/apps] Size=24 Type=Fixed Context=Applications [32x32/apps] Size=32 Type=Fixed Context=Applications [48x48/apps] Size=48 Type=Fixed Context=Applications [64x64/apps] Size=64 Type=Fixed Context=Applications [96x96/apps] Size=64 Type=Fixed Context=Applications [128x128/apps] Size=128 Type=Fixed Context=Applications [scalable/apps] Size=128 Type=Scalable MinSize=1 MaxSize=256 Context=Applications uget-2.2.0/pixmaps/icons/hicolor/16x16/0000755000175000000120000000000013224533052014465 500000000000000uget-2.2.0/pixmaps/icons/hicolor/16x16/apps/0000755000175000000120000000000013224533052015430 500000000000000uget-2.2.0/pixmaps/icons/hicolor/16x16/apps/uget-icon.png0000644000175000000120000000121413203310772017745 00000000000000PNG  IHDRatEXtSoftwareAdobe ImageReadyqe<.IDATxڔn@Ol"hR$EY </ѾoMJT4Җ^r{.f(* ɖ||1yՋBM9ޥI.t:<K !,#${u~(0Sh 0! #,ZUXq!%$ǻmϟ> RG,"&p:82DL]č%1b,LJ774"lr\ȎLjq5s-*bԍDYiLo>(9xGЩ6"ܞ(cX29+jTڨw慲Un|_&eS'WZy#~@60 Sd'AIENDB`uget-2.2.0/pixmaps/icons/hicolor/16x16/apps/uget-tray-default.png0000644000175000000120000000061213203310773021420 00000000000000PNG  IHDRatEXtSoftwareAdobe ImageReadyqe<,IDATxb8@ `"W?1M [L>l&E3?V&5 @^8Ȓ/ys 01|!. " ΋{g_vOp;':603F-ǗN,D#V?vbVp}fD΍t)?tfMhJ_0O0X>pfIENDB`uget-2.2.0/pixmaps/icons/hicolor/16x16/apps/uget-tray-error.png0000644000175000000120000000106413203310774021130 00000000000000PNG  IHDRatEXtSoftwareAdobe ImageReadyqe<IDATxb8@ `"?1M ;8r/{I (.ڡE8=LL\B)Y[?60 33[GKr9v $xK4;[贈B?AUĸ ;'_hI dP&Hx TjY;H  &F!!{ qOKaqE#$<+o ?[Z~ Bsŝa&_Ҽ뇞3EA ش {x6. 6f3/]zI*PeT 0q [ K+Lzu'N* aN^6VR#*jmD>}f:&oC 5>AKIJM7>qz#zvbbXO4O0~+IENDB`uget-2.2.0/pixmaps/icons/hicolor/16x16/apps/uget-tray-downloading.png0000644000175000000120000000104513203310773022302 00000000000000PNG  IHDRatEXtSoftwareAdobe ImageReadyqe<IDATxb8@ `" ?1M ;!?Ω$MSuT5f.~vw%܏Z @?V323-⎇o 2`&]f|v;o߿ @;'_L.r%!  d'0דko?YYma<얌0$t (-*[lwM*fpoC ~}߿<\ >ȼd?v309bD6. f#6<0#kvɋ/~fV&/r)] #[K'L7`dbdDS7hP"3#ǟ2" e2Teyq=톎{ѳ33 JxW > S E?IENDB`uget-2.2.0/pixmaps/icons/hicolor/64x64/0000755000175000000120000000000013224533052014473 500000000000000uget-2.2.0/pixmaps/icons/hicolor/64x64/apps/0000755000175000000120000000000013224533052015436 500000000000000uget-2.2.0/pixmaps/icons/hicolor/64x64/apps/uget-icon.png0000644000175000000120000001053113203310773017756 00000000000000PNG  IHDR@@iqtEXtSoftwareAdobe ImageReadyqe<IDATx[KuUUgRC4II$؉EEE ,Av l8( dEZ(Zdo&A"8AdZR8ER5ݼW]ݞaD&YS{߹~m$"U~1$H$ "ɟd<'to}4/XcM󝿄z,B<壼j9Y(sevn矏ϟ?/[H}N-Oy.>-СCkeFj8p@#@jٳpرPBrG}q }_u?Οq◎`xL&eWHB ֨ <=Ks$GOs/@_i?HB"Ȝ,e72Bp"j'Ofku)ʘJ> ,rU (n~i ȗ;ޒmT8qu"̯ D5N‡L1qj gr7jD*7dB!r6AC_n&eϰ@8\KFϹ Ҙy 9exKGW E\?c}`f] .T%2|mAx f*0W3/X$`GP"POV3=B.8*TĽŸyA!cZ6J6(F9;ӰhQ+8ËSpHĀq.٨x:os?2w`;?BqoAP$:Pc&2~l'ڬ0*W+E@-`]2 (O#6#lVCVM8ӝ4֗D>)?` L&ahAp /.*%>cmq\qCb)Fݳx tH#)( 0*Ӵ֔{k'X tY {аR6Bw4FۦJT=u|hMb0 &C>އ"|+kAU2OZ> Q6Qsun4efR sgarXxfܗܓQF mQ@50/:ֱ$k =&GzK*EϤyB=P) PZ,M׼@\&P r:wbmO[z zukn@AНK!B0`0`Uzc &C X%~l%Wў7B3 o/*sȝL(7fu _!LpБnp+%̌m)$)EMbqJYsH=-) VjCiIy9a*?ڶI⑨y3١Jc!PTQ},:/$((So3X?!lf[u%선6;~`HaU(l& =!%4 "ǀAezX)BbE,"(*+UmѠBX{VDshm@<+Ai5 j)NV ""UqzH[wp@ƗB4\0r&wcd(BaF@TM<=<z\#lݫR,HJUBX'`6we0@X]HaUVE!cmV+.BR7b+i M(Sx~MhGVl6:Uph#G%CdVT`ߦ'͙5 W RqѧskhMFh'`GEUz azaMkeJ^]HArx7Z6hITppKłNfrc;cP~һNL=5bc=0yvk+ )L~؂-{ؕ,deqm6f+X<%РEȐk ruConI ak"d(OUlKK9;s} ugA7]&] MÿMR%zpw6OV|7-"/C]W$/Qf!$};Zb ϾsuYdKL"8Sؑ&7$<#v9,̧e|Cݤ:PnI 'nXе$uO8K̴-Fʡ H>P̻Fm]S'1Btسo ,V2ȦX{^b"Ma{~ Ze-\noM_5%re^W""lDUZc&Е .)y{z9!>{~Ν;avKWxVdž MGaݑg]~c TNGN8EYtkr]#{ڋEkl WBat>rkX\24OZ \)%eRfvGQnSk$y%V@5 Q_`VqG)H_{>QRc<,IRfFykS?Ƿhn⚪N1YA]Gd=Ǖ{4{*xċ #UNJֽqyߟ9t{Jʘe٢Y#lرcӧOJ4{T|"$CxGܱ!ɩS/ ~&dÇo?~+6 N/v_xY 8ŅWԌ +bQ7`IL~JU`:t$aʾ{?dd'X3uY[oA(Y55݋W^!1\p\3p`rʥ*IENDB`uget-2.2.0/pixmaps/icons/hicolor/128x128/0000755000175000000120000000000013224533052014635 500000000000000uget-2.2.0/pixmaps/icons/hicolor/128x128/apps/0000755000175000000120000000000013224533052015600 500000000000000uget-2.2.0/pixmaps/icons/hicolor/128x128/apps/uget-icon.png0000644000175000000120000002512113203310772020120 00000000000000PNG  IHDR>atEXtSoftwareAdobe ImageReadyqe<)IDATx}i%u9U^o=3$g"mɴEۢODIH$IA  3?1h1Kd)I{Dj.9rسt{ɽUVzəA뮷t={.\|x!\|(ދBz7M:u9EFNsZ\СC& )y=z|Ac1b̃1`G{キA`<}9rz!\]]U'ʣw}ܯGi||#Ç|$O/c=8oٿ]oZt8J8@P:?I`2sG깿?΅q)n_`ii x8p@pivkbzlJ}+/@Fp$iIXBtomӿaן]_[=vX|&>)R 1t M:≩r/փ XD7f`~(zD?>ggzwA&=O>~y,&7o0J48+t :b QZH m8{m*@ՙF#gjH4Ay="<7k_K1}V'x~av/ C|/}n]I ԕgzul@WE7S w4 ahU,c'#}#\7t |& ɖ-ҿox;?8sԡlHj:߉kK*DzdQ`:0tSVDuɟ׿?;rH߿OQ|MGr@o`.I:q$TWR)Tr1+((98$J~Z-)WR}%I`JFGFvJt 9SǹF(x.xd7JUr~axk1^\BS9)yiP''ǺZXcRnlkS :Qg;f>Vk تμ/s|ND%*^%7%?yzLyXx }xcFbz/#A"E!3U̮dM"P" NL2 TӀ^j9QP_,Cۂ[m&/ !G#BmZ@Z l\| qME*:ikFZζ|_^xӎ2ҋ뼵"Mw q5p6̈́ h6  9f2 #[%g%og|H,}`P(3 LNBR. ;AZWC0KO@%t:؋MCBbTnGc*J[jbL%`-g Pq[>dAzM;\Ʌ.ߋT$c 9 l\K>;7Yg/~J 8bc Ƒ`-#' NGF+L#6h}kkd/9t3L -F,3U|ɱT \=s݅К0!҉jR&|QA@wP&}tg+pqv9 s! ]k8mZ/^b32uN]S_ʢKpg9b+}l |mo ^>v3oz X1 K2adψ5_ *U3Jh 6ddX@D/I>NKF-'4Ӷn3l,"RF ",, ,:G/oB4A+Epe ]iU& ݏ 6WsX59r*3Y1-+yVXLED _bjDw*C="ta-FW ە61.u L Hb)cΪAŬLx --AWh@;JGDZUϞRٝ8s3()q$q"pB8C1]gL *4clMLٷ_#Ox2J!X|{/߂m#o^od+Tu(KDh5:aN+b89x>#'' rcqNAM $ |l` hJ-al5kY}_kϞ+ȳznyIBq\ˍÿ"T ;rK(~Q)߀^bm*9 btH-V)!J[wz=9` W(UI# _ī0fN?\Gaq H YA{4tx2- \ϱT$9h_V44@; %/a0bP $Bk/@4h?`בMXٚ匔k@Ը,%"z}pj3:.S!d^&r& %cdqˀr%ɧ>t+j +M2 |d; Z$MLϹ;[Ԝt[l뙙Q\"-"U[ab[/=#X@ɛnaUNr#.q ߏ}9ND*u c:o@t B,.h0ЙB&ŀR?a)ϯ5rɜ3i XP.PdțvޅLN!`Hȷ "?yc?+uF؃DNr+a@r~ x,g&VdsW 3c+ܜ+ WRhM_1·zE:& [=^EK[': 8* =4rMVٕOӂ<$/P^6)YF*XY^pg00G[ជXxASGT[OY $KiJ8 M/'.Rsmu+B䖄qᴗax|bbrBp<'Tm >< QcE ;0 e<6t9\Vpa MlQ0UP2OuJMe\dk%X6p<Z| 9i'\M tIVf{x;\V}! ~>]ԭpu-q&0_Y5yrV&\@A2q*^F%NZcPut(oL]@v vߺǯfKJ3e `e _qoOËOԦYQ; _wc5ȭC1DtmA[2[I-P8 ` ^Sɓ0o6qұiQN~nyzVG /- y :JPer/CKX -(o~u9zVBWvkP6 j kɭ PIX-&%Fb8+2ю@DԬ4{+z˱=aR5{< U;P髭sB k,߯g>QrUJ_, ziOHQ)ЧXW `EsP5[Ln[x p~~<I,خᆏl8cyݰT0&0_t"C0EQ4BQDXX e.BclgVUO7;zbDVҰjB%@A~V&tK۶BTؿrY&;X%/ `uly38! P>@vgN*lB^٬GRy*) CR%pWD#`@E8OO GtnUAdqKeÅ* @:9]++`q^+O;9m6",0@H. q8'՚T(ͰY51[xGIX8|WbtF#[l&0MS a-,l}x$(a0TM r\aW;7ugCBIW n+ơlmPajTƅ6 bEU}8Nn soD/ȿ5 c+sV3ߓ56<P`B>zAݪ:!N T!*L =è4ӌ1R;yp\yJ6MY njw  _aG[TAoA>C@g[oq$.BuMW=!=~65a&|[? Ƞ %rڶ-$#j-S\6ӟEvd(#C~#j䩋ؒ3l pQ ""C8ěCT{D%}Hy"uSdsb;X& < M [in* /2LĒ(3I$ =_m=۰ރx$|0B}1vY*rqhTg@aUQt*ʚtp]XC~?GI h qX:nvY=ҺJ^fSO˦'G>i(oX!Cr7г[|uUuIbhM%iЎ_I@TuP(uܜdž GZh iuT3CȾ6pR T.QJ0ftC+upoŬ]TتE>òT"z a"P ZqaydPOxBIZ8/pcW?ĻГXE9`=P(֚ɭ $}[̖AUM(5ޓ"q»N[* .cY :L';X>&XaE`qJDL̜Cp4J@kGHLb#E8Υ>x?r9QΡdy;BU2HkձV x_`ZJ7@R1-dk ۧxd++? ֖{³g ~5\86Adl4i(At_R6T;t)*L \@O}ۖ JJ+ U(+gs`p %񪯷V7S @&gcW݊_D5XɿiLgr wkW%ntUhl܋\Pʠڠ$ ol{&%{ B3,,`|b+hM S)J|Ucnf;?l?8Ohx97nV0oV12WzP -Ap_Gw.lK8R >:On_Y‹ϝMW,m4I6㹌2U ȸjJ(O߳gDi*2 @M[;gY|)tH p6 Efzȟ6$[!$"I VIE_mmyP8ʲTlWc a03w*A흭4:xNe)^:~r[\\~JR6tBȕT6#&I{Ea/nR\hb];<g[7=+P(ڄS*³K⁎ؐ= ,dڴ0ӫ>ec9B_.j0rX v2v r@vW43z6+D^mm̔*D) ]x١y#MɞtS+A`۾.eaW>wQy2 4̜Y ?\5AB̑Nযw9Qk#HR c8TZQА 'S$XW5rv~ĺn{Y'"_#y-H]A ,_hyXv 22~9ϡ?HS`Q+:Q3"eU#kn{UqFO~jr`[ pۥT]Ҷ ɶD׬xd2(-?zE(qV,B2X\%|5>1LŖ_4r 69WY\e>i9iET^A޲=˃{e."l',,ZUf)I%ͩ ]^c'x o<9 {ñ<߅_:^Cе;;BYZ[M~kca@ $ lo.RUln?oj{^"k#0wnn I3%Ѽ(AvH<ЍW];Ays0hûY(Yצ~"a Ty?DIKxe/{YYDc*s(s{ט]e{8|,*;4}ߞŹuz^̡qm~ju<[>> qX?VpLcb# O$Ǒ.bPwv\R%C/^VQS#ȩb+hJ S>6,2 ̜] 7b{tJJ7P+#YJ2wo\ka)@ 01ݲ1VFPtýMYXOwD-&rͺJlтs'sbw8> |cf֕moh|QyPU z{nwmHm␇x-2(:Z\FMW"C?: 58wq=* ZtQ˥8y{,ek2a (]S}~lQ0Fp b)Rld/ #Nz#: #9 ECkv/0 P]P"țDd_qg7btMS5JGNGv=NRpKALC*`-c&aN s4t =7 FԃizOw.jJ@dv%0vGpT' *]*S/(MJ[nWd>RV Q3~B{{[;yCtZP<8e@;<i(ar :$p# 'QL|#$ri7gY0Xk\A#'"*jx6p([0?M'ˈa1L0U$usn){4&X0sBc\f`PǬ 7!pD/ڼB{*ԌF@;#(rV͢VFVSP\Yy1(͒(HA DtY@y,QONT9`qVd͓ /I|(A} ݹ(O /@^)VElUMAnG^@_([;5JnJ~\JV>OiOCɠT3i0jP~%JB,-6gd:r«Nۿq$`@lja31meލT1o+M f-Z$(I:JnJ~=3 ,Ro^߻.9ydGF}7Q/BKHW}ȬD8r ` N+@p*j>]yןӧ 0jŰ:~v񴒛Ӛk.w*?tI>~dc?=}s2E$sF]yQ)(Λs_:ۧ g&Ub !b!5ߪ5ř{?Ţ.B|MJ_~n񌒗<帪:zf)SftJ3>(s˳WͿj؎V{t*Iw>f7:bEڼ1v^zYߋ7I'q䉪9w!닜+Vbk'x}Ě\6;'(nҚ/aRt9ٙ,fRer\rj9 o} ~r6T+`\ZZ|s`tg2OǣQA\@֚wSZS<hW={aCn[< ,`ȋ<ŘSgo 5h!b]sWޕyy9FwQr.,ǏO?4t萯qQ|ǴU;nmG?>W~6 }ѵ{7J, $dT*5PCO[JWGu9||G|%y5Vp]5}׿u&c?7/XcI >J_W\H9I9u;ֿtKOCp U3Z61"6Ю`xG|qaN-CbY+u pEX5>/`_2?ўe!J {Ðý"<@B xUʉ,{T]E~IENDB`uget-2.2.0/pixmaps/icons/hicolor/24x24/0000755000175000000120000000000013224533052014463 500000000000000uget-2.2.0/pixmaps/icons/hicolor/24x24/apps/0000755000175000000120000000000013224533052015426 500000000000000uget-2.2.0/pixmaps/icons/hicolor/24x24/apps/uget-icon.png0000644000175000000120000000227213203310772017750 00000000000000PNG  IHDRw=tEXtSoftwareAdobe ImageReadyqe<\IDATxڴVMoU=c8NRUSTZ$$*ۊn_`-/ĆBB @Z膠|@@bB\3o}vܴN{{νEyyiX[[sss 'fZV|v.N:ZdYu [~`&u=xOPa~x޵ur&nC ECK.!ޅ1?!wGsR'qyvl1i Df ,-!%-Մ՗?`qRTI"$DC*K!J<^p =:u{w*3Eʋxs,z}y3B 9m0֓8$'302/4ES'Y.kذeȤ-+d6ϼ 1Lk:{ 4%wvwAЯ%fGg^ōowcW `X:TezRd4aHUvJݝ|}2#K*K΢226H@ BG-,`)uIZ)YJTi`0"(*8"7SLTzy=l*-1^) "2*W"̿Z6Fh *T*J&GP@l i2H肦DceGQx[J62$&~]-خCK:Ndظ"ZC(_m$$k$ # :umbmzQ[@z@+q2Aj:03KMsd6ɑPFSb`!lTbiͭ0^6@g4R]}S} 4\A߿ZrÝo'+0"Pn}14_򪣷oðgR`6pml:Ź)G(Wu)M_Ľd>QNIBL۹H 6S2 R#I&` j \JGx;&( Ӭ;ښ?z)Hs##&Ї܅jP͈0THV<R vɋEŇ@yl8`O*Is 3Ë.x|׌KsA6ʭ@,B(AUR[*WgʶIENDB`uget-2.2.0/pixmaps/icons/hicolor/24x24/apps/uget-tray-error.png0000644000175000000120000000141013203310773021120 00000000000000PNG  IHDRw=tEXtSoftwareAdobe ImageReadyqe<IDATxb?--}2>`!lTb9-0^6@g4R]} S 4܌A,ܿo{Y\RUOD~BW6!*>!'"t5g{g͘4;s/]Kic$@ʍy 3+sHybh50.$}97g?^ @k0#`S/ `+k،L 4@*hp>r@ 9xYIĽ ׁ @@%+Eş.ϯ%(*~}gQH-b(-.OAF/yliGPbsV'h%z*HJqs2??̯wϼ4ݰ 8 bo 7*Pזãʤ/ YG׬\IENDB`uget-2.2.0/pixmaps/icons/hicolor/24x24/apps/uget-tray-downloading.png0000644000175000000120000000121313203310773022275 00000000000000PNG  IHDRw=tEXtSoftwareAdobe ImageReadyqe<-IDATxb?--}2>`!lTbi-0^GӀT&v=|6FS[Y}4\p U!.A-xy;7' YYFO>a$@ʍ1Quxo\Є7`Xp 3kZL.Z`*NN бD?/ϡYv< + H$E\@W5Xs{6Ko410͖T%:'rJ$O.VĽΰE~[ r tE133:dq`p,cac&n}vhbr]ٟ~aK=j ɡ2 a>X4,Ujc7z@e6# } v.*C#d..w̸ 6too$^].w!dDq Hox3xm9 Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! uget-2.2.0/ChangeLog0000644000175000000120000000000013224044134011123 00000000000000uget-2.2.0/tests/0000755000175000000120000000000013224533052010607 500000000000000uget-2.2.0/tests/test-uget.c0000644000175000000120000002766413224532612012634 00000000000000/* * * Copyright (C) 2012-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #include #include #include #include //#include #include #include #include #include #include // ---------------------------------------------------------------------------- // UgetNode UgEntry NodeChildrenEntry[] = { {NULL, 0, UG_ENTRY_ARRAY, (UgJsonParseFunc) ug_json_parse_uget_node_children, (UgJsonWriteFunc) ug_json_write_uget_node_children}, {NULL} }; void init_node (UgetNode* parent) { UgetNode* newone; UgetNode* newtwo; newone = uget_node_new (NULL); newone->type = 1; uget_node_append (parent, newone); newtwo = uget_node_new (NULL); newtwo->type = 2; uget_node_append (parent, newtwo); parent = newtwo; newone = uget_node_new (NULL); newone->type = 3; uget_node_append (parent, newone); newtwo = uget_node_new (NULL); newtwo->type = 4; uget_node_append (parent, newtwo); } // "01-03-02" void dump_int_array (UgArrayInt* array) { int index; for (index = 0; index < array->length; index++) { if (index) printf ("-"); printf ("%.2d", array->at[index]); } puts (""); } void dump_fake_path (UgetNode* node, UgArrayInt* array) { UgetNode* cur; int index; for (index = 0, cur = node->fake; cur; cur = cur->peer, index++) { *(int*) ug_array_alloc(array, 1) = index; dump_int_array (array); dump_fake_path (cur, array); array->length--; } } void print_fake_path (UgetNode* node) { UgArrayInt array; ug_array_init(&array, sizeof (int), 20); dump_fake_path (node, &array); ug_array_clear (&array); } void test_fake_path () { UgetNode* node; UgetNode* fake0; UgetNode* fake1; UgetNode* fake2; node = uget_node_new (NULL); fake0 = uget_node_new (node); fake1 = uget_node_new (node); fake2 = uget_node_new (node); uget_node_new (fake0); uget_node_new (fake1); uget_node_new (fake1); uget_node_new (fake2); uget_node_new (fake2); uget_node_new (fake2); print_fake_path (node); uget_node_unref (node); } void parse_node (UgetNode* parent) { int code; UgJson json; const char* json_string = { "[" " {" " \"name\": null," " \"type\": 1," " \"info\": {" " }," " \"children\": [" " ]" " }," " {" " \"name\": null," " \"type\": 2," " \"info\": {" " }," " \"children\": [" " {" " \"name\": null," " \"type\": 3," " \"info\": {" " }," " \"children\": [" " ]" " }," " {" " \"name\": null," " \"type\": 4," " \"info\": {" " }," " \"children\": [" " ]" " }" " ]" " }" "]" }; ug_json_init (&json); ug_json_begin_parse (&json); #if 1 // method 1: use UgEntry to parse start of array ug_json_push (&json, ug_json_parse_entry, parent, NodeChildrenEntry); #else // method 2: push ug_json_parse_array() to parse start of array ug_json_push (&json, ug_json_parse_uget_node_children, parent, NULL); ug_json_push (&json, ug_json_parse_array, NULL, NULL); #endif code = ug_json_parse (&json, json_string, -1); printf ("ug_json_parse response %d\n", code); code = ug_json_end_parse (&json); printf ("ug_json_end_parse response %d\n", code); ug_json_final (&json); } // UgBufferFunc static int buffer_to_file (UgBuffer* buffer) { FILE* file = buffer->data; printf ("write %d bytes to file\n", ug_buffer_length (buffer)); fwrite (buffer->beg, 1, ug_buffer_length(buffer), file); buffer->cur = buffer->beg; return 0; } void write_node_to_file (UgetNode* node, char* filename) { UgBuffer buffer; UgJson json; FILE* file; file = fopen (filename, "w"); ug_buffer_init (&buffer, 128); buffer.more = buffer_to_file; buffer.data = file; ug_json_init (&json); ug_json_begin_write (&json, UG_JSON_FORMAT_INDENT, &buffer); #if 1 // method 1: use UgEntry to write start of object ug_json_write_entry (&json, node, NodeChildrenEntry); #else // method 2: call ug_json_write_object_head() to write start of object ug_json_write_array_head (&json); ug_json_write_uget_node_children (&json, node); ug_json_write_array_tail (&json); #endif ug_json_end_write (&json); ug_json_final (&json); ug_buffer_clear (&buffer, 1); fclose (file); } void test_uget_node () { UgetNode* root; root = uget_node_new (NULL); #if 0 init_node (root); #else parse_node (root); #endif write_node_to_file (root, "test-UgetNode.json"); } // ---------------------------------------------------------------------------- // UgetA2cf void print_bitfield (uint8_t* bytes, int length) { int count; int index; int temp; for (index = 0; index < length; index++) { for (count = 0; count < 8; count++) { temp = (bytes[0] << count) & 0x80; if (temp) printf ("1"); else printf ("0"); } printf ("\n"); bytes++; } } void print_a2cf (UgetA2cf* a2cf) { UgetA2cfPiece* piece; if (a2cf == NULL) return; printf ("ver : %d\n", (int)a2cf->ver); printf ("ext : %d\n", (int)a2cf->ext); printf ("info_hash_len : %d\n", (int)a2cf->info_hash_len); printf ("piece_len : %d\n", (int)a2cf->piece_len); printf ("total_len : %d\n", (int)a2cf->total_len); printf ("upload_len : %d\n", (int)a2cf->upload_len); printf ("bitfield_len : %d\n", (int)a2cf->bitfield_len); if (a2cf->bitfield_len) { printf ("bitfield:\n"); print_bitfield (a2cf->bitfield, a2cf->bitfield_len); } printf ("n_pieces : %d\n", (int)a2cf->piece.list.size); for (piece = (void*)a2cf->piece.list.head; piece; piece = piece->next) { printf ("index : %d\n", (int)piece->index); printf ("length : %d\n", (int)piece->length); printf ("bitfield_length : %d\n", (int)piece->bitfield_len); printf ("bitfield:\n"); print_bitfield (piece->bitfield, piece->bitfield_len); } } void test_uget_a2cf (void) { UgetA2cf a2cf; const char* fname; uint64_t beg, end; memset (&a2cf, 0, sizeof (UgetA2cf)); fname = "D:\\Downloads\\TestData-Aria2\\npp.6.4.2.Installer.exe.aria2-1"; printf ("%s\n", fname); uget_a2cf_load (&a2cf, fname); print_a2cf (&a2cf); uget_a2cf_clear (&a2cf); fname = "D:\\Downloads\\TestData-Aria2\\npp.6.4.2.Installer.exe.aria2-2"; printf ("%s\n", fname); uget_a2cf_load (&a2cf, fname); // fill beg = 3145728 + 16384 * 2; end = 5242880 + 16384 * 4 + 1; // beg = 7340032; // + 16384 * 2; // end = 7401344; printf ("fill %d - %d\n", (int)beg, (int)end); printf ("fill result %d\n", (int)uget_a2cf_fill (&a2cf, beg, end)); // lack beg = 0; // beg = 3145728 - 16384 * 2; // beg = 5242880; // beg = 7340032; // beg = 7401344; if (uget_a2cf_lack (&a2cf, &beg, &end)) printf ("lack %d - %d\n", (int)beg, (int)end); print_a2cf (&a2cf); // completed printf ("completed: %u\n", (unsigned)uget_a2cf_completed (&a2cf)); // clear uget_a2cf_clear (&a2cf); fname = "D:\\Downloads\\TestData-Aria2\\npp.6.4.3.Installer.exe.aria2"; printf ("%s\n", fname); uget_a2cf_load (&a2cf, fname); print_a2cf (&a2cf); // lack beg = 0; uget_a2cf_lack (&a2cf, &beg, &end); printf ("lack %d - %d\n", (int)beg, (int)end); uget_a2cf_clear (&a2cf); fname = "D:\\Downloads\\TestData-Aria2\\ubuntu-13.04-desktop-amd64.iso.aria2"; printf ("%s\n", fname); uget_a2cf_load (&a2cf, fname); print_a2cf (&a2cf); uget_a2cf_clear (&a2cf); fname = "D:\\Downloads\\TestData-Aria2\\eclipse-cpp-kepler-R-win32.zip.aria2"; printf ("%s\n", fname); uget_a2cf_load (&a2cf, fname); print_a2cf (&a2cf); uget_a2cf_clear (&a2cf); } // ---------------------------------------------------------------------------- // UgetCurl void test_uget_curl (void) { UgetCurl* ugcurl; ugcurl = uget_curl_new (); uget_curl_set_url (ugcurl, "http://msysgit.googlecode.com/files/Git-1.8.5.2-preview20131230.exe"); uget_curl_open_file (ugcurl, NULL); ugcurl->header_store = TRUE; uget_curl_run (ugcurl, TRUE); ug_thread_join (&ugcurl->thread); uget_curl_free (ugcurl); } // ---------------------------------------------------------------------------- // UgetRss void test_uget_rss (void) { UgetRss* urss; UgetRssFeed* feed; UgetRssItem* item = NULL; urss = uget_rss_new (); uget_rss_add_builtin (urss, UGET_RSS_STABLE); uget_rss_update (urss, TRUE); ug_thread_join (&urss->thread); feed = uget_rss_find_updated (urss, NULL); if (feed) item = uget_rss_feed_find (feed, -1); if (item) printf ("title %s\n", item->title); uget_rss_unref (urss); } // ---------------------------------------------------------------------------- // UgetMedia void test_media (void) { UgetMedia* umedia; UgetMediaItem* umitem; int count; char* uri; uri = "https://www.youtube.com/watch?v=y2004Xaz2HU"; count = uget_site_get_id (uri); umedia = uget_media_new (uri, UGET_SITE_YOUTUBE); count = uget_media_grab_items (umedia, NULL); printf ("\nget %d media item\n", count); umitem = uget_media_match (umedia, UGET_MEDIA_MATCH_1, UGET_MEDIA_QUALITY_UNKNOWN, UGET_MEDIA_TYPE_MP4); // umitem = uget_media_match (umedia, // UGET_MEDIA_MATCH_0, // UGET_MEDIA_QUALITY_UNKNOWN, // UGET_MEDIA_TYPE_MP4); for (; umitem; umitem = umitem->next) { // printf ("URL %s" "\n", umitem->url); printf ("quality %d, type %d, has_url %d\n", umitem->quality, umitem->type, (umitem->url) ? 1 : 0); } uget_media_free (umedia); } // ---------------------------------------------------------------------------- // UgetSeq void test_seq (void) { UgetSequence useq; UgList list; UgLink* link; ug_list_init (&list); uget_sequence_init (&useq); // digits uget_sequence_add (&useq, 0, 5, 2); // ASCII or Unicode uget_sequence_add (&useq, 'a', 'b', 0); uget_sequence_add (&useq, 0x7532, 0x7535, 0); printf (" --- sequence --- count = %d\n", uget_sequence_count (&useq, "http://sample/*-*-*.mp4")); uget_sequence_get_list (&useq, "http://sample/*-*-*.mp4", &list); for (link = list.head; link; link = link->next) puts (link->data); ug_list_foreach_link (&list, (UgForeachFunc)ug_free, NULL); ug_list_clear (&list, FALSE); puts (" --- preview ---"); uget_sequence_get_preview (&useq, "http://sample/*-*.mp4", &list); for (link = list.head; link; link = link->next) puts (link->data); ug_list_foreach_link (&list, (UgForeachFunc)ug_free, NULL); ug_list_clear (&list, FALSE); uget_sequence_final (&useq); } // ---------------------------------------------------------------------------- // main int main (void) { // test_uget_node (); // test_fake_path (); // test_uget_a2cf (); // test_uget_curl (); // test_uget_rss (); // test_media (); test_seq (); return 0; } uget-2.2.0/tests/Makefile.am0000644000175000000120000000406613224066603012574 00000000000000noinst_PROGRAMS = \ test-json test-jsonrpc test-plugin+app test-info \ test-uglib test-uget # test-uglib-cxx test-uget-cxx TESTS_LIBS = @PTHREAD_LIBS@ @CURL_LIBS@ @GLIB_LIBS@ if WITH_LIBPWMD TESTS_LIBS += @LIBPWMD_LIBS@ endif # set the include path found by configure AM_CPPFLAGS = -I$(top_srcdir)/uglib -I$(top_srcdir)/uget AM_CFLAGS = @PTHREAD_CFLAGS@ @LFS_CFLAGS@ @CURL_CFLAGS@ @GLIB_CFLAGS@ AM_LDFLAGS = @LFS_LDFLAGS@ # test_json_CPPFLAGS = -I$(top_srcdir)/uglib test_json_LDADD = $(top_builddir)/uglib/libuglib.a $(TESTS_LIBS) test_json_SOURCES = test-json.c # test_jsonrpc_CPPFLAGS = -I$(top_srcdir)/uglib -I$(top_srcdir)/uget test_jsonrpc_LDADD = $(top_builddir)/uget/libuget.a $(top_builddir)/uglib/libuglib.a $(TESTS_LIBS) test_jsonrpc_SOURCES = test-jsonrpc.c test_plugin_app_CPPFLAGS = -I$(top_srcdir)/uglib -I$(top_srcdir)/uget @LIBGCRYPT_CFLAGS@ @LIBCRYPTO_CFLAGS@ test_plugin_app_LDADD = $(top_builddir)/uget/libuget.a $(top_builddir)/uglib/libuglib.a $(TESTS_LIBS) @LIBGCRYPT_LIBS@ @LIBCRYPTO_LIBS@ test_plugin_app_SOURCES = test-plugin+app.c # test_info_CPPFLAGS = -I$(top_srcdir)/uglib test_info_LDADD = $(top_builddir)/uglib/libuglib.a $(TESTS_LIBS) test_info_SOURCES = test-info.c # test_uglib_CPPFLAGS = -I$(top_srcdir)/uglib test_uglib_LDADD = $(top_builddir)/uglib/libuglib.a $(TESTS_LIBS) test_uglib_SOURCES = test-uglib.c # test_uget_CPPFLAGS = -I$(top_srcdir)/uglib -I$(top_srcdir)/uget test_uget_LDADD = $(top_builddir)/uget/libuget.a $(top_builddir)/uglib/libuglib.a $(TESTS_LIBS) test_uget_SOURCES = test-uget.c ## test C++ standard-layout #test_uglib_cxx_CPPFLAGS = -I$(top_srcdir)/uglib #test_uglib_cxx_CXXFLAGS = -std=c++11 #test_uglib_cxx_LDADD = $(top_builddir)/uglib/libuglib.a $(TESTS_LIBS) #test_uglib_cxx_SOURCES = test-uglib-cxx.cxx ## test_uget_cxx_CPPFLAGS = -I$(top_srcdir)/uglib -I$(top_srcdir)/uget #test_uget_cxx_CXXFLAGS = -std=c++11 #test_uget_cxx_LDADD = $(top_builddir)/uget/libuget.a $(top_builddir)/uglib/libuglib.a $(TESTS_LIBS) #test_uget_cxx_SOURCES = test-uget-cxx.cxx uget-2.2.0/tests/test-uglib.c0000644000175000000120000003102213224532612012751 00000000000000/* * * Copyright (C) 2012-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #include #include #include #include #include #include #include #include #include #include #include #include #if defined _WIN32 || defined _WIN64 #include #include #include // ShellExecuteW() void test_launch (void) { uint16_t* pathutf16; uint16_t* parmutf16; int result; pathutf16 = ug_utf8_to_utf16 ("C:\\Program Files\\uGet\\bin\\aria2c", -1, NULL); parmutf16 = ug_utf8_to_utf16 ("--enable-rpc=true", -1, NULL); wprintf (L"%s %s", pathutf16, parmutf16); result = (int)ShellExecuteW (NULL, L"open", pathutf16, parmutf16, NULL, SW_HIDE); if (result > 32) puts ("ShellExecuteW - OK"); free (parmutf16); free (pathutf16); } #else void test_launch (void) { } #endif // ---------------------------------------------------------------------------- // test UgUri void dump_uri (UgUri* uri) { } void test_uri (void) { char* temp; char* hosts[] = {"ftp.you.com", ".your.org", ".edu", NULL}; char* exts[] = {"png", "bmp", "jpg", NULL}; char* schemes[] = {"ftp", "http", "git", NULL}; // const char* uri = "ftp://i.am.ftp.you.com/file.bmp"; const char* uri = "http://my.and.your.org/file%200.png?field1=value1&field2=value2&field3"; // const char* uri = "git://this.edu/file.jpg"; const char* query; UgUriQuery uquery; UgUri uuri; int index; puts ("\n--- test_uri:"); ug_uri_init (&uuri, uri); index = ug_uri_match_hosts (&uuri, hosts); printf ("ug_uri_match_hosts () return %d\n", index); index = ug_uri_match_schemes (&uuri, schemes); printf ("ug_uri_match_schemes () return %d\n", index); index = ug_uri_match_file_exts (&uuri, exts); printf ("ug_uri_match_file_exts () return %d\n", index); temp = ug_uri_get_file (&uuri); puts (temp); ug_free (temp); query = uri + uuri.query; while ((index = ug_uri_query_part (&uquery, query)) > 0) { printf ("ug_uri_query_part() return %d, %.*s=%.*s\n", index, uquery.field_len, query, uquery.value_len, uquery.value); query = uquery.field_next; } temp = ug_strdup ("file%2020%%20100%2f%20.jpg"); index = ug_decode_uri (temp, -1, temp); printf ("ug_decode_uri() return %d, output - '%s'\n", index, temp); ug_free (temp); } // ---------------------------------------------------------------------------- // test UgList static UgLink link[4]; void test_list (void) { UgLink* temp; UgList list; uintptr_t index; ug_list_init (&list); for (index = 0; index < 4; index++) link[index].data = (void*) index; ug_list_append (&list, link + 0); ug_list_append (&list, link + 1); ug_list_append (&list, link + 2); ug_list_append (&list, link + 3); ug_list_remove (&list, link + 2); ug_list_insert (&list, link + 3, link + 2); for (temp = list.head; temp; temp = temp->next) { printf ("%d, %p, %p\n", (int)(intptr_t)temp->data, temp->prev, temp->next); } } // ---------------------------------------------------------------------------- // test UgNode void dump_node (UgNode* root) { UgNode* cur; printf ("node->next : %p\n", root->next); printf ("node->prev : %p\n", root->prev); printf ("node->parent : %p\n", root->parent); printf ("node->children : %p\n", root->children); printf ("node->n_children : %d\n", root->n_children); for (cur = root->children; cur; cur = cur->next) printf ("%u\n", (unsigned)(uintptr_t)cur->data); } void test_node (void) { UgNode* root; UgNode* node1; UgNode* node2; UgNode* node3; UgNode* node4; puts ("\n--- test_node:"); root = ug_node_new (); node1 = ug_node_new (); node1->data = (void*)(uintptr_t) 1; node2 = ug_node_new (); node2->data = (void*)(uintptr_t) 2; node3 = ug_node_new (); node3->data = (void*)(uintptr_t) 3; node4 = ug_node_new (); node4->data = (void*)(uintptr_t) 4; ug_node_append (root, node3); printf ("ug_node_append (3)\n"); ug_node_prepend (root, node1); printf ("ug_node_prepend (1)\n"); ug_node_insert (root, node3, node2); printf ("ug_node_insert (2) before 3\n"); ug_node_append (root, node4); printf ("ug_node_append (4)\n"); printf ("root.n_children : %d\n", root->n_children); dump_node (root); ug_node_unlink (node2); dump_node (node2); ug_node_free (root); ug_node_free (node1); ug_node_free (node2); ug_node_free (node3); ug_node_free (node4); } // ---------------------------------------------------------------------------- // UgBuffer void test_buffer () { UgBuffer buffer; puts ("\n--- test_buffer:"); ug_buffer_init (&buffer, 3); ug_buffer_write (&buffer, "This is test string.", -1); ug_buffer_write_char (&buffer, 'K'); *ug_buffer_alloc (&buffer, 1) = 'S'; *ug_buffer_alloc (&buffer, 1) = 'D'; ug_buffer_write_char (&buffer, 'K'); ug_buffer_write_char (&buffer, '\0'); puts ((char*)buffer.beg); ug_buffer_clear (&buffer, 1); } // ---------------------------------------------------------------------------- // UgSLink static void slinks_add_range (UgSLinks* slinks, char** strings, int beg, int end) { for (; beg < end; beg++) { strings[beg] = ug_strdup_printf ("%.3d", beg); ug_slinks_add (slinks, strings[beg]); } } static void slinks_remove_range (UgSLinks* slinks, char** strings, int beg, int end) { for (; beg < end; beg++) { ug_slinks_remove (slinks, strings[beg], NULL); ug_free (strings[beg]); strings[beg] = NULL; } } void test_slink () { char** strings; UgSLinks slinks; puts ("\n--- test_slink:"); ug_slinks_init (&slinks, 16); strings = ug_malloc0 (sizeof (char*) * 100); slinks_add_range (&slinks, strings, 40, 60); slinks_add_range (&slinks, strings, 0, 20); slinks_add_range (&slinks, strings, 80, 100); slinks_add_range (&slinks, strings, 20, 40); slinks_add_range (&slinks, strings, 60, 80); slinks_remove_range (&slinks, strings, 0, 10); slinks_remove_range (&slinks, strings, 90, 100); slinks_remove_range (&slinks, strings, 70, 90); slinks_remove_range (&slinks, strings, 10, 30); slinks_remove_range (&slinks, strings, 30, 50); slinks_remove_range (&slinks, strings, 50, 70); slinks_add_range (&slinks, strings, 0, 20); slinks_add_range (&slinks, strings, 80, 100); slinks_remove_range (&slinks, strings, 0, 10); slinks_remove_range (&slinks, strings, 90, 100); ug_slinks_foreach (&slinks, (void*)puts, NULL); slinks_remove_range (&slinks, strings, 10, 20); slinks_remove_range (&slinks, strings, 80, 90); ug_free (strings); ug_slinks_final (&slinks); } // ---------------------------------------------------------------------------- // UgUtil void test_base64 () { const char* test_string = "This is a test string."; char* base64; char* orig; int len; puts ("\n--- test_base64:"); base64 = ug_base64_encode ((uint8_t*)test_string, strlen (test_string), &len); printf ("%.*s\n", len, base64); puts (base64); orig = ug_base64_decode(base64, len, NULL); printf ("%.*s\n", len, orig); ug_free (base64); ug_free (orig); } // ---------------------------------------------------------------------------- // Utility void test_utility () { char* temp; time_t res; int n; res = ug_str_rfc822_to_time ("Sat, 07 Sep 2002 00:00:01 GMT"); if (res != -1) puts (ctime (&res)); res = ug_str_rfc3339_to_time ("2013-09-12T22:50:20+08:00"); if (res != -1) puts (ctime (&res)); temp = ug_build_filename ("basedir", "path", "file", NULL); printf ("ug_build_filename() - %s\n", temp); ug_free (temp); temp = ug_strdup ("\nThis\n one\r"); puts ("--- ug_str_remove_crlf () --- start ---"); puts (temp); n = ug_str_remove_crlf (temp, temp); puts (temp); printf ("--- ug_str_remove_crlf () return %d --- end ---", n); ug_free (temp); } // ---------------------------------------------------------------------------- // Option struct Opt { int index; char* name; }; UgOptionEntry opt_entry[] = { {"category-index", "ci", offsetof (struct Opt, index), UG_ENTRY_INT, "", "=N", NULL}, {"category-name", "cn", offsetof (struct Opt, name), UG_ENTRY_STRING, "", "=name", NULL}, {NULL} }; int print_option_callback (UgOption* option, const char* name, const char* value, void* dest, void* data) { printf ("%s = %s\n", name, value); return TRUE; } void test_option (void) { UgOption option; struct Opt dest; ug_option_init (&option); // ug_option_set_parser (&option, print_option_callback, NULL, NULL); ug_option_set_parser (&option, ug_option_parse_entry, &dest, opt_entry); ug_option_parse (&option, "--category-index=1", -1); ug_option_parse (&option, "-cn=hhk", -1); ug_option_final (&option); } void test_cmd_arg (void) { const char* cmd = "--enable --file=\"\" --arg "; char** argv; int argc; int count; argv = ug_argv_from_cmd (cmd, &argc, 0); for (count = 0; count < argc; count++) puts (argv[count]); ug_argv_free (argv); } // ---------------------------------------------------------------------------- // HTML void start_element (UgHtml* uhtml, const char* element_name, const char** attribute_names, const char** attribute_values, void* dest, void* data) { int index; printf ("<%s", element_name); for (index = 0; attribute_names[index]; index++) printf (" %s=%s", attribute_names[index], attribute_values[index]); printf (">"); } void end_element (UgHtml* uhtml, const char* element_name, void* dest, void* data) { printf ("\n", element_name); } void text (UgHtml* uhtml, const char* text, int text_len, void* dest, void* data) { printf ("%s", text); } UgHtmlParser testparser = { start_element, end_element, text }; void test_html (void) { UgHtml* uhtml; uhtml = ug_html_new (); ug_html_begin_parse (uhtml); ug_html_push (uhtml, &testparser, NULL, NULL); ug_html_parse (uhtml, "< p attr1=\"value1\" attr2=val2/> < &xxxxx; ", -1); ug_html_end_parse (uhtml); puts("\n"); } void test_unicode (void) { const char* utf8_name = "\xE9\xBB\x83\xE6\xAD\xA3\xE9\x9B\x84"; char* utf8_str; uint32_t* ucs4_str; int len; int idx; ucs4_str = ug_utf8_to_ucs4 (utf8_name, -1, &len); for (idx = 0; idx < len; idx++) printf ("\\x%X", ucs4_str[idx]); puts (""); utf8_str = ug_ucs4_to_utf8 (ucs4_str, -1, &len); for (idx = 0; idx < len; idx++) printf ("\\x%X", (unsigned)(uint8_t)utf8_str[idx]); puts (""); ug_free (ucs4_str); ug_free (utf8_str); } // ---------------------------------------------------------------------------- // main int main (void) { test_unicode (); test_html (); test_cmd_arg (); test_option (); test_list (); test_node (); test_uri (); test_buffer (); test_slink (); // test_launch (); test_base64 (); test_utility (); return 0; } uget-2.2.0/tests/test-jsonrpc.c0000644000175000000120000003015613224532612013334 00000000000000/* * * Copyright (C) 2012-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #include #include #include #include #include #include #include #if defined _WIN32 || defined _WIN64 #include #else #include // sleep() #endif #if defined _WIN32 || defined _WIN64 #define ug_sleep Sleep #else #define ug_sleep(millisecond) usleep (millisecond * 1000) #endif static void socket_receiver (UgSocketServer* server, SOCKET client_fd, void* data) { char buf[5]; ug_socket_server_ref (server); // ug_socket_recv (client_fd, buf, 5, 0); recv (client_fd, buf, 5, 0); puts ("socket server: get ping"); // ug_socket_send (client_fd, "pong", 4, 0); send (client_fd, "pong", 4, 0); // ug_socket_close (client_fd); closesocket (client_fd); ug_socket_server_unref (server); } void test_socket_server_client (SOCKET server_fd, SOCKET client_fd) { UgSocketServer* server; char buf[5]; server = ug_socket_server_new (server_fd); ug_socket_server_set_receiver (server, socket_receiver, NULL); ug_socket_server_start (server); // --- client begin --- // ug_socket_send (client_fd, "ping", 4, 0); send (client_fd, "ping", 4, 0); // ug_socket_recv (client_fd, buf, 5, 0); recv (client_fd, buf, 5, 0); puts ("socket client: get pong"); // ug_socket_close (client_fd); // close (client_fd); closesocket (client_fd); // --- client end --- ug_socket_server_stop (server); ug_socket_server_unref (server); } void test_socket (void) { SOCKET server_fd; SOCKET client_fd; puts ("------------------"); // server_fd = ug_socket_new (AF_INET, SOCK_STREAM, 0); server_fd = socket (AF_INET, SOCK_STREAM, 0); ug_socket_listen (server_fd, "127.0.0.1", "8088", 5); // client_fd = ug_socket_new (AF_INET, SOCK_STREAM, 0); client_fd = socket (AF_INET, SOCK_STREAM, 0); ug_socket_connect (client_fd, "127.0.0.1", "8088"); test_socket_server_client (server_fd, client_fd); ug_sleep (1000); #if !(defined _WIN32 || defined _WIN64) puts ("------------------"); // server_fd = ug_socket_new (AF_INET, SOCK_STREAM, 0); server_fd = socket (AF_UNIX, SOCK_STREAM, 0); ug_socket_listen_unix (server_fd, "/tmp/test-socket-unix", -1, 5); // client_fd = ug_socket_new (AF_INET, SOCK_STREAM, 0); client_fd = socket (AF_UNIX, SOCK_STREAM, 0); ug_socket_connect_unix (client_fd, "/tmp/test-socket-unix", -1); test_socket_server_client (server_fd, client_fd); ug_sleep (1000); #endif } // ---------------------------------------------------------------------------- // test parser & writer void parse_rpc_object (UgJsonrpcObject* jobj, const char* json_string) { UgJson json; int code; ug_json_init (&json); ug_json_begin_parse (&json); ug_json_push (&json, ug_json_parse_entry, jobj, (void*)UgJsonrpcObjectEntry); ug_json_push (&json, ug_json_parse_object, NULL, NULL); code = ug_json_parse (&json, json_string, -1); printf ("ug_json_parse response %d\n", code); code = ug_json_end_parse (&json); printf ("ug_json_end_parse response %d\n", code); ug_json_final (&json); } void print_rpc_object (UgJsonrpcObject* jobj) { UgJson json; UgBuffer buffer; ug_json_init (&json); ug_buffer_init (&buffer, 4096); ug_json_begin_write (&json, UG_JSON_FORMAT_INDENT, &buffer); // ug_json_write_entry (&json, req, requestEntry); ug_json_write_rpc_object (&json, jobj); ug_json_end_write (&json); ug_json_final (&json); ug_buffer_write_char (&buffer, '\0'); puts (buffer.beg); } void test_rpc_parser (void) { UgJsonrpcArray* jarray; UgJsonrpcObject* jobj; const char* json_string1 = // "{\"jsonrpc\": \"2.0\", \"method\": \"update\", \"params\": [1,2,3,4,5], \"id\":1}"; "{\"jsonrpc\": \"2.0\", \"method\": \"foobar\", \"id\":2}"; const char* json_string2 = "{\"jsonrpc\": \"2.0\", \"error\": {\"code\": -32601, \"message\": \"Method not found.\"}, \"id\": 1}"; // "{\"jsonrpc\": \"2.0\", \"result\": 19, \"id\":1}"; const char* json_string3 = "{\"id\":2,\"jsonrpc\":\"2.0\",\"result\":\"fc585c5fec7319bf\"}"; puts ("----- test_rpc_parser()"); jarray = malloc (sizeof (UgJsonrpcArray)); ug_jsonrpc_array_init (jarray, 8); jobj = ug_jsonrpc_array_alloc (jarray); parse_rpc_object (jobj, json_string1); print_rpc_object (jobj); jobj = ug_jsonrpc_array_alloc (jarray); parse_rpc_object (jobj, json_string2); print_rpc_object (jobj); jobj = ug_jsonrpc_array_alloc (jarray); parse_rpc_object (jobj, json_string3); print_rpc_object (jobj); ug_jsonrpc_array_clear (jarray, 1); free (jarray); } void test_rpc_curl_packet (UgJsonrpcCurl* jrcurl) { int error; UgJsonrpcObject* request; UgJsonrpcObject* response; const char* json_string = "{" "\"jsonrpc\": \"2.0\"," "\"method\": \"aria2.addUri\"," "\"params\": [[\"http:\\/\\/localhost\\/file\"], {}]," "\"id\":2" "}"; request = ug_jsonrpc_object_new (); response = ug_jsonrpc_object_new (); parse_rpc_object (request, json_string); print_rpc_object (request); error = ug_jsonrpc_call (&jrcurl->rpc, request, response); if (error == 0) print_rpc_object (response); ug_jsonrpc_object_free (request); ug_jsonrpc_object_free (response); } void test_jsonrpc_curl (void) { // UgJsonrpcHttp* jrhttp; UgJsonrpcCurl* jrcurl; UgJsonrpcArray* jarray; puts ("----- test_jsonrpc_curl()"); // jrhttp = malloc (sizeof (UgJsonrpcHttp)); // ug_jsonrpc_http_init (jrhttp); jrcurl = malloc (sizeof (UgJsonrpcCurl)); ug_jsonrpc_curl_init (jrcurl); jarray = malloc (sizeof (UgJsonrpcArray)); ug_jsonrpc_array_init (jarray, 8); // ug_jsonrpc_http_set_client (jrhttp, "http://localhost:6800/jsonrpc"); // test_rpc_http_packet (jrhttp); ug_jsonrpc_curl_set_url (jrcurl, "http://localhost:6800/jsonrpc"); // test_rpc_curl_packet (jrcurl); // ug_jsonrpc_http_final (jrhttp); // free (jrhttp); ug_jsonrpc_curl_final (jrcurl); free (jrcurl); ug_jsonrpc_array_clear (jarray, 1); free (jarray); } // ---------------------------------------------------------------------------- // test UgJsonrpcSocket static void jsonrpc_accepted (UgJsonrpc* jrpc, void* data, void* data2) { UgJsonrpcObject* request; UgJsonrpcObject* response; int result; request = ug_jsonrpc_object_new (); response = ug_jsonrpc_object_new (); response->result.type = UG_VALUE_STRING; response->result.c.string = "pong"; do { result = ug_jsonrpc_receive (jrpc, request, NULL); if (result == UG_JSON_OBJECT) { print_rpc_object (request); response->id.type = request->id.type; response->id.c = request->id.c; ug_jsonrpc_response (jrpc, response); ug_jsonrpc_object_clear (request); } } while (result != 0); response->id.type = UG_JSON_NULL; response->result.c.string = NULL; ug_jsonrpc_object_free (response); ug_jsonrpc_object_free (request); puts ("server: client connection closed."); } void test_jsonrpc_socket (void) { UgJsonrpcObject* request; UgJsonrpcObject* response; UgJsonrpcSocket* jclient; UgSocketServer* server; #if 0 UgJsonrpcSocket* jserver; #endif puts ("----- test_jsonrpc_socket()"); server = ug_socket_server_new_addr ("127.0.0.1", "14777"); if (server == NULL) { puts ("failed to create UgJsonrpcSocketServer"); return; } #if 0 jserver = ug_malloc (sizeof (UgJsonrpcSocket)); ug_jsonrpc_socket_init (jserver); ug_jsonrpc_socket_use_server (jserver, server, jsonrpc_accepted, NULL, NULL); ug_socket_server_start (server); #else ug_socket_server_run_jsonrpc (server, jsonrpc_accepted, NULL, NULL); #endif ug_sleep (1000); jclient = ug_malloc (sizeof (UgJsonrpcSocket)); ug_jsonrpc_socket_init (jclient); ug_jsonrpc_socket_connect (jclient, "127.0.0.1", "14777"); // ping server request = ug_jsonrpc_object_new (); response = ug_jsonrpc_object_new (); request->method_static = "ping"; ug_jsonrpc_call (&jclient->rpc, request, response); print_rpc_object (response); ug_jsonrpc_object_free (response); ug_jsonrpc_object_free (request); ug_jsonrpc_socket_close (jclient); ug_jsonrpc_socket_final (jclient); ug_free (jclient); ug_sleep (1000); #if 0 ug_jsonrpc_socket_final(jserver); #endif ug_socket_server_stop (server); ug_socket_server_unref (server); } // ---------------------------------------------------------------------------- // test_uget_aria2 void test_uget_aria2_rpc_object (UgetAria2* uaria2) { UgValue* value; UgValue* vobj; UgJsonrpcObject* req1; UgJsonrpcObject* res1; UgJsonrpcObject* req2; UgJsonrpcObject* res2; // request 1 req1 = uget_aria2_alloc (uaria2, TRUE, TRUE); req1->method_static = "aria2.getGlobalStat"; uget_aria2_request (uaria2, req1); // request 2 req2 = uget_aria2_alloc (uaria2, TRUE, TRUE); req2->method_static = "aria2.changeGlobalOption"; ug_value_init_array (&req2->params, 2); vobj = ug_value_alloc (&req2->params, 1); ug_value_init_object (vobj, 2); value = ug_value_alloc (vobj, 1); value->name = "max-overall-download-limit"; value->type = UG_VALUE_STRING; value->c.string = "100k"; value = ug_value_alloc (vobj, 1); value->name = "max-overall-upload-limit"; value->type = UG_VALUE_STRING; value->c.string = "100k"; uget_aria2_request (uaria2, req2); // response 1 res1 = uget_aria2_respond (uaria2, req1); if (res1) { print_rpc_object (res1); ug_value_sort_name (&res1->result); value = ug_value_find_name (&res1->result, "downloadSpeed"); printf ("current downloadSpeed %d\n", ug_value_get_int (value)); } // recycle 1 uget_aria2_recycle (uaria2, req1); uget_aria2_recycle (uaria2, res1); // response 2 res2 = uget_aria2_respond (uaria2, req2); if (res2) { print_rpc_object (res2); } // recycle 2 ug_value_foreach (&req2->params, ug_value_set_name_string, NULL); uget_aria2_recycle (uaria2, req2); uget_aria2_recycle (uaria2, res2); } void test_uget_aria2 (void) { UgetAria2* uaria2; puts ("----- test_uget_aria2()"); uaria2 = uget_aria2_new (); uget_aria2_start_thread (uaria2); #if defined _WIN32 || defined _WIN64 uget_aria2_set_path (uaria2, "C:\\Program Files\\uGet\\bin\\aria2c.exe"); #endif uget_aria2_launch (uaria2); uaria2->shutdown = TRUE; test_uget_aria2_rpc_object (uaria2); // uget_aria2_shutdown (uaria2); uget_aria2_stop_thread (uaria2); uget_aria2_unref (uaria2); ug_sleep (2000); } // ---------------------------------------------------------------------------- // main int main (void) { #if defined _WIN32 || defined _WIN64 WSADATA WSAData; WSAStartup (MAKEWORD (2, 2), &WSAData); #endif // _WIN32 || _WIN64 // libcurl curl_global_init (CURL_GLOBAL_ALL); test_socket (); test_rpc_parser (); test_jsonrpc_socket (); test_jsonrpc_curl (); test_uget_aria2 (); // libcurl curl_global_cleanup (); #if defined _WIN32 || defined _WIN64 WSACleanup (); #endif return 0; } uget-2.2.0/tests/Makefile.in0000644000175000000120000005743513224532746012623 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 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@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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 = : noinst_PROGRAMS = test-json$(EXEEXT) test-jsonrpc$(EXEEXT) \ test-plugin+app$(EXEEXT) test-info$(EXEEXT) \ test-uglib$(EXEEXT) test-uget$(EXEEXT) @WITH_LIBPWMD_TRUE@am__append_1 = @LIBPWMD_LIBS@ subdir = tests ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) am_test_info_OBJECTS = test-info.$(OBJEXT) test_info_OBJECTS = $(am_test_info_OBJECTS) am__DEPENDENCIES_1 = am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) test_info_DEPENDENCIES = $(top_builddir)/uglib/libuglib.a \ $(am__DEPENDENCIES_2) am_test_json_OBJECTS = test-json.$(OBJEXT) test_json_OBJECTS = $(am_test_json_OBJECTS) test_json_DEPENDENCIES = $(top_builddir)/uglib/libuglib.a \ $(am__DEPENDENCIES_2) am_test_jsonrpc_OBJECTS = test-jsonrpc.$(OBJEXT) test_jsonrpc_OBJECTS = $(am_test_jsonrpc_OBJECTS) test_jsonrpc_DEPENDENCIES = $(top_builddir)/uget/libuget.a \ $(top_builddir)/uglib/libuglib.a $(am__DEPENDENCIES_2) am_test_plugin_app_OBJECTS = \ test_plugin_app-test-plugin+app.$(OBJEXT) test_plugin_app_OBJECTS = $(am_test_plugin_app_OBJECTS) test_plugin_app_DEPENDENCIES = $(top_builddir)/uget/libuget.a \ $(top_builddir)/uglib/libuglib.a $(am__DEPENDENCIES_2) am_test_uget_OBJECTS = test-uget.$(OBJEXT) test_uget_OBJECTS = $(am_test_uget_OBJECTS) test_uget_DEPENDENCIES = $(top_builddir)/uget/libuget.a \ $(top_builddir)/uglib/libuglib.a $(am__DEPENDENCIES_2) am_test_uglib_OBJECTS = test-uglib.$(OBJEXT) test_uglib_OBJECTS = $(am_test_uglib_OBJECTS) test_uglib_DEPENDENCIES = $(top_builddir)/uglib/libuglib.a \ $(am__DEPENDENCIES_2) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(test_info_SOURCES) $(test_json_SOURCES) \ $(test_jsonrpc_SOURCES) $(test_plugin_app_SOURCES) \ $(test_uget_SOURCES) $(test_uglib_SOURCES) DIST_SOURCES = $(test_info_SOURCES) $(test_json_SOURCES) \ $(test_jsonrpc_SOURCES) $(test_plugin_app_SOURCES) \ $(test_uget_SOURCES) $(test_uglib_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ APP_INDICATOR_CFLAGS = @APP_INDICATOR_CFLAGS@ APP_INDICATOR_LIBS = @APP_INDICATOR_LIBS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_CONFIG = @CURL_CONFIG@ CURL_LIBS = @CURL_LIBS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GETCONF = @GETCONF@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GSTREAMER_CFLAGS = @GSTREAMER_CFLAGS@ GSTREAMER_LIBS = @GSTREAMER_LIBS@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LDFLAGS = @LDFLAGS@ LFS_CFLAGS = @LFS_CFLAGS@ LFS_LDFLAGS = @LFS_LDFLAGS@ LIBCRYPTO_CFLAGS = @LIBCRYPTO_CFLAGS@ LIBCRYPTO_LIBS = @LIBCRYPTO_LIBS@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBNOTIFY_CFLAGS = @LIBNOTIFY_CFLAGS@ LIBNOTIFY_LIBS = @LIBNOTIFY_LIBS@ LIBOBJS = @LIBOBJS@ LIBPWMD_CFLAGS = @LIBPWMD_CFLAGS@ LIBPWMD_LIBS = @LIBPWMD_LIBS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ OBJEXT = @OBJEXT@ 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@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ 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@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ 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@ # test-uglib-cxx test-uget-cxx TESTS_LIBS = @PTHREAD_LIBS@ @CURL_LIBS@ @GLIB_LIBS@ $(am__append_1) # set the include path found by configure AM_CPPFLAGS = -I$(top_srcdir)/uglib -I$(top_srcdir)/uget AM_CFLAGS = @PTHREAD_CFLAGS@ @LFS_CFLAGS@ @CURL_CFLAGS@ @GLIB_CFLAGS@ AM_LDFLAGS = @LFS_LDFLAGS@ # test_json_CPPFLAGS = -I$(top_srcdir)/uglib test_json_LDADD = $(top_builddir)/uglib/libuglib.a $(TESTS_LIBS) test_json_SOURCES = test-json.c # test_jsonrpc_CPPFLAGS = -I$(top_srcdir)/uglib -I$(top_srcdir)/uget test_jsonrpc_LDADD = $(top_builddir)/uget/libuget.a $(top_builddir)/uglib/libuglib.a $(TESTS_LIBS) test_jsonrpc_SOURCES = test-jsonrpc.c test_plugin_app_CPPFLAGS = -I$(top_srcdir)/uglib -I$(top_srcdir)/uget @LIBGCRYPT_CFLAGS@ @LIBCRYPTO_CFLAGS@ test_plugin_app_LDADD = $(top_builddir)/uget/libuget.a $(top_builddir)/uglib/libuglib.a $(TESTS_LIBS) @LIBGCRYPT_LIBS@ @LIBCRYPTO_LIBS@ test_plugin_app_SOURCES = test-plugin+app.c # test_info_CPPFLAGS = -I$(top_srcdir)/uglib test_info_LDADD = $(top_builddir)/uglib/libuglib.a $(TESTS_LIBS) test_info_SOURCES = test-info.c # test_uglib_CPPFLAGS = -I$(top_srcdir)/uglib test_uglib_LDADD = $(top_builddir)/uglib/libuglib.a $(TESTS_LIBS) test_uglib_SOURCES = test-uglib.c # test_uget_CPPFLAGS = -I$(top_srcdir)/uglib -I$(top_srcdir)/uget test_uget_LDADD = $(top_builddir)/uget/libuget.a $(top_builddir)/uglib/libuglib.a $(TESTS_LIBS) test_uget_SOURCES = test-uget.c all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj $(srcdir)/Makefile.in: $(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) --gnu tests/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu tests/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) test-info$(EXEEXT): $(test_info_OBJECTS) $(test_info_DEPENDENCIES) $(EXTRA_test_info_DEPENDENCIES) @rm -f test-info$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_info_OBJECTS) $(test_info_LDADD) $(LIBS) test-json$(EXEEXT): $(test_json_OBJECTS) $(test_json_DEPENDENCIES) $(EXTRA_test_json_DEPENDENCIES) @rm -f test-json$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_json_OBJECTS) $(test_json_LDADD) $(LIBS) test-jsonrpc$(EXEEXT): $(test_jsonrpc_OBJECTS) $(test_jsonrpc_DEPENDENCIES) $(EXTRA_test_jsonrpc_DEPENDENCIES) @rm -f test-jsonrpc$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_jsonrpc_OBJECTS) $(test_jsonrpc_LDADD) $(LIBS) test-plugin+app$(EXEEXT): $(test_plugin_app_OBJECTS) $(test_plugin_app_DEPENDENCIES) $(EXTRA_test_plugin_app_DEPENDENCIES) @rm -f test-plugin+app$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_plugin_app_OBJECTS) $(test_plugin_app_LDADD) $(LIBS) test-uget$(EXEEXT): $(test_uget_OBJECTS) $(test_uget_DEPENDENCIES) $(EXTRA_test_uget_DEPENDENCIES) @rm -f test-uget$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_uget_OBJECTS) $(test_uget_LDADD) $(LIBS) test-uglib$(EXEEXT): $(test_uglib_OBJECTS) $(test_uglib_DEPENDENCIES) $(EXTRA_test_uglib_DEPENDENCIES) @rm -f test-uglib$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_uglib_OBJECTS) $(test_uglib_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-info.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-json.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-jsonrpc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-uget.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-uglib.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_plugin_app-test-plugin+app.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` test_plugin_app-test-plugin+app.o: test-plugin+app.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_plugin_app_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_plugin_app-test-plugin+app.o -MD -MP -MF $(DEPDIR)/test_plugin_app-test-plugin+app.Tpo -c -o test_plugin_app-test-plugin+app.o `test -f 'test-plugin+app.c' || echo '$(srcdir)/'`test-plugin+app.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_plugin_app-test-plugin+app.Tpo $(DEPDIR)/test_plugin_app-test-plugin+app.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-plugin+app.c' object='test_plugin_app-test-plugin+app.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_plugin_app_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_plugin_app-test-plugin+app.o `test -f 'test-plugin+app.c' || echo '$(srcdir)/'`test-plugin+app.c test_plugin_app-test-plugin+app.obj: test-plugin+app.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_plugin_app_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_plugin_app-test-plugin+app.obj -MD -MP -MF $(DEPDIR)/test_plugin_app-test-plugin+app.Tpo -c -o test_plugin_app-test-plugin+app.obj `if test -f 'test-plugin+app.c'; then $(CYGPATH_W) 'test-plugin+app.c'; else $(CYGPATH_W) '$(srcdir)/test-plugin+app.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_plugin_app-test-plugin+app.Tpo $(DEPDIR)/test_plugin_app-test-plugin+app.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-plugin+app.c' object='test_plugin_app-test-plugin+app.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_plugin_app_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_plugin_app-test-plugin+app.obj `if test -f 'test-plugin+app.c'; then $(CYGPATH_W) 'test-plugin+app.c'; else $(CYGPATH_W) '$(srcdir)/test-plugin+app.c'; fi` ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files 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 check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: 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: 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-am clean-am: clean-generic clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: 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 -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \ distclean-compile 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 maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am .PRECIOUS: Makefile #test_uglib_cxx_CPPFLAGS = -I$(top_srcdir)/uglib #test_uglib_cxx_CXXFLAGS = -std=c++11 #test_uglib_cxx_LDADD = $(top_builddir)/uglib/libuglib.a $(TESTS_LIBS) #test_uglib_cxx_SOURCES = test-uglib-cxx.cxx #test_uget_cxx_CXXFLAGS = -std=c++11 #test_uget_cxx_LDADD = $(top_builddir)/uget/libuget.a $(top_builddir)/uglib/libuglib.a $(TESTS_LIBS) #test_uget_cxx_SOURCES = test-uget-cxx.cxx # 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: uget-2.2.0/tests/test-plugin+app.c0000644000175000000120000002726013224532612013732 00000000000000/* * * Copyright (C) 2012-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #include #include #include #include #include #include #include #include #if defined _WIN32 || defined _WIN64 #include #define ug_sleep Sleep #else #include // usleep() #define ug_sleep(millisecond) usleep (millisecond * 1000) #endif // _WIN32 || _WIN64 // ---------------------------------------------------------------------------- // test_node void download_node (UgetNode* node, const UgetPluginInfo* info) { UgetCommon* common; UgetPlugin* plugin; UgetEvent* events; UgetEvent* cur; UgetEvent* next; UgetProgress* progress; int integer[2]; char* string[5]; plugin = uget_plugin_new (info); // integer[0] = 1000000; // integer[1] = 1000000; // uget_plugin_ctrl (plugin, UGET_PLUGIN_CTRL_SPEED, integer); uget_plugin_start (plugin, node); while (uget_plugin_sync (plugin)) { ug_sleep (1000); // event events = uget_plugin_pop (plugin); for (cur = events; cur; cur = next) { next = cur->next; printf ("\n" "Event type: %d - %s\n", cur->type, cur->string); uget_event_free (cur); } // progress progress = ug_info_get (&node->info, UgetProgressInfo); if (progress == NULL) continue; string[0] = ug_str_from_int_unit (progress->complete, NULL); string[1] = ug_str_from_int_unit (progress->total, NULL); string[2] = ug_str_from_int_unit (progress->uploaded, NULL); string[3] = ug_str_from_int_unit (progress->download_speed, "/s"); string[4] = ug_str_from_int_unit (progress->upload_speed, "/s"); printf ("\r" "DL: %s / %s, %d%%, %s | UL: %s, %s" " ", string[0], string[1], progress->percent, string[3], string[2], string[4]); for (integer[0] = 0; integer[0] < 5; integer[0]++) ug_free (string[integer[0]]); } // these data may changed, print them. common = ug_info_get (&node->info, UgetCommonInfo); printf ("\n" "node->name : %s\n" "common->uri : %s\n" "common->file : %s\n", node->name, common->uri, common->file); // print children for (node = node->children; node; node = node->next) printf ("child node name : %s\n", node->name); uget_plugin_unref (plugin); } void test_node_download (void) { UgetCommon* common; UgetHttp* http; UgetNode* node; char* referrer; char* uri; char* mirrors; uri = "https://mega.nz/#!MSpjBRhZ!nZBsUQCAnf71842wXuals_ftSkga3fIQypzBsKEZbmk"; // uri = "https://www.youtube.com/watch?v=y2004Xaz2HU"; // uri = "http://download.tuxfamily.org/notepadplus/6.5.3/npp.6.5.3.Installer.exe"; // uri = "http://ftp.gimp.org/pub/gimp/v2.8/windows/gimp-2.8.10-setup.exe"; // mirrors = "ftp://195.220.108.108/linux/fedora/linux/updates/19/x86_64/kernel-3.11.2-201.fc19.x86_64.rpm"; mirrors = NULL; // referrer = "http://code.google.com/p/tortoisegit/wiki/Download?tm=2"; referrer = NULL; node = uget_node_new (NULL); // commom options common = ug_info_realloc (&node->info, UgetCommonInfo); common->uri = ug_strdup (uri); if (mirrors) common->mirrors = ug_strdup (mirrors); // common->folder = ug_strdup ("D:\\Downloads"); // common->max_connections = 2; common->debug_level = 1; common->retry_limit = 1; common->connect_timeout = 30; // http options http = ug_info_realloc (&node->info, UgetHttpInfo); if (referrer) http->referrer = ug_strdup (referrer); // download_node (node, UgetPluginCurlInfo); // download_node (node, UgetPluginAria2Info); // download_node (node, UgetPluginMediaInfo); download_node (node, UgetPluginMegaInfo); uget_node_unref (node); } // ---------------------------------------------------------------------------- // test_plugin void test_setup_plugin_aria2 (void) { const UgetPluginInfo* pinfo; pinfo = UgetPluginAria2Info; uget_plugin_set (pinfo, UGET_PLUGIN_INIT, (void*) TRUE); uget_plugin_set (pinfo, UGET_PLUGIN_ARIA2_URI, "http://localhost/jsonrpc"); #if defined _WIN32 || defined _WIN64 uget_plugin_set (pinfo, UGET_PLUGIN_ARIA2_PATH, "C:\\Program Files\\uGet\\bin\\aria2c.exe"); #endif uget_plugin_set (pinfo, UGET_PLUGIN_ARIA2_ARGUMENT, "--enable-rpc=true -D --check-certificate=false"); uget_plugin_set (pinfo, UGET_PLUGIN_ARIA2_LAUNCH, (void*) TRUE); uget_plugin_set (pinfo, UGET_PLUGIN_ARIA2_SHUTDOWN, (void*) TRUE); ug_sleep (1000); uget_plugin_set (pinfo, UGET_PLUGIN_INIT, (void*) FALSE); ug_sleep (1000); } // ---------------------------------------------------------------------------- // test_task void print_node_speed_limit (UgetNode** dnode, int count) { int total[2] = {0,0}; UgetRelation* relation; for (count = 0; count < 7; count++) { relation = ug_info_get (&dnode[count]->info, UgetRelationInfo); printf ("limit D: %d, U: %d | speed D: %d, U: %d\n", relation->task.limit[0], relation->task.limit[1], relation->task.speed[0], relation->task.speed[1]); total[0] += relation->task.limit[0]; total[1] += relation->task.limit[1]; } printf ("total limit D: %d, U: %d\n", total[0], total[1]); } void test_task (void) { UgetTask* task; UgetNode* dnode[7]; UgetRelation* relation; int count; task = calloc (1, sizeof (UgetTask)); uget_task_init (task); // task speed control ------------------- for (count = 0; count < 7; count++) { dnode[count] = uget_node_new (NULL); relation = ug_info_realloc (&dnode[count]->info, UgetRelationInfo); relation->task.limit[0] = 2000; relation->task.limit[1] = 1500; relation->task.speed[0] = 2000 - count * 200; relation->task.speed[1] = 1500 - count * 200; uget_task_add (task, dnode[count], UgetPluginEmptyInfo); } relation->task.limit[0] = 0; relation->task.limit[1] = 0; uget_task_set_speed (task, 12000, 8000); print_node_speed_limit(dnode, 7); puts ("---"); uget_task_adjust_speed (task); print_node_speed_limit(dnode, 7); uget_task_remove_all (task); uget_task_final (task); free (task); for (count = 0; count < 7; count++) uget_node_unref (dnode[count]); } // ---------------------------------------------------------------------------- // test_app void setup_app (UgetApp* app) { UgetNode* cnode; UgetCategory* category; UgetCommon* common; cnode = uget_node_new (NULL); cnode->name = ug_strdup ("Home Category"); category = ug_info_realloc (&cnode->info, UgetCategoryInfo); *(char**)ug_array_alloc (&category->schemes, 1) = ug_strdup ("http"); *(char**)ug_array_alloc (&category->schemes, 1) = ug_strdup ("https"); *(char**)ug_array_alloc (&category->schemes, 1) = ug_strdup ("ftp"); common = ug_info_realloc (&cnode->info, UgetCommonInfo); common->max_connections = 2; uget_app_add_category (app, cnode, TRUE); uget_app_add_plugin (app, UgetPluginAria2Info); uget_app_add_plugin (app, UgetPluginCurlInfo); uget_app_clear_plugins (app); uget_app_set_default_plugin (app, UgetPluginCurlInfo); } void start_app (UgetApp* app) { UgetNode* dnode; UgetCommon* common; char* string[2]; dnode = uget_node_new (NULL); dnode->name = ug_strdup ("Download"); common = ug_info_realloc (&dnode->info, UgetCommonInfo); common->uri = ug_strdup ("http://www.utorrent.com/scripts/dl.php?track=stable&build=29812&client=utorrent"); common->folder = ug_strdup ("D:\\Downloads"); common->debug_level = 1; // common->keeping.enable = TRUE; // common->keeping.uri = TRUE; // common->keeping.folder = TRUE; // common->keeping.debug_level = TRUE; uget_app_add_download (app, dnode, NULL, FALSE); puts ("uget_app_grow()"); while (uget_app_grow (app, FALSE)) { ug_sleep (1000); string[0] = ug_str_from_int_unit (app->task.speed.download, "/s"); string[1] = ug_str_from_int_unit (app->task.speed.upload, "/s"); printf ("\r" "DL: %s | UL %s" " ", string[0], string[1]); ug_free (string[0]); ug_free (string[1]); } puts ("uget_app_grow() return 0"); puts ("call uget_app_grow() again"); uget_app_grow (app, FALSE); } void close_app (UgetApp* app) { uget_app_clear_plugins (app); } void test_app_node (UgetApp* app) { UgetNode* dnode[7]; UgetNode* cnode; UgetCommon* common; int count; for (count = 0; count < 7; count++) { dnode[count] = uget_node_new (NULL); common = ug_info_realloc (&dnode[count]->info, UgetCommonInfo); common->uri = ug_strdup ("ftp://127.0.0.1/"); common->folder = ug_strdup ("D:\\Downloads"); common->keeping.enable = TRUE; common->keeping.uri = FALSE; common->keeping.folder = FALSE; uget_app_add_download (app, dnode[count], NULL, TRUE); } uget_app_move_download (app, dnode[5], NULL); uget_app_delete_download (app, dnode[2], TRUE); uget_app_delete_download (app, dnode[4], FALSE); uget_app_delete_download (app, dnode[6], FALSE); cnode = app->real.children; if (cnode) printf ("%d\n", cnode->n_children); cnode = app->split.children; if (cnode) printf ("%d\n", cnode->n_children); cnode = app->mix.children; if (cnode) printf ("%d\n", cnode->n_children); cnode = app->mix_split.children; if (cnode) printf ("%d\n", cnode->n_children); } void test_app (void) { UgetApp* app; app = calloc (1, sizeof (UgetApp)); uget_app_init (app); setup_app (app); start_app (app); // test_app_node (app); uget_app_save_categories (app, NULL); // uget_app_load_categories (app, NULL); uget_app_final (app); free (app); } // ---------------------------------------------------------------------------- // main int main (void) { // initialize plug-in uget_plugin_set (UgetPluginCurlInfo, UGET_PLUGIN_INIT, (void*) TRUE); uget_plugin_set (UgetPluginAria2Info, UGET_PLUGIN_INIT, (void*) TRUE); uget_plugin_set (UgetPluginMediaInfo, UGET_PLUGIN_INIT, (void*) TRUE); uget_plugin_set (UgetPluginMegaInfo, UGET_PLUGIN_INIT, (void*) TRUE); // test_setup_plugin_aria2 (); test_node_download (); // test_task (); // test_app (); // uget_plugin_set (UgetPluginAria2Info, UGET_PLUGIN_ARIA2_SHUTDOWN_NOW, (void*) TRUE); // finalize plug-in uget_plugin_set (UgetPluginCurlInfo, UGET_PLUGIN_INIT, (void*) FALSE); uget_plugin_set (UgetPluginAria2Info, UGET_PLUGIN_INIT, (void*) FALSE); uget_plugin_set (UgetPluginMediaInfo, UGET_PLUGIN_INIT, (void*) FALSE); uget_plugin_set (UgetPluginMegaInfo, UGET_PLUGIN_INIT, (void*) FALSE); ug_sleep(1000); return 0; } uget-2.2.0/tests/test-info.c0000644000175000000120000001532713224532612012614 00000000000000/* * * Copyright (C) 2012-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #include #include #include #include #include // ---------------------------------------------------------------------------- // Test1 typedef struct { UG_DATA_MEMBERS; // const UgDataInfo* info; int type; } Test1; const UgEntry Test1Entry[] = { {"type", offsetof (Test1, type), UG_ENTRY_INT, NULL, NULL}, {NULL} }; void test1_init (Test1* t1); const UgDataInfo Test1Info = { "Test1", sizeof (Test1), Test1Entry, // UgEntry (UgInitFunc) test1_init, (UgFinalFunc) NULL, (UgAssignFunc) NULL }; void test1_init (Test1* t1) { t1->info = &Test1Info; t1->type = 1; } // ---------------------------------------------------------------------------- // Test2 typedef struct { UG_DATA_MEMBERS; // const UgDataInfo* info; int type; } Test2; const UgEntry Test2Entry[] = { {"type", offsetof (Test2, type), UG_ENTRY_INT, NULL, NULL}, {NULL} }; void test2_init (Test2* t2); const UgDataInfo Test2Info = { "Test2", sizeof (Test2), Test2Entry, // UgEntry (UgInitFunc) test2_init, (UgFinalFunc) NULL, (UgAssignFunc) NULL }; void test2_init (Test2* t2) { t2->info = &Test2Info; t2->type = 2; } // ---------------------------------------------------------------------------- // Test3 typedef struct { UG_DATA_MEMBERS; // const UgDataInfo* info; int type; } Test3; const UgEntry Test3Entry[] = { {"type", offsetof (Test3, type), UG_ENTRY_INT, NULL, NULL}, {NULL} }; void test3_init (Test3* t3); const UgDataInfo Test3Info = { "Test3", sizeof (Test3), Test3Entry, // UgEntry (UgInitFunc) test3_init, (UgFinalFunc) NULL, (UgAssignFunc) NULL }; void test3_init (Test3* t3) { t3->info = &Test3Info; t3->type = 3; } // ---------------------------------------------------------------------------- // test UgInfo UgEntry InfoCustomEntry[] = { {NULL, 0, UG_ENTRY_CUSTOM, (UgJsonParseFunc) ug_json_parse_info, (UgJsonWriteFunc) ug_json_write_info}, {NULL} }; void test_info (UgInfo* info) { void* data; puts ("\n--- test_info:"); data = ug_info_realloc (info, &Test2Info); printf ("ug_info_realloc (Test2Info) : %d\n", ((Test2*)data)->type); data = ug_info_realloc (info, &Test1Info); printf ("ug_info_realloc (Test1Info) : %d\n", ((Test1*)data)->type); data = ug_info_realloc (info, &Test3Info); printf ("ug_info_realloc (Test3Info) : %d\n", ((Test3*)data)->type); } void parse_info (UgInfo* info) { int code; UgJson json; UgRegistry registry; const char* json_string = { "{" " \"Test1\": {" " \"type\": 1" " }," " \"Test2\": {" " \"type\": 2" " }," " \"Test3\": {" " \"type\": 3" " }" "}" }; // UgRegistry is used by ug_json_parse_info() and ug_json_parse_info_entry() ug_registry_init (®istry); ug_registry_add (®istry, &Test2Info); ug_registry_add (®istry, &Test3Info); ug_registry_add (®istry, &Test1Info); // ug_registry_sort (®istry); // ug_json_parse_info() must use default UgInfoKeys. ug_info_set_registry (®istry); ug_json_init (&json); ug_json_begin_parse (&json); #if 1 // method 1: use UgEntry to parse start of object ug_json_push (&json, ug_json_parse_entry, info, InfoCustomEntry); #else // method 2: push ug_json_parse_info() to parse start of object ug_json_push (&json, ug_json_parse_info, info, ®istry); #endif code = ug_json_parse (&json, json_string, -1); ug_json_end_parse (&json); ug_json_final (&json); printf ("ug_json_parse response %d\n", code); ug_info_set_registry (NULL); ug_registry_final (®istry); } void dump_info (UgInfo* info) { UgPair* cur; UgPair* end; for (cur = info->at, end = info->at + info->length; cur < end; cur++) { if (cur->key == NULL) { puts ("NULL"); continue; } printf ("%s", ((UgDataInfo*)cur->key)->name); if (cur->data) printf (" : %d", ((Test1*)cur->data)->type); puts (""); } } // UgBufferFunc static int buffer_to_file (UgBuffer* buffer) { FILE* file = buffer->data; printf ("write %d bytes to file\n", ug_buffer_length (buffer)); fwrite (buffer->beg, 1, ug_buffer_length(buffer), file); buffer->cur = buffer->beg; return 0; } void write_info_to_file (UgInfo* info, char* filename) { UgJson json; FILE* file; UgBuffer buffer; file = fopen (filename, "w"); ug_buffer_init (&buffer, 128); buffer.more = buffer_to_file; buffer.data = file; ug_json_init (&json); ug_json_begin_write (&json, UG_JSON_FORMAT_INDENT, &buffer); #if 1 // method 1: use UgEntry to write start of object ug_json_write_entry (&json, info, InfoCustomEntry); #else // method 2: call ug_json_write_object_head() to write start of object ug_json_write_object_head (&json); ug_json_write_info (&json, info); ug_json_write_object_tail (&json); #endif ug_json_end_write (&json); ug_json_final (&json); ug_buffer_clear (&buffer, 1); fclose (file); } // ---------------------------------------------------------------------------- // main int main (void) { UgInfo info; puts ("\n--- test UgInfo functions:"); ug_info_init (&info, 8, 2); #if 0 test_info (&info); #else parse_info (&info); #endif dump_info (&info); write_info_to_file (&info, "test-info.json"); ug_info_final (&info); return 0; } uget-2.2.0/tests/test-json.c0000644000175000000120000005777613224532612012650 00000000000000/* * * Copyright (C) 2012-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #ifdef _MSC_VER #define _CRT_SECURE_NO_WARNINGS #endif #include #include #include #include #include #include #include #include #include // ---------------------------------------------------------------------------- // WorkedId typedef struct { int worked; char* id; } WorkedId; UgJsonError worked_id_custom_parse (UgJson* json, const char* name, const char* value, void* dest, void* none); void worked_id_custom_write (UgJson* json, void* data); UgEntry WorkedIdEntry[] = { {"worked", offsetof (WorkedId, worked), UG_ENTRY_BOOL, NULL, NULL}, {"id", offsetof (WorkedId, id), UG_ENTRY_STRING, NULL, NULL}, {NULL}, }; // used by test_json_object_custom() UgEntry WorkedIdCustomEntry[] = { {NULL, 0, UG_ENTRY_CUSTOM, (UgJsonParseFunc) worked_id_custom_parse, (UgJsonWriteFunc) worked_id_custom_write }, {NULL} }; // ------------------------------------ // WorkedId functions void worked_id_init (WorkedId* wid) { wid->worked = 0; wid->id = NULL; } void worked_id_final (WorkedId* wid) { ug_free (wid->id); } WorkedId* worked_id_new (void) { WorkedId* wid; wid = ug_malloc (sizeof (WorkedId)); worked_id_init(wid); return wid; } void worked_id_free (WorkedId* wid) { worked_id_final (wid); } // UgEntry.type = UG_ENTRY_CUSTOM // UgEntry.param1 = (UgJsonParseFunc) worked_id_custom_parse UgJsonError worked_id_custom_parse (UgJson* json, const char* name, const char* value, void* dest, void* none) { // WorkedId's type is UG_JSON_OBJECT if (json->type != UG_JSON_OBJECT) { // if (json->type == UG_JSON_ARRAY) // ug_json_push (json, ug_json_parse_unknown, NULL, NULL); return UG_JSON_ERROR_TYPE_NOT_MATCH; } // initialize WorkedId. If you have initialized it, don't initialize again. // worked_id_init (dest); // push JSON parser, only UG_JSON_OBJECT or UG_JSON_ARRAY need to push parser. ug_json_push (json, ug_json_parse_entry, dest, WorkedIdEntry); // return error code return UG_JSON_ERROR_NONE; } // UgEntry.type = UG_ENTRY_CUSTOM // UgEntry.param2 = (UgJsonWriteFunc) worked_id_custom_write void worked_id_custom_write (UgJson* json, void* data) { ug_json_write_object_head (json); ug_json_write_entry (json, data, WorkedIdEntry); ug_json_write_object_tail (json); } // ---------------------------------------------------------------------------- // WorkedIdArray typedef UG_ARRAY (WorkedId) WorkedIdArray; UgJsonError worked_id_array_parse (UgJson* json, const char* name, const char* value, void* array, void* none) { WorkedId* wid; // WorkedId's type is UG_JSON_OBJECT if (json->type != UG_JSON_OBJECT) { // if (json->type == UG_JSON_ARRAY) // ug_json_push (json, ug_json_parse_unknown, NULL, NULL); return UG_JSON_ERROR_TYPE_NOT_MATCH; } wid = ug_array_alloc (array, 1); worked_id_init (wid); // push JSON parser, only UG_JSON_OBJECT or UG_JSON_ARRAY need to push parser. ug_json_push (json, ug_json_parse_entry, wid, WorkedIdEntry); // return error code return UG_JSON_ERROR_NONE; } void worked_id_array_write (UgJson* json, void* array) { WorkedId* cur; WorkedId* end; cur = ((WorkedIdArray*)array)->at; end = ((WorkedIdArray*)array)->at + ((WorkedIdArray*)array)->length; for (; cur < end; cur++) worked_id_custom_write (json, cur); } // ---------------------------------------------------------------------------- // SampleJs typedef struct { char* name; struct Info { struct FtpInfo { char* user; char* password; int active_mode; } ftp; struct HttpInfo { char* user_agent; char* referrer; } http; UgArrayStr sarray; UgArrayInt iarray; UG_ARRAY(WorkedId) oarray; } info; } SampleJs; // SampleJs.Info.FtpInfo UgEntry FtpInfoEntry[] = { {"user", offsetof (struct FtpInfo, user), UG_ENTRY_STRING, NULL, NULL}, {"password", offsetof (struct FtpInfo, password), UG_ENTRY_STRING, NULL, NULL}, {"active-mode",offsetof (struct FtpInfo, active_mode),UG_ENTRY_BOOL, NULL, NULL}, {NULL}, }; // SampleJs.Info.HttpInfo UgEntry HttpInfoEntry[] = { {"user-agent", offsetof (struct HttpInfo, user_agent), UG_ENTRY_STRING, NULL, NULL}, {"referrer", offsetof (struct HttpInfo, referrer), UG_ENTRY_STRING, NULL, NULL}, {NULL}, }; // SampleJs.Info UgEntry InfoEntry[] = { {"ftp", offsetof (struct Info, ftp), UG_ENTRY_OBJECT, FtpInfoEntry, (UgInitFunc) NULL}, {"http", offsetof (struct Info, http), UG_ENTRY_OBJECT, HttpInfoEntry, (UgInitFunc) NULL}, {"sarray", offsetof (struct Info, sarray), UG_ENTRY_ARRAY, ug_json_parse_array_string, ug_json_write_array_string}, {"iarray", offsetof (struct Info, iarray), UG_ENTRY_ARRAY, ug_json_parse_array_int, ug_json_write_array_int}, {"oarray", offsetof (struct Info, oarray), UG_ENTRY_ARRAY, worked_id_array_parse, worked_id_array_write}, {NULL}, }; // SampleJs UgEntry SampleJsEntry[] = { {"name", offsetof (SampleJs, name), UG_ENTRY_STRING, NULL, NULL}, {"info", offsetof (SampleJs, info), UG_ENTRY_OBJECT, InfoEntry, (UgInitFunc) NULL}, {NULL}, }; // used by sample_js_parse() UgEntry SampleJsObjectEntry[] = { {NULL, 0, UG_ENTRY_OBJECT, SampleJsEntry, (UgInitFunc) NULL}, {NULL} }; // ------------------------------------ // SampleJs functions SampleJs* sample_js_new (void) { SampleJs* samplejs; samplejs = calloc (1, sizeof (SampleJs)); ug_array_init (&samplejs->info.sarray, sizeof (char*), 0); ug_array_init (&samplejs->info.iarray, sizeof (int), 0); ug_array_init (&samplejs->info.oarray, sizeof (WorkedId), 0); return samplejs; } void sample_js_free (SampleJs* samplejs) { ug_array_clear (&samplejs->info.sarray); ug_array_clear (&samplejs->info.iarray); ug_array_clear (&samplejs->info.oarray); free (samplejs); } // UgJsonParseFunc UgJsonError json_debug_parser (UgJson* json, const char* name, const char* value, void* dest, void* none) { printf ("scope : %s\n", (json->scope == UG_JSON_ARRAY) ? "A" : "O"); if (json->type == UG_JSON_ARRAY || json->type == UG_JSON_OBJECT) ug_json_push (json, json_debug_parser, NULL, NULL); // UgJson.index[0] : index of name // UgJson.index[1] : index of value // debug if (json->index[0]) printf ("'%s' : ", json->buf.at + json->index[0]); switch (json->type) { case UG_JSON_NULL: // null printf ("NULL '%s'", json->buf.at + json->index[1]); break; case UG_JSON_TRUE: // true printf ("TRUE '%s'", json->buf.at + json->index[1]); break; case UG_JSON_FALSE: // false printf ("FALSE '%s'", json->buf.at + json->index[1]); break; case UG_JSON_NUMBER: // 1234, 0.567 printf ("NUMBER '%s'", json->buf.at + json->index[1]); break; case UG_JSON_STRING: // "string" printf ("STRING '%s'", json->buf.at + json->index[1]); break; case UG_JSON_OBJECT: // { printf ("OBJECT"); break; case UG_JSON_ARRAY: // [ printf ("ARRAY"); break; } printf ("\n"); return 0; } static const char* sample_js_string = { "{" " \"name\": \"\\u5927\\u4E2Dfile.torrent\"," " \"info\":" " {" " \"ftp\":" " {" " \"user\": \"anonymous\"," " \"password\": \"guest@unknown\"," " \"active-mode\": false" " }," " \"http\":" " {" " \"user-agent\": \"Browser\\/version\"," " \"referrer\": \"http:\\/\\/127.0.0.1\\/\" " " }," " \"sarray\":" " [" " \"element1\", \"element2\"," " \"element3\", \"element\\n4\" " " ]," " \"iarray\":" " [" " 1234, 2012," " 4567, 2011 " " ]," " \"oarray\":" " [" " { \"worked\" : false, \"id\": \"KMan\" }," " { \"worked\" : true , \"id\": \"Kimi\" }," " { \"worked\" : false, \"id\": \"XMan\" }," " { \"worked\" : true , \"id\": \"WMan\" }" " ]" " }" "}" }; void sample_js_parse (SampleJs* samplejs) { UgJson json; int code; // JSON string for SampleJs const char* json_string = sample_js_string; memset (&json, 0, sizeof (json)); ug_json_init (&json); ug_json_begin_parse (&json); #if 1 // method 1: use UgEntry to parse start of object ug_json_push (&json, ug_json_parse_entry, samplejs, SampleJsObjectEntry); #elif 1 // method 2: push ug_json_parse_object() to parse start of object ug_json_push (&json, ug_json_parse_entry, samplejs, SampleJsEntry); ug_json_push (&json, ug_json_parse_object, NULL, NULL); #else // debug ug_json_push (&json, json_debug_parser, NULL, NULL); ug_json_push (&json, ug_json_parse_object, NULL, NULL); #endif code = ug_json_parse (&json, json_string, -1); printf ("ug_json_parse response %d\n", code); code = ug_json_end_parse (&json); printf ("ug_json_end_parse response %d\n", code); ug_json_final (&json); } void sample_js_reparse (SampleJs* samplejs) { UgJson json; UgValue value; ug_value_init (&value); memset (&json, 0, sizeof (json)); ug_json_init (&json); ug_json_begin_parse (&json); ug_json_push (&json, ug_json_parse_value, &value, NULL); ug_json_parse (&json, sample_js_string, -1); ug_json_end_parse (&json); // convert UgValue to UgEntry ug_json_begin_parse (&json); ug_json_push (&json, ug_json_parse_entry, samplejs, SampleJsObjectEntry); ug_json_parse_by_value (&json, &value); ug_json_end_parse (&json); ug_json_final (&json); ug_value_clear (&value); } void sample_js_print (SampleJs* samplejs) { UgJson json; UgBuffer buffer; printf ("\n" "obj.info.ftp.user: %s\n" "obj.info.ftp.password: %s\n" "obj.info.ftp.active_mode: %d\n" "obj.info.http.user_agent: %s\n" "obj.info.http.referrer: %s\n", samplejs->info.ftp.user, samplejs->info.ftp.password, samplejs->info.ftp.active_mode, samplejs->info.http.user_agent, samplejs->info.http.referrer ); printf ("obj.info.sarray[0]: %s\n" "obj.info.sarray[1]: %s\n" "obj.info.sarray[2]: %s\n" "obj.info.sarray[3]: %s\n", samplejs->info.sarray.at[0], samplejs->info.sarray.at[1], samplejs->info.sarray.at[2], samplejs->info.sarray.at[3]); printf ("obj.info.iarray[0]: %d\n" "obj.info.iarray[1]: %d\n" "obj.info.iarray[2]: %d\n" "obj.info.iarray[3]: %d\n", samplejs->info.iarray.at[0], samplejs->info.iarray.at[1], samplejs->info.iarray.at[2], samplejs->info.iarray.at[3]); printf ("obj.info.oarray[0].worked: %d\n" "obj.info.oarray[0].id: %s\n" "obj.info.oarray[1].worked: %d\n" "obj.info.oarray[1].id: %s\n" "obj.info.oarray[2].worked: %d\n" "obj.info.oarray[2].id: %s\n" "obj.info.oarray[3].worked: %d\n" "obj.info.oarray[3].id: %s\n", samplejs->info.oarray.at[0].worked, samplejs->info.oarray.at[0].id, samplejs->info.oarray.at[1].worked, samplejs->info.oarray.at[1].id, samplejs->info.oarray.at[2].worked, samplejs->info.oarray.at[2].id, samplejs->info.oarray.at[3].worked, samplejs->info.oarray.at[3].id); ug_json_init (&json); ug_buffer_init (&buffer, 1024); ug_json_begin_write (&json, UG_JSON_FORMAT_INDENT, &buffer); #if 1 // method 1: use UgEntry to write start of object ug_json_write_entry (&json, samplejs, SampleJsObjectEntry); #else // method 2: call ug_json_write_object_head() to write start of object ug_json_write_object_head (&json); ug_json_write_entry (&json, samplejs, SampleJsEntry); ug_json_write_object_tail (&json); #endif ug_json_end_write (&json); ug_buffer_write_char (&buffer, '\0'); puts ((char*)buffer.beg); ug_buffer_clear (&buffer, 1); ug_json_final (&json); } // UgBufferFunc static int buffer_to_file (UgBuffer* buffer) { FILE* file = buffer->data; printf ("write %d bytes to file\n", ug_buffer_length (buffer)); fwrite (buffer->beg, 1, ug_buffer_length(buffer), file); buffer->cur = buffer->beg; return 0; } void sample_js_to_file (SampleJs* samplejs, const char* filename) { UgBuffer buffer; UgJson json; FILE* file; file = fopen (filename, "w"); ug_buffer_init (&buffer, 128); buffer.more = buffer_to_file; buffer.data = file; ug_json_init (&json); ug_json_begin_write (&json, UG_JSON_FORMAT_INDENT, &buffer); #if 1 // method 1: use UgEntry to write start of object ug_json_write_entry (&json, samplejs, SampleJsObjectEntry); #else // method 2: call ug_json_write_object_head() to write start of object ug_json_write_object_head (&json); ug_json_write_entry (&json, samplejs, SampleJsEntry); ug_json_write_object_tail (&json); #endif ug_json_end_write (&json); ug_json_final (&json); fclose (file); } // ---------------------------------------------------------------------------- // JSON object sample void test_json_object_custom (void) { UgBuffer buffer; WorkedId worked; int code; UgJson json; const char* json_string = { "{ \"worked\" : true , \"id\": \"C.H. Huang\" }" }; puts ("\n--- test_json_object_custom:"); worked_id_init (&worked); ug_json_init (&json); ug_buffer_init (&buffer, 128); // parse ug_json_begin_parse (&json); #if 1 // method 1: use UgEntry to parse start of object ug_json_push (&json, ug_json_parse_entry, &worked, WorkedIdCustomEntry); #else // method 2: push ug_json_parse_object() to parse start of object ug_json_push (&json, ug_json_parse_entry, &worked, WorkedIdEntry); ug_json_push (&json, ug_json_parse_object, NULL, NULL); #endif code = ug_json_parse (&json, json_string, -1); printf ("ug_json_parse response %d\n", code); code = ug_json_end_parse (&json); printf ("ug_json_end_parse response %d\n", code); // write ug_json_begin_write (&json, UG_JSON_FORMAT_INDENT, &buffer); #if 1 // method 1: use UgEntry to write start of object ug_json_write_entry (&json, &worked, WorkedIdCustomEntry); #else // method 2: call ug_json_write_object_head() to write start of object ug_json_write_object_head (&json); ug_json_write_entry (&json, &worked, WorkedIdEntry); ug_json_write_object_tail (&json); #endif ug_json_end_write (&json); ug_buffer_write_char (&buffer, '\0'); puts (buffer.beg); ug_buffer_clear (&buffer, 1); ug_json_final (&json); worked_id_final (&worked); } // ---------------------------------------------------------------------------- // JSON array sample // use UgArray to store JSON number array void test_json_int_array (void) { // method 1 const UgEntry intArrayEntry[] = { {NULL, 0, UG_ENTRY_ARRAY, ug_json_parse_array_int, ug_json_write_array_int}, {NULL} }; // common UgJson json; UgArrayInt array; UgJsonError code; char* teststr = "[12,22,34,56]"; int index; puts ("\n--- test_json_int_array:"); memset (&json, 0, sizeof (json)); ug_array_init (&array, sizeof (int), 0); // JSON begin ug_json_init (&json); // JSON parse ug_json_begin_parse (&json); #if 1 // method 1: use UgEntry to parse start of array ug_json_push (&json, ug_json_parse_entry, &array, (void*)intArrayEntry); #else // method 2: push ug_json_parse_array() to parse start of array ug_json_push (&json, ug_json_parse_array_int, &array, NULL); ug_json_push (&json, ug_json_parse_array, NULL, NULL); #endif code = ug_json_parse (&json, teststr, -1); printf ("ug_json_parse response %d\n", code); code = ug_json_end_parse (&json); printf ("ug_json_end_parse response %d\n", code); // JSON end ug_json_final (&json); printf ("array.length = '%d'\n" "array.allocated = '%d'\n\n", array.length, array.allocated); for (index = 0; index < array.length; index++) printf ("array.at[%d] = %d\n", index, array.at[index]); ug_array_clear (&array); } // use UgList to store JSON string and number array void test_json_array_by_list (void) { // method 1 const UgEntry stringListEntry[] = { {NULL, 0, UG_ENTRY_ARRAY, ug_json_parse_list_string, ug_json_write_list_string}, {NULL} }; const UgEntry intListEntry[] = { {NULL, 0, UG_ENTRY_ARRAY, ug_json_parse_list_int, ug_json_write_list_int}, {NULL} }; // common UgJson json; UgList list; UgLink* link; UgJsonError code; UgBuffer buffer; char* jarraystr = "[\"Str1\",\"Str2\",\"Str3\",\"Str4\"]"; char* jarrayint = "[21,32,43,54]"; puts ("\n--- test_json_array_by_list:"); memset (&json, 0, sizeof (json)); ug_list_init (&list); // JSON begin ug_json_init (&json); ug_buffer_init (&buffer, 4096); puts ("\n parse JSON string array:"); // JSON parse - string array ug_json_begin_parse (&json); #if 1 // method 1: use UgEntry to parse start of array ug_json_push (&json, ug_json_parse_entry, &list, (void*)stringListEntry); #else // method 2: push ug_json_parse_array() to parse start of array ug_json_push (&json, ug_json_parse_list_string, &list, NULL); ug_json_push (&json, ug_json_parse_array, NULL, NULL); #endif code = ug_json_parse (&json, jarraystr, -1); printf ("ug_json_parse response %d\n", code); code = ug_json_end_parse (&json); printf ("ug_json_end_parse response %d\n", code); printf ("list.size = '%d'\n", (int)list.size); for (link = list.head; link; link = link->next) printf ("link->data = \"%s\"\n", (char*)link->data); // JSON write - string array ug_json_begin_write (&json, 0, &buffer); #if 1 // method 1: use UgEntry to write start of array ug_json_write_entry (&json, &list, (void*)stringListEntry); #else // method 2: call ug_json_write_array_head() to write start of array ug_json_write_array_head (&json); ug_json_write_list_string (&json, &list); ug_json_write_array_tail (&json); #endif ug_json_end_write (&json); puts ("ug_json_write_list_string:"); ug_buffer_write_char (&buffer, '\0'); puts (buffer.beg); // free strings in list ug_list_foreach (&list, (UgForeachFunc) ug_free, NULL); ug_list_clear (&list, TRUE); puts ("\n parse JSON int array:"); // JSON parse - int array ug_json_begin_parse (&json); #if 1 // method 1: use UgEntry to parse start of array ug_json_push (&json, ug_json_parse_entry, &list, (void*)intListEntry); #else // method 2: push ug_json_parse_array() to parse start of array ug_json_push (&json, ug_json_parse_list_int, &list, NULL); ug_json_push (&json, ug_json_parse_array, NULL, NULL); #endif code = ug_json_parse (&json, jarrayint, -1); printf ("ug_json_parse response %d\n", code); code = ug_json_end_parse (&json); printf ("ug_json_end_parse response %d\n", code); printf ("list.size = '%d'\n", (int)list.size); for (link = list.head; link; link = link->next) printf ("link->data = %d\n", (int)(intptr_t)link->data); // JSON write - int array buffer.cur = buffer.beg; ug_json_begin_write (&json, 0, &buffer); #if 1 // method 1: use UgEntry to write start of array ug_json_write_entry (&json, &list, (void*)intListEntry); #else // method 2: call ug_json_write_array_head() to write start of array ug_json_write_array_head (&json); ug_json_write_list_int (&json, &list); ug_json_write_array_tail (&json); #endif ug_json_end_write (&json); puts ("ug_json_write_list_int:"); ug_buffer_write_char (&buffer, '\0'); puts (buffer.beg); // free list ug_list_clear (&list, TRUE); ug_buffer_clear (&buffer, 1); // JSON end ug_json_final (&json); } // ---------------------------------------------------------------------------- // JSON value sample void test_json_value (void) { UgJson json; int code; #if 0 const char* json_string = "1234"; #elif 0 const char* json_string = "-100"; #elif 0 const char* json_string = "\"This is string.\""; #elif 0 const char* json_string = "\"This is"; // uncompleted string #elif 0 const char* json_string = "true"; #elif 0 const char* json_string = "tr"; // uncompleted true #elif 0 const char* json_string = "{"; // uncompleted object #else // "Sam a tűzoltó - Világcsúcs kísérletek" const char* json_string = "\"Sam a t\\u0171zolt\\u00f3 - Vil\\u00e1gcs\\u00facs k\\u00eds\\u00e9rletek\""; #endif puts ("\n--- test_json_value:"); ug_json_init (&json); ug_json_begin_parse (&json); #if 1 // debug ug_json_push (&json, json_debug_parser, NULL, NULL); #endif code = ug_json_parse (&json, json_string, -1); printf ("ug_json_parse response %d\n", code); code = ug_json_end_parse (&json); printf ("ug_json_end_parse response %d\n", code); ug_json_final (&json); } // ---------------------------------------------------------------------------- // test JSON writer void test_json_writer (void) { UgJson json; UgBuffer buffer; puts ("\n--- test_json_writer:"); ug_json_init (&json); ug_buffer_init (&buffer, 4096); ug_json_begin_write (&json, UG_JSON_FORMAT_INDENT, &buffer); // --- object1 begin ug_json_write_object_head (&json); // --- array1 begin ug_json_write_array_head (&json); ug_json_write_array_tail (&json); // --- array1 end // --- object2 begin ug_json_write_object_head (&json); ug_json_write_string (&json, "name1"); // --- array2 begin ug_json_write_array_head (&json); ug_json_write_int (&json, 1205); ug_json_write_int (&json, 2011); ug_json_write_int (&json, 1102); ug_json_write_array_tail (&json); // --- array2 end ug_json_write_string (&json, "name2"); // ug_json_write_string (&json, "value2"); ug_json_write_string (&json, "Sam a tűzoltó - Világcsúcs kísérletek"); ug_json_write_object_tail (&json); // --- object2 end ug_json_write_object_tail (&json); // --- object1 end ug_json_end_write (&json); ug_buffer_write_char (&buffer, '\0'); puts (buffer.beg); ug_buffer_clear (&buffer, 1); ug_json_final (&json); } // ---------------------------------------------------------------------------- // test UgArray void test_array (void) { UgArrayChar array; char* str = "This one is test string."; puts ("\n--- test_array:"); ug_array_init (&array, sizeof (char), 0); ug_array_append (&array, str, strlen (str)); ug_array_end0 (&array); printf ("\n" "array.at = '%s'\n" "array.length = '%d'\n" "array.allocated = '%d'\n", array.at, array.length, array.allocated); } // ---------------------------------------------------------------------------- // test main function int main (void) { SampleJs* samplejs; // g_mem_set_vtable (glib_mem_profiler_table); // test UgArray test_array (); // test JSON writer test_json_writer (); // test simple JSON value test_json_value (); // use Custom type (WorkedId) to store JSON object test_json_object_custom (); // use UgArray(int) to store JSON number array test_json_int_array (); // use UgList to store JSON string and number array test_json_array_by_list (); puts ("\n--- SampleJs functions:"); // C struct sample code: parse, print, and save file. samplejs = sample_js_new (); sample_js_parse (samplejs); sample_js_print (samplejs); sample_js_to_file (samplejs, "test-SampleJs.json"); sample_js_free (samplejs); samplejs = sample_js_new (); sample_js_reparse (samplejs); sample_js_print (samplejs); sample_js_free (samplejs); // g_mem_profile (); return 0; } uget-2.2.0/ui-gtk/0000755000175000000120000000000013224533052010645 500000000000000uget-2.2.0/ui-gtk/UgtkUtil.c0000644000175000000120000001722613224532612012512 00000000000000/* * * Copyright (C) 2005-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #include #include #include #include #if defined _WIN32 || defined _WIN64 #include #include // ShellExecuteW() #endif #if defined _WIN32 || defined _WIN64 gboolean ugtk_launch_uri (const gchar* uri) { int result; result = (int) ShellExecuteA(NULL, "open", uri, NULL, NULL, SW_SHOWNORMAL); if (result > 32) return TRUE; return FALSE; } gboolean ugtk_launch_default_app (const gchar* folder, const gchar* file) { gchar* path; gunichar2* path_wcs; if (folder == NULL) path = g_build_filename (file, NULL); else path = g_build_filename (folder, file, NULL); if (g_file_test (path, G_FILE_TEST_EXISTS) == FALSE) { g_free (path); return FALSE; } // UNICODE path_wcs = g_utf8_to_utf16 (path, -1, NULL, NULL, NULL); g_free (path); ShellExecuteW (NULL, L"open", path_wcs, NULL, NULL, SW_SHOW); g_free (path_wcs); return TRUE; } #else gboolean ugtk_launch_uri (const gchar* uri) { GError* error = NULL; g_app_info_launch_default_for_uri (uri, NULL, &error); if (error) { g_error_free (error); return FALSE; } return TRUE; } gboolean ugtk_launch_default_app (const gchar* folder, const gchar* file) { GError* error = NULL; GFile* gfile; gchar* uri; gchar* path; gchar* path_wcs; path = g_build_filename (folder, file, NULL); path_wcs = g_filename_from_utf8 (path, -1, NULL, NULL, NULL); g_free (path); if (g_file_test (path_wcs, G_FILE_TEST_EXISTS) == FALSE) { g_free (path_wcs); return FALSE; } gfile = g_file_new_for_path (path_wcs); g_free (path_wcs); uri = g_file_get_uri (gfile); g_object_unref (gfile); g_app_info_launch_default_for_uri (uri, NULL, &error); g_free (uri); if (error) { #ifndef NDEBUG g_print ("%s", error->message); #endif g_error_free (error); } return TRUE; } #endif // _WIN32 || _WIN64 // ---------------------------------------------------------------------------- // URI list functions // get URIs from text file GList* ugtk_text_file_get_uris (const gchar* file_utf8, GError** error) { GIOChannel* channel; GList* list; gchar* string; gchar* escaped; gsize line_len; string = g_filename_from_utf8 (file_utf8, -1, NULL, NULL, NULL); channel = g_io_channel_new_file (string, "r", error); g_free (string); if (channel == NULL) return NULL; ugtk_io_channel_decide_encoding (channel); list = NULL; while (g_io_channel_read_line (channel, &string, NULL, &line_len, NULL) == G_IO_STATUS_NORMAL) { if (string == NULL) continue; string[line_len] = 0; // clear '\n' in tail // check URI scheme escaped = g_uri_parse_scheme (string); if (escaped == NULL) { g_free (escaped); g_free (string); } else { g_free (escaped); // if URI is not valid UTF-8 string, escape it. if (g_utf8_validate (string, -1, NULL) == FALSE) { escaped = g_uri_escape_string (string, G_URI_RESERVED_CHARS_ALLOWED_IN_PATH, FALSE); g_free (string); string = escaped; } list = g_list_prepend (list, string); } } g_io_channel_unref (channel); return g_list_reverse (list); } // get URIs from text GList* ugtk_text_get_uris (const gchar* text) { GList* list; gchar* escaped; gchar* line; gint line_len; gint text_len; gint offset; text_len = strlen (text); list = NULL; for (offset = 0; offset < text_len; offset += line_len +1) { line_len = strcspn (text + offset, "\r\n"); line = g_strndup (text + offset, line_len); // check URI scheme escaped = g_uri_parse_scheme (line); if (escaped == NULL) { g_free (escaped); g_free (line); } else { g_free (escaped); // if URI is not valid UTF-8 string, escape it. if (g_utf8_validate (line, -1, NULL) == FALSE) { escaped = g_uri_escape_string (line, G_URI_RESERVED_CHARS_ALLOWED_IN_PATH, FALSE); g_free (line); line = escaped; } list = g_list_prepend (list, line); } } return g_list_reverse (list); } GList* ugtk_uri_list_remove_scheme (GList* list, const gchar* scheme) { GList* link; gchar* text; for (link = list; link; link = link->next) { text = g_uri_parse_scheme (link->data); if (text == NULL || strcmp (text, scheme) == 0) { g_free (link->data); link->data = NULL; } g_free (text); } return g_list_remove_all (list, NULL); } // ---------------------------------------------------------------------------- // Used by ug_io_channel_decide_encoding() // BOM = Byte Order Mark #define UG_BOM_UTF32BE "\x00\x00\xFE\xFF" #define UG_BOM_UTF32BE_LEN 4 #define UG_BOM_UTF32LE "\xFF\xFE\x00\x00" #define UG_BOM_UTF32LE_LEN 4 #define UG_BOM_UTF8 "\xEF\xBB\xBF" #define UG_BOM_UTF8_LEN 3 #define UG_BOM_UTF16BE "\xFE\xFF" #define UG_BOM_UTF16BE_LEN 2 #define UG_BOM_UTF16LE "\xFF\xFE" #define UG_BOM_UTF16LE_LEN 2 const char* ugtk_io_channel_decide_encoding (GIOChannel* channel) { gchar* encoding; gchar bom[4]; guint bom_len; // The internal encoding is always UTF-8. // set encoding NULL is safe to use with binary data. g_io_channel_set_encoding (channel, NULL, NULL); // read 4 bytes BOM (Byte Order Mark) if (g_io_channel_read_chars (channel, bom, 4, NULL, NULL) != G_IO_STATUS_NORMAL) return NULL; if (memcmp (bom, UG_BOM_UTF32BE, UG_BOM_UTF32BE_LEN) == 0) { bom_len = UG_BOM_UTF32BE_LEN; encoding = "UTF-32BE"; } else if (memcmp (bom, UG_BOM_UTF32LE, UG_BOM_UTF32LE_LEN) == 0) { bom_len = UG_BOM_UTF32LE_LEN; encoding = "UTF-32LE"; } else if (memcmp (bom, UG_BOM_UTF8, UG_BOM_UTF8_LEN) == 0) { bom_len = UG_BOM_UTF8_LEN; encoding = "UTF-8"; } else if (memcmp (bom, UG_BOM_UTF16BE, UG_BOM_UTF16BE_LEN) == 0) { bom_len = UG_BOM_UTF16BE_LEN; encoding = "UTF-16BE"; } else if (memcmp (bom, UG_BOM_UTF16LE, UG_BOM_UTF16LE_LEN) == 0) { bom_len = UG_BOM_UTF16LE_LEN; encoding = "UTF-16LE"; } else { bom_len = 0; encoding = NULL; // encoding = "UTF-8"; } // repositioned before set encoding. This flushes all the internal buffers. g_io_channel_seek_position (channel, bom_len, G_SEEK_SET, NULL); // The encoding can be set now. g_io_channel_set_encoding (channel, encoding, NULL); return encoding; } uget-2.2.0/ui-gtk/UgtkProxyForm.h0000644000175000000120000000600513224532612013540 00000000000000/* * * Copyright (C) 2005-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #ifndef UGTK_PROXY_FORM_H #define UGTK_PROXY_FORM_H #include #include #ifdef HAVE_CONFIG_H #include #endif #ifdef __cplusplus extern "C" { #endif typedef struct UgtkProxyForm UgtkProxyForm; struct UgtkProxyForm { GtkWidget* self; // top level widget GtkWidget* type; // GtkComboBox // classic // struct UgtkProxyFormStd { GtkWidget* std; // proxy server GtkWidget* host; // GtkEntry GtkWidget* port; // GtkEntry // authentication GtkWidget* user; // GtkEntry GtkWidget* password; // GtkEntry // } std; // User changed entry struct UgtkProxyFormChanged { gboolean enable:1; // UgProxyFormStd gboolean type:1; gboolean host:1; gboolean port:1; gboolean user:1; gboolean password:1; } changed; //#ifdef HAVE_LIBPWMD struct UgtkProxyFormPwmd { GtkWidget* self; GtkWidget* socket; GtkWidget* socket_args; GtkWidget* file; GtkWidget* element; // User changed entry struct UgtkProxyFormPwmdChanged { gboolean socket:1; gboolean socket_args:1; gboolean file:1; gboolean element:1; } changed; } pwmd; //#endif // HAVE_LIBPWMD }; void ugtk_proxy_form_init (UgtkProxyForm* pform); void ugtk_proxy_form_get (UgtkProxyForm* pform, UgetNode* node); void ugtk_proxy_form_set (UgtkProxyForm* pform, UgetNode* node, gboolean keep_changed); #ifdef __cplusplus } #endif #endif // End of UGTK_PROXY_FORM_H uget-2.2.0/ui-gtk/UgtkSummary.c0000644000175000000120000002233613224532612013230 00000000000000/* * * Copyright (C) 2005-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #include #include #include #include // static functions static GtkTreeView* ugtk_summary_view_new (); static void ugtk_summary_store_realloc_next (GtkListStore* store, GtkTreeIter* iter); static void ugtk_summary_menu_init (UgtkSummary* summary, GtkAccelGroup* accel_group); void ugtk_summary_init (UgtkSummary* summary, GtkAccelGroup* accel_group) { GtkScrolledWindow* scroll; summary->store = gtk_list_store_new (UGTK_SUMMARY_N_COLUMN, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING); summary->view = ugtk_summary_view_new (); gtk_tree_view_set_model (summary->view, GTK_TREE_MODEL (summary->store)); summary->self = gtk_scrolled_window_new (NULL, NULL); scroll = GTK_SCROLLED_WINDOW (summary->self); gtk_scrolled_window_set_shadow_type (scroll, GTK_SHADOW_IN); gtk_scrolled_window_set_policy (scroll, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_container_add (GTK_CONTAINER (scroll), GTK_WIDGET (summary->view)); gtk_widget_set_size_request (summary->self, 200, 90); gtk_widget_show_all (summary->self); // menu ugtk_summary_menu_init (summary, accel_group); // visible summary->visible.name = 1; summary->visible.folder = 1; summary->visible.category = 0; summary->visible.uri = 0; summary->visible.message = 1; } void ugtk_summary_show (UgtkSummary* summary, UgetNode* node) { GtkTreeIter iter; gchar* name; gchar* value; gchar* stock; union { UgetLog* log; UgetEvent* event; UgetCommon* common; } temp; if (node == NULL) { gtk_list_store_clear (summary->store); return; } iter.stamp = 0; // used by ugtk_summary_store_realloc_next() node = node->data; temp.common = ug_info_get (&node->info, UgetCommonInfo); // Summary Name if (summary->visible.name) { if (node->name) { name = g_strconcat (_("Name"), ":", NULL); value = node->name; } else { name = g_strconcat (_("File"), ":", NULL); value = (temp.common) ? temp.common->file : NULL; if (value == NULL) value = _("unnamed"); } ugtk_summary_store_realloc_next (summary->store, &iter); gtk_list_store_set (summary->store, &iter, UGTK_SUMMARY_COLUMN_ICON , GTK_STOCK_FILE, UGTK_SUMMARY_COLUMN_NAME , name, UGTK_SUMMARY_COLUMN_VALUE, value, -1); g_free (name); } // Summary Folder if (summary->visible.folder) { name = g_strconcat (_("Folder"), ":", NULL); value = (temp.common) ? temp.common->folder : NULL; ugtk_summary_store_realloc_next (summary->store, &iter); gtk_list_store_set (summary->store, &iter, UGTK_SUMMARY_COLUMN_ICON , GTK_STOCK_DIRECTORY, UGTK_SUMMARY_COLUMN_NAME , name, UGTK_SUMMARY_COLUMN_VALUE, value, -1); g_free (name); } // Summary Category if (summary->visible.category) { name = g_strconcat (_("Category"), ":", NULL); value = (node->parent) ? node->parent->name : NULL; ugtk_summary_store_realloc_next (summary->store, &iter); gtk_list_store_set (summary->store, &iter, UGTK_SUMMARY_COLUMN_ICON , GTK_STOCK_DND_MULTIPLE, UGTK_SUMMARY_COLUMN_NAME , name, UGTK_SUMMARY_COLUMN_VALUE, value, -1); g_free (name); } // Summary URL if (summary->visible.uri) { name = g_strconcat (_("URI"), ":", NULL); value = (temp.common) ? temp.common->uri : NULL; ugtk_summary_store_realloc_next (summary->store, &iter); gtk_list_store_set (summary->store, &iter, UGTK_SUMMARY_COLUMN_ICON , GTK_STOCK_NETWORK, UGTK_SUMMARY_COLUMN_NAME , name, UGTK_SUMMARY_COLUMN_VALUE, value, -1); g_free (name); } // Summary Message temp.log = ug_info_get (&node->info, UgetLogInfo); if (temp.log) temp.event = (UgetEvent*) temp.log->messages.head; if (summary->visible.message) { if (temp.event == NULL) { stock = GTK_STOCK_INFO; value = NULL; } else { value = temp.event->string; switch (temp.event->type) { case UGET_EVENT_ERROR: stock = GTK_STOCK_DIALOG_ERROR; break; case UGET_EVENT_WARNING: stock = GTK_STOCK_DIALOG_WARNING; break; default: stock = GTK_STOCK_INFO; break; } } name = g_strconcat (_("Message"), ":", NULL); ugtk_summary_store_realloc_next (summary->store, &iter); gtk_list_store_set (summary->store, &iter, UGTK_SUMMARY_COLUMN_ICON , stock, UGTK_SUMMARY_COLUMN_NAME , name, UGTK_SUMMARY_COLUMN_VALUE, value, -1); } // clear remaining rows if (gtk_tree_model_iter_next (GTK_TREE_MODEL (summary->store), &iter)) { while (gtk_list_store_remove (summary->store, &iter)) continue; } } gchar* ugtk_summary_get_text_selected (UgtkSummary* summary) { GtkTreeModel* model; GtkTreePath* path; GtkTreeIter iter; gchar* name; gchar* value; gtk_tree_view_get_cursor (summary->view, &path, NULL); if (path == NULL) return NULL; model = GTK_TREE_MODEL (summary->store); gtk_tree_model_get_iter (model, &iter, path); gtk_tree_path_free (path); gtk_tree_model_get (model, &iter, UGTK_SUMMARY_COLUMN_NAME , &name, UGTK_SUMMARY_COLUMN_VALUE, &value, -1); return g_strconcat (name, " ", value, NULL); } gchar* ugtk_summary_get_text_all (UgtkSummary* summary) { GtkTreeModel* model; GtkTreeIter iter; gchar* name; gchar* value; gboolean valid; GString* gstr; gstr = g_string_sized_new (60); model = GTK_TREE_MODEL (summary->store); valid = gtk_tree_model_get_iter_first (model, &iter); while (valid) { gtk_tree_model_get (model, &iter, UGTK_SUMMARY_COLUMN_NAME , &name, UGTK_SUMMARY_COLUMN_VALUE, &value, -1); valid = gtk_tree_model_iter_next (model, &iter); // string g_string_append (gstr, name); if (value) { g_string_append_c (gstr, ' '); g_string_append (gstr, value); } g_string_append_c (gstr, '\n'); } return g_string_free (gstr, FALSE); } // ---------------------------------------------------------------------------- // UgtkSummary static functions // static GtkTreeView* ugtk_summary_view_new () { GtkTreeView* view; GtkCellRenderer* renderer; view = (GtkTreeView*) gtk_tree_view_new (); gtk_tree_view_set_headers_visible (view, FALSE); // columns renderer = gtk_cell_renderer_pixbuf_new (); gtk_tree_view_insert_column_with_attributes ( view, UGTK_SUMMARY_COLUMN_ICON, NULL, renderer, "stock-id", UGTK_SUMMARY_COLUMN_ICON, NULL); renderer = gtk_cell_renderer_text_new (); gtk_tree_view_insert_column_with_attributes ( view, UGTK_SUMMARY_COLUMN_NAME, _("Item"), renderer, "text", UGTK_SUMMARY_COLUMN_NAME, NULL); gtk_tree_view_insert_column_with_attributes ( view, UGTK_SUMMARY_COLUMN_VALUE, _("Value"), renderer, "text", UGTK_SUMMARY_COLUMN_VALUE, NULL); return view; } static void ugtk_summary_store_realloc_next (GtkListStore* store, GtkTreeIter* iter) { GtkTreeModel* model; model = GTK_TREE_MODEL (store); if (iter->stamp == 0) { if (gtk_tree_model_get_iter_first (model, iter) == FALSE) gtk_list_store_append (store, iter); } else if (gtk_tree_model_iter_next (model, iter) == FALSE) gtk_list_store_append (store, iter); } static void ugtk_summary_menu_init (UgtkSummary* summary, GtkAccelGroup* accel_group) { GtkWidget* image; GtkWidget* menu; GtkWidget* menu_item; // UgtkSummary.menu menu = gtk_menu_new (); // Copy menu_item = gtk_image_menu_item_new_from_stock (GTK_STOCK_COPY, accel_group); gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item); summary->menu.copy = menu_item; // Copy All menu_item = gtk_image_menu_item_new_with_mnemonic (_("Copy _All")); image = gtk_image_new_from_stock (GTK_STOCK_SELECT_ALL, GTK_ICON_SIZE_MENU); gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_item), image); gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item); summary->menu.copy_all = menu_item; gtk_widget_show_all (menu); summary->menu.self = GTK_MENU (menu); } uget-2.2.0/ui-gtk/UgtkUtil.h0000644000175000000120000000506013224532612012510 00000000000000/* * * Copyright (C) 2005-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #ifndef UGTK_UTIL_H #define UGTK_UTIL_H #include //#include #ifdef __cplusplus extern "C" { #endif // ------------------------------------------------------------------ // URI list functions // To get URIs from text file, error is G_FILE_ERROR. GList* ugtk_text_file_get_uris (const gchar* file_utf8, GError** error); // get URIs from text GList* ugtk_text_get_uris (const gchar* text); // remove URIs from list by scheme GList* ugtk_uri_list_remove_scheme (GList* uris, const gchar* scheme); // ------------------------------------------------------------------ // check BOM in file header and set it's encoding. // return encoding string. const char* ugtk_io_channel_decide_encoding (GIOChannel* channel); // ------------------------------------------------------------------ // others // gboolean ugtk_launch_uri (const gchar* uri); gboolean ugtk_launch_default_app (const gchar* folder, const gchar* file); #ifdef __cplusplus } #endif #endif // UGTK_UTIL_H uget-2.2.0/ui-gtk/UgtkApp.h0000644000175000000120000002200713224532612012313 00000000000000/* * * Copyright (C) 2012-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #ifndef UGTK_APP_H #define UGTK_APP_H #include #include #include #include #include #include #include #include #include #include #ifdef __cplusplus extern "C" { #endif #define UGTK_APP_DIR "uGet" #define UGTK_APP_NAME "uGet" #define UGTK_APP_ICON_NAME "uget-icon" #define UGTK_APP_ACCEL_PATH_NEW "/File/New" #define UGTK_APP_ACCEL_PATH_LOAD "/File/Load" #define UGTK_APP_ACCEL_PATH_SAVE "/File/Save" #define UGTK_APP_ACCEL_PATH_SAVE_ALL "/File/SaveAll" #define UGTK_APP_ACCEL_PATH_DELETE "/Download/Delete" #define UGTK_APP_ACCEL_PATH_DELETE_F "/Download/DeleteFile" #define UGTK_APP_ACCEL_PATH_OPEN "/Download/Open" #define UGTK_APP_ACCEL_PATH_OPEN_F "/Download/OpenFolder" #define UGTK_APP_ACCEL_PATH_SWITCH "/Download/SwitchState" typedef struct UgtkApp UgtkApp; struct UgtkApp { UGET_APP_MEMBERS; // UgetNode real; // root node for real category // UgetNode split; // UgetNode sorted; // UgetNode sorted_split; // UgetNode mix; // UgetNode mix_split; // UgRegistry infos; // UgRegistry plugins; // UgetPluginInfo* plugin; // UgetTask task; // UgArrayPtr nodes; // void* uri_hash; // char* config_dir; // int n_error; // these n_xxxx increase by grow() // int n_moved; // int n_deleted; // int n_completed; UgetRpc* rpc; UgtkSetting setting; UgtkScheduleState schedule_state; // recent download settings struct { UgetNode* infonode; int category_index; int saved; } recent; // status gboolean user_action; // RSS UgetRss* rss_builtin; // Built-in RSS // Clipboard struct UgtkClipboard { GtkClipboard* self; gchar* text; GRegex* regex; gboolean processing; // monitor storage or media website gboolean website; } clipboard; // dialogs struct UgtkDialogs { GtkWidget* error; GtkWidget* message; GtkWidget* exit_confirmation; GtkWidget* delete_confirmation; GtkWidget* delete_category_confirmation; GtkWidget* setting; } dialogs; // ------------------------------------------------------- // GUI: Main Window and Tray Icon GtkAccelGroup* accel_group; UgtkTrayIcon trayicon; UgtkBanner banner; UgtkMenubar menubar; UgtkSummary summary; UgtkTraveler traveler; // (UgetNode) node traveler // -------------------------------- // Main Window (initialize in UgtkApp-ui.c) struct UgtkWindow { GtkWindow* self; GtkPaned* hpaned; // separate left side and right side GtkPaned* vpaned; // right side (UgtkTreeView and UgtkSummary) } window; // -------------------------------- // status bar (initialize in UgtkApp-ui.c) struct UgtkStatusbar { GtkStatusbar* self; GtkLabel* down_speed; GtkLabel* up_speed; } statusbar; // -------------------------------- // Toolbar (initialize in UgtkApp-ui.c) struct UgtkToolbar { GtkWidget* self; // GtkBox GtkWidget* toolbar; // GtkToolItem GtkWidget* create; // GtkMenuItem // menu for tool button GtkWidget* create_download; GtkWidget* create_category; GtkWidget* create_clipboard; GtkWidget* create_sequence; GtkWidget* create_torrent; GtkWidget* create_metalink; // GtkToolItem GtkWidget* save; GtkWidget* runnable; GtkWidget* pause; GtkWidget* properties; GtkWidget* move_up; GtkWidget* move_down; GtkWidget* move_top; GtkWidget* move_bottom; } toolbar; }; void ugtk_app_init (UgtkApp* app, UgetRpc* ipc); void ugtk_app_final (UgtkApp* app); // UgtkApp-ui.c, UgtkApp-callback.c, and UgtkApp-timeout.c void ugtk_app_init_ui (UgtkApp* app); void ugtk_app_init_callback (UgtkApp* app); void ugtk_app_init_timeout (UgtkApp* app); void ugtk_app_save (UgtkApp* app); void ugtk_app_load (UgtkApp* app); void ugtk_app_quit (UgtkApp* app); // set UgtkSetting from/to UgtkApp void ugtk_app_get_window_setting (UgtkApp* app, UgtkSetting* setting); void ugtk_app_set_window_setting (UgtkApp* app, UgtkSetting* setting); void ugtk_app_get_column_setting (UgtkApp* app, UgtkSetting* setting); void ugtk_app_set_column_setting (UgtkApp* app, UgtkSetting* setting); void ugtk_app_set_plugin_setting (UgtkApp* app, UgtkSetting* setting); void ugtk_app_set_other_setting (UgtkApp* app, UgtkSetting* setting); void ugtk_app_set_menu_setting (UgtkApp* app, UgtkSetting* setting); void ugtk_app_set_ui_setting (UgtkApp* app, UgtkSetting* setting); // decide sensitive or visible void ugtk_app_decide_download_sensitive (UgtkApp* app); void ugtk_app_decide_category_sensitive (UgtkApp* app); void ugtk_app_decide_trayicon_visible (UgtkApp* app); void ugtk_app_decide_to_quit (UgtkApp* app); // create node by UI void ugtk_app_create_category (UgtkApp* app); void ugtk_app_create_download (UgtkApp* app, const char* sub_title, const char* uri); // delete selected node void ugtk_app_delete_category (UgtkApp* app); void ugtk_app_delete_download (UgtkApp* app, gboolean delete_files); // edit selected node void ugtk_app_edit_category (UgtkApp* app); void ugtk_app_edit_download (UgtkApp* app); // queue/pause void ugtk_app_queue_download (UgtkApp* app, gboolean keep_active); void ugtk_app_pause_download (UgtkApp* app); void ugtk_app_switch_download_state (UgtkApp* app); // move selected node void ugtk_app_move_download_up (UgtkApp* app); void ugtk_app_move_download_down (UgtkApp* app); void ugtk_app_move_download_top (UgtkApp* app); void ugtk_app_move_download_bottom (UgtkApp* app); void ugtk_app_move_download_to (UgtkApp* app, UgetNode* cnode); // torrent & metalink void ugtk_app_create_torrent (UgtkApp* app); void ugtk_app_create_metalink (UgtkApp* app); // import/export void ugtk_app_save_category (UgtkApp* app); void ugtk_app_load_category (UgtkApp* app); void ugtk_app_import_html_file (UgtkApp* app); void ugtk_app_import_text_file (UgtkApp* app); void ugtk_app_export_text_file (UgtkApp* app); // batch void ugtk_app_sequence_batch (UgtkApp* app); void ugtk_app_clipboard_batch (UgtkApp* app); int ugtk_app_filter_existing (UgtkApp* app, GList* uris); // emit signal "row-changed" for UgtkNodeTree and UgtkNodeList void ugtk_app_download_changed (UgtkApp* app, UgetNode* dnode); void ugtk_app_category_changed (UgtkApp* app, UgetNode* cnode); void ugtk_app_add_default_category (UgtkApp* app); void ugtk_app_show_message (UgtkApp* app, GtkMessageType type, const gchar* message); // -------------------------------------------------------- // UgClipboard void ugtk_clipboard_init (struct UgtkClipboard* clipboard, const gchar* pattern); void ugtk_clipboard_set_pattern (struct UgtkClipboard* clipboard, const gchar* pattern); void ugtk_clipboard_set_text (struct UgtkClipboard* clipboard, gchar* text); GList* ugtk_clipboard_get_uris (struct UgtkClipboard* clipboard); GList* ugtk_clipboard_get_matched (struct UgtkClipboard* clipboard, const gchar* text); // -------------------------------------------------------- // UgStatusbar void ugtk_statusbar_set_info (struct UgtkStatusbar* statusbar, gint n_selected); void ugtk_statusbar_set_speed (struct UgtkStatusbar* statusbar, gint64 down_speed, gint64 up_speed); #ifdef __cplusplus } #endif #endif // UGTK_APP_H uget-2.2.0/ui-gtk/UgtkCategoryForm.c0000644000175000000120000002407513224532612014176 00000000000000/* * * Copyright (C) 2005-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #ifdef _MSC_VER #define _CRT_SECURE_NO_WARNINGS #endif #include #include #include #include static gchar* string_from_ug_array (UgArrayStr* uarray); static void string_to_ug_array (const gchar* string, UgArrayStr* uarray); void ugtk_category_form_init (UgtkCategoryForm* cform) { GtkWidget* label; GtkWidget* entry; GtkGrid* top_grid; GtkGrid* grid; GtkWidget* widget; cform->self = gtk_grid_new (); top_grid = (GtkGrid*) cform->self; gtk_container_set_border_width (GTK_CONTAINER (top_grid), 2); label = gtk_label_new_with_mnemonic (_("Category _name:")); entry = gtk_entry_new (); gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE); gtk_label_set_mnemonic_widget (GTK_LABEL (label), entry); g_object_set (label, "margin", 2, NULL); g_object_set (entry, "margin", 2, "hexpand", TRUE, NULL); gtk_grid_attach (top_grid, label, 0, 0, 1, 1); gtk_grid_attach (top_grid, entry, 1, 0, 1, 1); cform->name_entry = entry; cform->name_label = label; // ------------------------------------------------------------------------ // Capacity grid = (GtkGrid*) gtk_grid_new (); g_object_set (grid, "margin-top", 2, "margin-bottom", 2, NULL); gtk_grid_attach (top_grid, GTK_WIDGET (grid), 0, 1, 2, 1); cform->spin_active = gtk_spin_button_new_with_range (1.0, 20.0, 1.0); gtk_entry_set_activates_default (GTK_ENTRY (cform->spin_active), TRUE); // gtk_entry_set_width_chars (GTK_ENTRY(cform->spin_active), 5); label = gtk_label_new_with_mnemonic (_("Active _downloads:")); gtk_label_set_mnemonic_widget (GTK_LABEL(label), cform->spin_active); g_object_set (label, "margin", 2, NULL); g_object_set (cform->spin_active, "margin-top", 2, "margin-bottom", 2, NULL); gtk_grid_attach (grid, label, 0, 0, 1, 1); gtk_grid_attach (grid, cform->spin_active, 1, 0, 1, 1); cform->spin_finished = gtk_spin_button_new_with_range (0.0, 99999.0, 1.0); gtk_entry_set_activates_default (GTK_ENTRY (cform->spin_finished), TRUE); // gtk_entry_set_width_chars (GTK_ENTRY(cform->spin_finished), 5); label = gtk_label_new_with_mnemonic (_("Capacity of Finished:")); gtk_label_set_mnemonic_widget (GTK_LABEL(label), cform->spin_finished); g_object_set (label, "margin", 2, NULL); g_object_set (cform->spin_finished, "margin-top", 2, "margin-bottom", 2, NULL); gtk_grid_attach (grid, label, 0, 1, 1, 1); gtk_grid_attach (grid, cform->spin_finished, 1, 1, 1, 1); cform->spin_recycled = gtk_spin_button_new_with_range (0.0, 99999.0, 1.0); gtk_entry_set_activates_default (GTK_ENTRY (cform->spin_recycled), TRUE); // gtk_entry_set_width_chars (GTK_ENTRY(cform->spin_recycled), 5); label = gtk_label_new_with_mnemonic (_("Capacity of Recycled:")); gtk_label_set_mnemonic_widget (GTK_LABEL(label), cform->spin_recycled); g_object_set (label, "margin", 2, NULL); g_object_set (cform->spin_recycled, "margin-top", 2, "margin-bottom", 2, NULL); gtk_grid_attach (grid, label, 0, 2, 1, 1); gtk_grid_attach (grid, cform->spin_recycled, 1, 2, 1, 1); // ------------------------------------------------------------------------ // URI Matching conditions widget = gtk_frame_new (_("URI Matching conditions")); g_object_set (grid, "margin-top", 4, "margin-bottom", 4, NULL); gtk_grid_attach (top_grid, widget, 0, 2, 2, 1); grid = (GtkGrid*) gtk_grid_new (); g_object_set (grid, "margin-top", 2, "margin-bottom", 2, NULL); gtk_container_add (GTK_CONTAINER (widget), (GtkWidget*) grid); label = gtk_label_new_with_mnemonic (_("Matched _Hosts:")); entry = gtk_entry_new (); gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE); gtk_label_set_mnemonic_widget (GTK_LABEL (label), entry); g_object_set (label, "margin", 2, NULL); g_object_set (entry, "margin", 2, "hexpand", TRUE, NULL); gtk_grid_attach (grid, label, 0, 0, 1, 1); gtk_grid_attach (grid, entry, 1, 0, 1, 1); cform->hosts_entry = entry; cform->hosts_label = label; label = gtk_label_new_with_mnemonic (_("Matched _Schemes:")); entry = gtk_entry_new (); gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE); gtk_label_set_mnemonic_widget (GTK_LABEL (label), entry); g_object_set (label, "margin", 2, NULL); g_object_set (entry, "margin", 2, "hexpand", TRUE, NULL); gtk_grid_attach (grid, label, 0, 1, 1, 1); gtk_grid_attach (grid, entry, 1, 1, 1, 1); cform->schemes_entry = entry; cform->schemes_label = label; label = gtk_label_new_with_mnemonic (_("Matched _Types:")); entry = gtk_entry_new (); gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE); gtk_label_set_mnemonic_widget (GTK_LABEL (label), entry); g_object_set (label, "margin", 2, NULL); g_object_set (entry, "margin", 2, "hexpand", TRUE, NULL); gtk_grid_attach (grid, label, 0, 2, 1, 1); gtk_grid_attach (grid, entry, 1, 2, 1, 1); cform->types_entry = entry; cform->types_label = label; gtk_widget_show_all (GTK_WIDGET (top_grid)); } void ugtk_category_form_get (UgtkCategoryForm* cform, UgetNode* cnode) { UgetCategory* category; const gchar* text; category = ug_info_realloc (&cnode->info, UgetCategoryInfo); if (gtk_widget_is_sensitive (cform->name_entry) == TRUE) { text = gtk_entry_get_text ((GtkEntry*) cform->name_entry); ug_free (cnode->name); cnode->name = (*text) ? ug_strdup (text) : NULL; } category->active_limit = gtk_spin_button_get_value_as_int ( (GtkSpinButton*) cform->spin_active); // Finished category->finished_limit = gtk_spin_button_get_value_as_int ( (GtkSpinButton*) cform->spin_finished); // Recycled category->recycled_limit = gtk_spin_button_get_value_as_int ( (GtkSpinButton*) cform->spin_recycled); // matching - clear ug_array_foreach_str (&category->hosts, (UgForeachFunc) ug_free, NULL); ug_array_foreach_str (&category->schemes, (UgForeachFunc) ug_free, NULL); ug_array_foreach_str (&category->file_exts, (UgForeachFunc) ug_free, NULL); category->hosts.length = 0; category->schemes.length = 0; category->file_exts.length = 0; // matching - set string_to_ug_array (gtk_entry_get_text ((GtkEntry*) cform->hosts_entry), &category->hosts); string_to_ug_array (gtk_entry_get_text ((GtkEntry*) cform->schemes_entry), &category->schemes); string_to_ug_array (gtk_entry_get_text ((GtkEntry*) cform->types_entry), &category->file_exts); } void ugtk_category_form_set (UgtkCategoryForm* cform, UgetNode* cnode) { UgetCategory* category; gchar* str; category = ug_info_realloc (&cnode->info, UgetCategoryInfo); if (gtk_widget_is_sensitive (cform->name_entry) == TRUE) { gtk_entry_set_text ((GtkEntry*) cform->name_entry, (cnode->name) ? cnode->name : ""); } gtk_spin_button_set_value ((GtkSpinButton*) cform->spin_active, (gdouble) category->active_limit); // Finished gtk_spin_button_set_value ((GtkSpinButton*) cform->spin_finished, (gdouble) category->finished_limit); // Recycled gtk_spin_button_set_value ((GtkSpinButton*) cform->spin_recycled, (gdouble) category->recycled_limit); // matching str = string_from_ug_array (&category->hosts); gtk_entry_set_text ((GtkEntry*) cform->hosts_entry, str); g_free (str); str = string_from_ug_array (&category->schemes); gtk_entry_set_text ((GtkEntry*) cform->schemes_entry, str); g_free (str); str = string_from_ug_array (&category->file_exts); gtk_entry_set_text ((GtkEntry*) cform->types_entry, str); g_free (str); } void ugtk_category_form_set_multiple (UgtkCategoryForm* cform, gboolean multiple_mode) { if (multiple_mode) { gtk_widget_hide (cform->name_entry); gtk_widget_hide (cform->name_label); gtk_widget_set_sensitive (cform->name_entry, FALSE); gtk_widget_set_sensitive (cform->name_label, FALSE); } else { gtk_widget_show (cform->name_entry); gtk_widget_show (cform->name_label); gtk_widget_set_sensitive (cform->name_entry, TRUE); gtk_widget_set_sensitive (cform->name_label, TRUE); } } // ---------------------------------------------------------------------------- // static function static gchar* string_from_ug_array (UgArrayStr* uarray) { int index, length; char* buffer; for (length = 0, index = 0; index < uarray->length; index++) length += strlen(uarray->at[index]) + 1; // + ';' buffer = g_malloc (length + 1); buffer[0] = 0; for (index = 0; index < uarray->length; index++) { strcat (buffer, uarray->at[index]); strcat (buffer, ";"); } return buffer; } static void string_to_ug_array (const gchar* string, UgArrayStr* uarray) { const gchar* cur; const gchar* prev; for (prev = string, cur = string; ; cur++) { if ((cur[0] == ';' || cur[0] == 0) && cur != prev) { *(char**)ug_array_alloc (uarray, 1) = ug_strndup (prev, cur - prev); prev = cur + 1; } if (cur[0] == 0) break; } } uget-2.2.0/ui-gtk/UgtkSettingDialog.h0000644000175000000120000000616513224532612014337 00000000000000/* * * Copyright (C) 2005-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #ifndef UGTK_SETTING_DIALOG_H #define UGTK_SETTING_DIALOG_H #include #include #include #include #ifdef __cplusplus extern "C" { #endif typedef struct UgtkSettingDialog UgtkSettingDialog; typedef enum { UGTK_SETTING_PAGE_UI, UGTK_SETTING_PAGE_CLIPBOARD, UGTK_SETTING_PAGE_OTHERS, } UgtkSettingDialogPage; struct UgtkSettingDialog { GtkDialog* self; UgtkApp* app; GtkTreeView* tree_view; GtkListStore* list_store; GtkNotebook* notebook; struct UgtkUserInterfaceForm ui; struct UgtkClipboardForm clipboard; struct UgtkBandwidthForm bandwidth; struct UgtkCompletionForm completion; struct UgtkAutoSaveForm auto_save; struct UgtkScheduleForm scheduler; struct UgtkCommandlineForm commandline; struct UgtkPluginForm plugin; struct UgtkMediaWebsiteForm media_website; }; UgtkSettingDialog* ugtk_setting_dialog_new (); void ugtk_setting_dialog_free (UgtkSettingDialog* sdialog); void ugtk_setting_dialog_run (UgtkSettingDialog* dialog, UgtkApp* app); void ugtk_setting_dialog_set (UgtkSettingDialog* dialog, UgtkSetting* setting); void ugtk_setting_dialog_get (UgtkSettingDialog* dialog, UgtkSetting* setting); void ugtk_setting_dialog_add (UgtkSettingDialog* sdialog, const gchar* title, GtkWidget* page); void ugtk_setting_dialog_set_page (UgtkSettingDialog* sdialog, int nth); #ifdef __cplusplus } #endif #endif // End of UGTK_SETTING_DIALOG_H uget-2.2.0/ui-gtk/Makefile.am0000644000175000000120000000337013203310772012623 00000000000000bin_PROGRAMS = uget-gtk uget_gtk_CPPFLAGS = \ -DUG_DATADIR='"$(datadir)"' \ -I$(top_srcdir)/ui-gtk \ -I$(top_srcdir)/uget \ -I$(top_srcdir)/uglib uget_gtk_CFLAGS = \ @PTHREAD_CFLAGS@ \ @LFS_CFLAGS@ \ @CURL_CFLAGS@ \ @LIBGCRYPT_CFLAGS@ \ @LIBCRYPTO_CFLAGS@ \ @GTK_CFLAGS@ \ @LIBNOTIFY_CFLAGS@ \ @APP_INDICATOR_CFLAGS@ \ @GSTREAMER_CFLAGS@ \ @LIBPWMD_CFLAGS@ uget_gtk_LDFLAGS = @LFS_LDFLAGS@ uget_gtk_LDADD = \ $(top_builddir)/uget/libuget.a \ $(top_builddir)/uglib/libuglib.a \ @PTHREAD_LIBS@ \ @CURL_LIBS@ \ @LIBGCRYPT_LIBS@ \ @LIBCRYPTO_LIBS@ \ @GTK_LIBS@ \ @LIBNOTIFY_LIBS@ \ @APP_INDICATOR_LIBS@ \ @GSTREAMER_LIBS@ \ @LIBPWMD_LIBS@ uget_gtk_SOURCES = \ UgtkUtil.c UgtkConfig.c UgtkSetting.c \ UgtkNodeList.c UgtkNodeTree.c UgtkNodeView.c \ UgtkTraveler.c UgtkSummary.c \ UgtkTrayIcon.c UgtkBanner.c \ UgtkSequence.c UgtkSelector.c \ UgtkProxyForm.c UgtkDownloadForm.c UgtkCategoryForm.c \ UgtkNodeDialog.c UgtkBatchDialog.c \ UgtkScheduleForm.c UgtkSettingForm.c UgtkSettingDialog.c \ UgtkConfirmDialog.c UgtkAboutDialog.c \ UgtkMenubar.c UgtkMenubar-ui.c \ UgtkApp.c UgtkApp-ui.c UgtkApp-callback.c \ UgtkApp-timeout.c UgtkApp-main.c noinst_HEADERS = \ UgtkUtil.h UgtkConfig.h UgtkSetting.h \ UgtkNodeList.h UgtkNodeTree.h UgtkNodeView.h \ UgtkTraveler.h UgtkSummary.h \ UgtkTrayIcon.h UgtkBanner.h \ UgtkSequence.h UgtkSelector.h \ UgtkProxyForm.h UgtkDownloadForm.h UgtkCategoryForm.h \ UgtkNodeDialog.h UgtkBatchDialog.h \ UgtkScheduleForm.h UgtkSettingForm.h UgtkSettingDialog.h \ UgtkConfirmDialog.h UgtkAboutDialog.h \ UgtkMenubar.h \ UgtkApp.h uget-2.2.0/ui-gtk/UgtkNodeList.h0000644000175000000120000000623713224532612013323 00000000000000/* * * Copyright (C) 2012-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ /* * This file base on GTK+ 2.0 Tree View Tutorial - custom-list.h */ #ifndef UGTK_NODE_LIST_H #define UGTK_NODE_LIST_H #include #include #ifdef __cplusplus extern "C" { #endif #define UGTK_TYPE_NODE_LIST (ugtk_node_list_get_type ()) #define UGTK_NODE_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UGTK_TYPE_NODE_LIST, UgtkNodeList)) #define UGTK_NODE_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UGTK_TYPE_NODE_LIST, UgtkNodeListClass)) #define UGTK_IS_NODE_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UGTK_TYPE_NODE_LIST)) #define UGTK_IS_NODE_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UGTK_TYPE_NODE_LIST)) #define UGTK_NODE_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UGTK_TYPE_NODE_LIST, UgtkNodeListClass)) typedef struct UgtkNodeList UgtkNodeList; typedef struct UgtkNodeListClass UgtkNodeListClass; // ---------------------------------------------------------------------------- // UgtkNodeList : GtkTreeModel for UgetNode real and fake nodes. struct UgtkNodeList { GObject parent; // this MUST be the first member UgetNode* root; gint stamp; // Random integer to check whether an iter belongs to our model gint n_fake; gboolean root_visible; // show root as first item }; // ------------------------------------ struct UgtkNodeListClass { GObjectClass parent_class; }; UgtkNodeList* ugtk_node_list_new (UgetNode* root, gint n_fake, gboolean root_visible); GType ugtk_node_list_get_type (void); #ifdef __cplusplus } #endif #endif // UGTK_NODE_LIST_H uget-2.2.0/ui-gtk/UgtkApp.c0000644000175000000120000017515713224532612012325 00000000000000/* * * Copyright (C) 2012-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void ugtk_app_init (UgtkApp* app, UgetRpc* rpc) { char* dir; app->rpc = rpc; uget_app_init ((UgetApp*) app); // set application config directory for each user dir = g_build_filename (ugtk_get_config_dir (), UGTK_APP_DIR, NULL); uget_app_set_config_dir ((UgetApp*) app, dir); g_free (dir); app->rss_builtin = uget_rss_new (); ugtk_app_load (app); ugtk_app_init_ui (app); ugtk_app_init_callback (app); if (app->real.n_children == 0) ugtk_app_add_default_category (app); // clipboard ugtk_clipboard_init (&app->clipboard, app->setting.clipboard.pattern); // plug-in initialize uget_plugin_set (UgetPluginCurlInfo, UGET_PLUGIN_INIT, (void*) TRUE); uget_plugin_set (UgetPluginAria2Info, UGET_PLUGIN_INIT, (void*) TRUE); uget_plugin_set (UgetPluginMediaInfo, UGET_PLUGIN_INIT, (void*) TRUE); uget_plugin_set (UgetPluginMegaInfo, UGET_PLUGIN_INIT, (void*) TRUE); // apply UgtkSetting ugtk_app_set_plugin_setting (app, &app->setting); ugtk_app_set_window_setting (app, &app->setting); ugtk_app_set_column_setting (app, &app->setting); ugtk_app_set_other_setting (app, &app->setting); ugtk_app_set_ui_setting (app, &app->setting); ugtk_tray_icon_set_info (&app->trayicon, 0, 0, 0); ugtk_statusbar_set_speed (&app->statusbar, 0, 0); ugtk_menubar_sync_category (&app->menubar, app, TRUE); app->recent.category_index = 0; app->recent.infonode = uget_node_new (NULL); // RSS uget_rss_add_builtin (app->rss_builtin, UGET_RSS_STABLE); uget_rss_add_builtin (app->rss_builtin, UGET_RSS_NEWS); uget_rss_add_builtin (app->rss_builtin, UGET_RSS_TUTORIALS); uget_rss_update (app->rss_builtin, FALSE); gtk_widget_hide (app->banner.self); uget_app_use_uri_hash ((UgetApp*) app); ugtk_app_init_timeout (app); if (app->setting.ui.start_in_tray) ugtk_tray_icon_set_visible (&app->trayicon, TRUE); else gtk_widget_show ((GtkWidget*) app->window.self); // offline if (app->setting.ui.start_in_offline_mode) g_signal_emit_by_name (app->menubar.file.offline_mode, "activate"); } void ugtk_app_final (UgtkApp* app) { int shutdown_now; uget_app_set_notification ((UgetApp*) app, NULL, NULL, NULL, NULL); if (app->setting.plugin_order >= UGTK_PLUGIN_ORDER_ARIA2) shutdown_now = app->setting.aria2.shutdown; else shutdown_now = FALSE; uget_rss_unref (app->rss_builtin); uget_app_final ((UgetApp*) app); // plug-in finalize uget_plugin_set (UgetPluginAria2Info, UGET_PLUGIN_ARIA2_SHUTDOWN_NOW, (void*)(intptr_t) shutdown_now); uget_plugin_set (UgetPluginCurlInfo, UGET_PLUGIN_INIT, (void*) FALSE); uget_plugin_set (UgetPluginAria2Info, UGET_PLUGIN_INIT, (void*) FALSE); uget_plugin_set (UgetPluginMediaInfo, UGET_PLUGIN_INIT, (void*) FALSE); uget_plugin_set (UgetPluginMegaInfo, UGET_PLUGIN_INIT, (void*) FALSE); } void ugtk_app_save (UgtkApp* app) { gchar* file; if (app->config_dir == NULL) return; ug_create_dir_all (app->config_dir, -1); file = g_build_filename (app->config_dir, "Setting.json", NULL); ugtk_setting_save (&app->setting, file); g_free (file); // RSS file = g_build_filename (app->config_dir, "RSS-built-in.json", NULL); uget_rss_save_feeds (app->rss_builtin, file); g_free (file); // uget_app_save_categories ((UgetApp*) app, ugtk_get_config_dir ()); uget_app_save_categories ((UgetApp*) app, NULL); } void ugtk_app_load (UgtkApp* app) { int counts; gchar* file; // load setting ugtk_setting_init (&app->setting); file = g_build_filename (app->config_dir, "Setting.json", NULL); counts = ugtk_setting_load (&app->setting, file); g_free (file); if (counts == FALSE) ugtk_setting_reset (&app->setting); else if (app->setting.scheduler.state.length < 7*24) { ug_array_alloc (&app->setting.scheduler.state, 7*24 - app->setting.scheduler.state.length); } // RSS file = g_build_filename (app->config_dir, "RSS-built-in.json", NULL); uget_rss_load_feeds (app->rss_builtin, file); g_free (file); // uget_app_load_categories ((UgetApp*) app, ugtk_get_config_dir ()); counts = uget_app_load_categories ((UgetApp*) app, NULL); if (counts == 0) ugtk_app_add_default_category (app); } void ugtk_app_quit (UgtkApp* app) { // stop all tasks uget_task_remove_all (&app->task); // sync setting and save data ugtk_app_get_window_setting (app, &app->setting); ugtk_app_get_column_setting (app, &app->setting); ugtk_app_save (app); // clear plug-in uget_app_clear_plugins ((UgetApp*) app); // hide icon in system tray before quit ugtk_tray_icon_set_visible (&app->trayicon, FALSE); // hide window gtk_widget_hide (GTK_WIDGET (app->window.self)); gtk_main_quit (); } void ugtk_app_get_window_setting (UgtkApp* app, UgtkSetting* setting) { GdkWindowState gdk_wstate; GdkWindow* gdk_window; gint x, y; // get window position, size, and maximized state if (gtk_widget_get_visible (GTK_WIDGET (app->window.self)) == TRUE) { gdk_window = gtk_widget_get_window (GTK_WIDGET (app->window.self)); gdk_wstate = gdk_window_get_state (gdk_window); if (gdk_wstate & GDK_WINDOW_STATE_MAXIMIZED) setting->window.maximized = TRUE; else setting->window.maximized = FALSE; // get geometry if (setting->window.maximized == FALSE) { gtk_window_get_position (app->window.self, &x, &y); gtk_window_get_size (app->window.self, &setting->window.width, &setting->window.height); // gtk_window_get_position() may return: x == -32000, y == -32000 if (x + app->setting.window.width > 0) setting->window.x = x; if (y + app->setting.window.height > 0) setting->window.y = y; } } // GtkPaned position if (app->setting.window.category) setting->window.paned_position_h = gtk_paned_get_position (app->window.hpaned); if (app->setting.window.summary) setting->window.paned_position_v = gtk_paned_get_position (app->window.vpaned); // banner setting->window.banner = gtk_widget_get_visible (app->banner.self); // traveler setting->window.nth_category = app->traveler.category.cursor.pos; setting->window.nth_state = app->traveler.state.cursor.pos; } void ugtk_app_set_window_setting (UgtkApp* app, UgtkSetting* setting) { // set window position, size, and maximized state if (setting->window.width > 0 && setting->window.height > 0 && setting->window.x < gdk_screen_width () && setting->window.y < gdk_screen_height () && setting->window.x + setting->window.width > 0 && setting->window.y + setting->window.height > 0) { gtk_window_move (app->window.self, setting->window.x, setting->window.y); gtk_window_resize (app->window.self, setting->window.width, setting->window.height); } if (setting->window.maximized) gtk_window_maximize (app->window.self); // GtkPaned position if (setting->window.paned_position_h > 0) { gtk_paned_set_position (app->window.hpaned, setting->window.paned_position_h); } if (setting->window.paned_position_v > 0) { if (setting->window.paned_position_v > 100) // for uGet < 2.0.4 gtk_paned_set_position (app->window.vpaned, setting->window.paned_position_v); } // set visible widgets gtk_widget_set_visible (app->toolbar.self, setting->window.toolbar); gtk_widget_set_visible ((GtkWidget*) app->statusbar.self, setting->window.statusbar); gtk_widget_set_visible (gtk_paned_get_child1 (app->window.hpaned), setting->window.category); gtk_widget_set_visible (app->summary.self, setting->window.summary); gtk_widget_set_visible (app->banner.self, setting->window.banner); // Summary app->summary.visible.name = setting->summary.name; app->summary.visible.folder = setting->summary.folder; app->summary.visible.category = setting->summary.category; app->summary.visible.uri = setting->summary.uri; app->summary.visible.message = setting->summary.message; // traveler if (setting->window.nth_category >= app->real.n_children) setting->window.nth_category = 0; if (setting->window.nth_state >= app->split.n_children) setting->window.nth_state = 0; ugtk_traveler_select_category (&app->traveler, setting->window.nth_category, setting->window.nth_state); // menu ugtk_app_set_menu_setting (app, setting); } void ugtk_app_get_column_setting (UgtkApp* app, UgtkSetting* setting) { GtkTreeViewColumn* column; int width; // state column = gtk_tree_view_get_column (app->traveler.download.view, UGTK_NODE_COLUMN_STATE); width = gtk_tree_view_column_get_width (column); setting->download_column.width.state = width; // name column = gtk_tree_view_get_column (app->traveler.download.view, UGTK_NODE_COLUMN_NAME); width = gtk_tree_view_column_get_width (column); setting->download_column.width.name = width; // complete column = gtk_tree_view_get_column (app->traveler.download.view, UGTK_NODE_COLUMN_COMPLETE); width = gtk_tree_view_column_get_width (column); setting->download_column.width.complete = width; // total column = gtk_tree_view_get_column (app->traveler.download.view, UGTK_NODE_COLUMN_TOTAL); width = gtk_tree_view_column_get_width (column); setting->download_column.width.total = width; // percent column = gtk_tree_view_get_column (app->traveler.download.view, UGTK_NODE_COLUMN_PERCENT); width = gtk_tree_view_column_get_width (column); setting->download_column.width.percent = width; // elapsed column = gtk_tree_view_get_column (app->traveler.download.view, UGTK_NODE_COLUMN_ELAPSED); width = gtk_tree_view_column_get_width (column); setting->download_column.width.elapsed = width; // left column = gtk_tree_view_get_column (app->traveler.download.view, UGTK_NODE_COLUMN_LEFT); width = gtk_tree_view_column_get_width (column); setting->download_column.width.left = width; // speed column = gtk_tree_view_get_column (app->traveler.download.view, UGTK_NODE_COLUMN_SPEED); width = gtk_tree_view_column_get_width (column); setting->download_column.width.speed = width; // upload_speed column = gtk_tree_view_get_column (app->traveler.download.view, UGTK_NODE_COLUMN_UPLOAD_SPEED); width = gtk_tree_view_column_get_width (column); setting->download_column.width.upload_speed = width; // uploaded column = gtk_tree_view_get_column (app->traveler.download.view, UGTK_NODE_COLUMN_UPLOADED); width = gtk_tree_view_column_get_width (column); setting->download_column.width.uploaded = width; // ratio column = gtk_tree_view_get_column (app->traveler.download.view, UGTK_NODE_COLUMN_RATIO); width = gtk_tree_view_column_get_width (column); setting->download_column.width.ratio = width; // retry column = gtk_tree_view_get_column (app->traveler.download.view, UGTK_NODE_COLUMN_RETRY); width = gtk_tree_view_column_get_width (column); setting->download_column.width.retry = width; // category column = gtk_tree_view_get_column (app->traveler.download.view, UGTK_NODE_COLUMN_CATEGORY); width = gtk_tree_view_column_get_width (column); setting->download_column.width.category = width; // uri column = gtk_tree_view_get_column (app->traveler.download.view, UGTK_NODE_COLUMN_URI); width = gtk_tree_view_column_get_width (column); setting->download_column.width.uri = width; // added_on column = gtk_tree_view_get_column (app->traveler.download.view, UGTK_NODE_COLUMN_ADDED_ON); width = gtk_tree_view_column_get_width (column); setting->download_column.width.added_on = width; // completed_on column = gtk_tree_view_get_column (app->traveler.download.view, UGTK_NODE_COLUMN_COMPLETED_ON); width = gtk_tree_view_column_get_width (column); setting->download_column.width.completed_on = width; } void ugtk_app_set_column_setting (UgtkApp* app, UgtkSetting* setting) { GtkTreeViewColumn* column; int width; // state column = gtk_tree_view_get_column (app->traveler.download.view, UGTK_NODE_COLUMN_STATE); width = setting->download_column.width.state; if (width > 0) gtk_tree_view_column_set_fixed_width (column, width); // name column = gtk_tree_view_get_column (app->traveler.download.view, UGTK_NODE_COLUMN_NAME); width = setting->download_column.width.name; if (width > 0) gtk_tree_view_column_set_fixed_width (column, width); // complete column = gtk_tree_view_get_column (app->traveler.download.view, UGTK_NODE_COLUMN_COMPLETE); width = setting->download_column.width.complete; if (width > 0) gtk_tree_view_column_set_fixed_width (column, width); // total column = gtk_tree_view_get_column (app->traveler.download.view, UGTK_NODE_COLUMN_TOTAL); width = setting->download_column.width.total; if (width > 0) gtk_tree_view_column_set_fixed_width (column, width); // percent column = gtk_tree_view_get_column (app->traveler.download.view, UGTK_NODE_COLUMN_PERCENT); width = setting->download_column.width.percent; if (width > 0) gtk_tree_view_column_set_fixed_width (column, width); // elapsed column = gtk_tree_view_get_column (app->traveler.download.view, UGTK_NODE_COLUMN_ELAPSED); width = setting->download_column.width.elapsed; if (width > 0) gtk_tree_view_column_set_fixed_width (column, width); // left column = gtk_tree_view_get_column (app->traveler.download.view, UGTK_NODE_COLUMN_LEFT); width = setting->download_column.width.left; if (width > 0) gtk_tree_view_column_set_fixed_width (column, width); // speed column = gtk_tree_view_get_column (app->traveler.download.view, UGTK_NODE_COLUMN_SPEED); width = setting->download_column.width.speed; if (width > 0) gtk_tree_view_column_set_fixed_width (column, width); // upload_speed column = gtk_tree_view_get_column (app->traveler.download.view, UGTK_NODE_COLUMN_UPLOAD_SPEED); width = setting->download_column.width.upload_speed; if (width > 0) gtk_tree_view_column_set_fixed_width (column, width); // uploaded column = gtk_tree_view_get_column (app->traveler.download.view, UGTK_NODE_COLUMN_UPLOADED); width = setting->download_column.width.uploaded; if (width > 0) gtk_tree_view_column_set_fixed_width (column, width); // ratio column = gtk_tree_view_get_column (app->traveler.download.view, UGTK_NODE_COLUMN_RATIO); width = setting->download_column.width.ratio; if (width > 0) gtk_tree_view_column_set_fixed_width (column, width); // retry column = gtk_tree_view_get_column (app->traveler.download.view, UGTK_NODE_COLUMN_RETRY); width = setting->download_column.width.retry; if (width > 0) gtk_tree_view_column_set_fixed_width (column, width); // category column = gtk_tree_view_get_column (app->traveler.download.view, UGTK_NODE_COLUMN_CATEGORY); width = setting->download_column.width.category; if (width > 0) gtk_tree_view_column_set_fixed_width (column, width); // uri column = gtk_tree_view_get_column (app->traveler.download.view, UGTK_NODE_COLUMN_URI); width = setting->download_column.width.uri; if (width > 0) gtk_tree_view_column_set_fixed_width (column, width); // added_on column = gtk_tree_view_get_column (app->traveler.download.view, UGTK_NODE_COLUMN_ADDED_ON); width = setting->download_column.width.added_on; if (width > 0) gtk_tree_view_column_set_fixed_width (column, width); // completed_on column = gtk_tree_view_get_column (app->traveler.download.view, UGTK_NODE_COLUMN_COMPLETED_ON); width = setting->download_column.width.completed_on; if (width > 0) gtk_tree_view_column_set_fixed_width (column, width); } void ugtk_app_set_plugin_setting (UgtkApp* app, UgtkSetting* setting) { const UgetPluginInfo* default_plugin; int limit[2]; int sensitive = FALSE; switch (setting->plugin_order) { default: case UGTK_PLUGIN_ORDER_CURL: uget_app_remove_plugin ((UgetApp*) app, UgetPluginAria2Info); default_plugin = UgetPluginCurlInfo; sensitive = FALSE; break; case UGTK_PLUGIN_ORDER_ARIA2: uget_app_remove_plugin ((UgetApp*) app, UgetPluginCurlInfo); default_plugin = UgetPluginAria2Info; sensitive = TRUE; break; case UGTK_PLUGIN_ORDER_CURL_ARIA2: uget_app_add_plugin ((UgetApp*) app, UgetPluginAria2Info); default_plugin = UgetPluginCurlInfo; sensitive = TRUE; break; case UGTK_PLUGIN_ORDER_ARIA2_CURL: uget_app_add_plugin ((UgetApp*) app, UgetPluginCurlInfo); default_plugin = UgetPluginAria2Info; sensitive = TRUE; break; } // set default plug-in uget_app_set_default_plugin ((UgetApp*) app, default_plugin); // set media plug-in uget_app_add_plugin ((UgetApp*) app, UgetPluginMediaInfo); uget_plugin_set (UgetPluginMediaInfo, UGET_PLUGIN_MEDIA_DEFAULT_PLUGIN, (void*) default_plugin); uget_plugin_set (UgetPluginMediaInfo, UGET_PLUGIN_MEDIA_MATCH_MODE, (void*)(intptr_t) setting->media.match_mode); uget_plugin_set (UgetPluginMediaInfo, UGET_PLUGIN_MEDIA_QUALITY, (void*)(intptr_t) setting->media.quality); uget_plugin_set (UgetPluginMediaInfo, UGET_PLUGIN_MEDIA_TYPE, (void*)(intptr_t) setting->media.type); // set agent plug-in (used by MEGA) uget_plugin_agent_global_set (UGET_PLUGIN_AGENT_DEFAULT_PLUGIN, (void*) default_plugin); uget_app_add_plugin ((UgetApp*) app, UgetPluginMegaInfo); // set aria2 plug-in if (setting->plugin_order >= UGTK_PLUGIN_ORDER_ARIA2) { uget_plugin_set (UgetPluginAria2Info, UGET_PLUGIN_ARIA2_URI, setting->aria2.uri); uget_plugin_set (UgetPluginAria2Info, UGET_PLUGIN_ARIA2_PATH, setting->aria2.path); uget_plugin_set (UgetPluginAria2Info, UGET_PLUGIN_ARIA2_ARGUMENT, setting->aria2.args); uget_plugin_set (UgetPluginAria2Info, UGET_PLUGIN_ARIA2_TOKEN, setting->aria2.token); uget_plugin_set (UgetPluginAria2Info, UGET_PLUGIN_ARIA2_LAUNCH, (void*)(intptr_t) setting->aria2.launch); uget_plugin_set (UgetPluginAria2Info, UGET_PLUGIN_ARIA2_SHUTDOWN, (void*)(intptr_t) setting->aria2.shutdown); limit[0] = setting->aria2.limit.download * 1024; limit[1] = setting->aria2.limit.upload * 1024; uget_plugin_set (UgetPluginAria2Info, UGET_PLUGIN_SPEED_LIMIT, limit); } // app->aria2.remote_updated = FALSE; gtk_widget_set_sensitive ((GtkWidget*) app->trayicon.menu.create_torrent, sensitive); gtk_widget_set_sensitive ((GtkWidget*) app->trayicon.menu.create_metalink, sensitive); gtk_widget_set_sensitive ((GtkWidget*) app->menubar.file.create_torrent, sensitive); gtk_widget_set_sensitive ((GtkWidget*) app->menubar.file.create_metalink, sensitive); gtk_widget_set_sensitive ((GtkWidget*) app->toolbar.create_torrent, sensitive); gtk_widget_set_sensitive ((GtkWidget*) app->toolbar.create_metalink, sensitive); } void ugtk_app_set_other_setting (UgtkApp* app, UgtkSetting* setting) { // clipboard & commandline ugtk_clipboard_set_pattern (&app->clipboard, setting->clipboard.pattern); app->clipboard.website = app->setting.clipboard.website; // global speed limit uget_task_set_speed (&app->task, setting->bandwidth.normal.download * 1024, setting->bandwidth.normal.upload * 1024); } void ugtk_app_set_menu_setting (UgtkApp* app, UgtkSetting* setting) { // ---------------------------------------------------- // UgtkEditMenu gtk_check_menu_item_set_active ( (GtkCheckMenuItem*) app->menubar.edit.clipboard_monitor, setting->clipboard.monitor); gtk_check_menu_item_set_active ( (GtkCheckMenuItem*) app->menubar.edit.clipboard_quiet, setting->clipboard.quiet); gtk_check_menu_item_set_active ( (GtkCheckMenuItem*) app->menubar.edit.commandline_quiet, setting->commandline.quiet); gtk_check_menu_item_set_active ( (GtkCheckMenuItem*) app->menubar.edit.skip_existing, setting->ui.skip_existing); gtk_check_menu_item_set_active ( (GtkCheckMenuItem*) app->menubar.edit.apply_recent, setting->ui.apply_recent); switch (app->setting.completion.action) { default: case 0: gtk_check_menu_item_set_active ( (GtkCheckMenuItem*)app->menubar.edit.completion.disable, TRUE); break; case 1: gtk_check_menu_item_set_active ( (GtkCheckMenuItem*)app->menubar.edit.completion.hibernate, TRUE); break; case 2: gtk_check_menu_item_set_active ( (GtkCheckMenuItem*)app->menubar.edit.completion.suspend, TRUE); break; case 3: gtk_check_menu_item_set_active ( (GtkCheckMenuItem*)app->menubar.edit.completion.shutdown, TRUE); break; case 4: gtk_check_menu_item_set_active ( (GtkCheckMenuItem*)app->menubar.edit.completion.reboot, TRUE); break; case 5: gtk_check_menu_item_set_active ( (GtkCheckMenuItem*)app->menubar.edit.completion.custom, TRUE); break; } gtk_check_menu_item_set_active ( (GtkCheckMenuItem*) app->menubar.edit.completion.remember, setting->completion.remember); // ---------------------------------------------------- // UgtkViewMenu gtk_check_menu_item_set_active ( (GtkCheckMenuItem*) app->menubar.view.toolbar, setting->window.toolbar); gtk_check_menu_item_set_active ( (GtkCheckMenuItem*) app->menubar.view.statusbar, setting->window.statusbar); gtk_check_menu_item_set_active ( (GtkCheckMenuItem*) app->menubar.view.category, setting->window.category); gtk_check_menu_item_set_active ( (GtkCheckMenuItem*) app->menubar.view.summary, setting->window.summary); // summary items gtk_check_menu_item_set_active ( (GtkCheckMenuItem*) app->menubar.view.summary_items.name, setting->summary.name); gtk_check_menu_item_set_active ( (GtkCheckMenuItem*) app->menubar.view.summary_items.folder, setting->summary.folder); gtk_check_menu_item_set_active ( (GtkCheckMenuItem*) app->menubar.view.summary_items.category, setting->summary.category); gtk_check_menu_item_set_active ( (GtkCheckMenuItem*) app->menubar.view.summary_items.uri, setting->summary.uri); gtk_check_menu_item_set_active ( (GtkCheckMenuItem*) app->menubar.view.summary_items.message, setting->summary.message); // download column gtk_check_menu_item_set_active ( (GtkCheckMenuItem*) app->menubar.view.columns.complete, setting->download_column.complete); gtk_check_menu_item_set_active ( (GtkCheckMenuItem*) app->menubar.view.columns.total, setting->download_column.total); gtk_check_menu_item_set_active ( (GtkCheckMenuItem*) app->menubar.view.columns.percent, setting->download_column.percent); gtk_check_menu_item_set_active ( (GtkCheckMenuItem*) app->menubar.view.columns.elapsed, setting->download_column.elapsed); gtk_check_menu_item_set_active ( (GtkCheckMenuItem*) app->menubar.view.columns.left, setting->download_column.left); gtk_check_menu_item_set_active ( (GtkCheckMenuItem*) app->menubar.view.columns.speed, setting->download_column.speed); gtk_check_menu_item_set_active ( (GtkCheckMenuItem*) app->menubar.view.columns.upload_speed, setting->download_column.upload_speed); gtk_check_menu_item_set_active ( (GtkCheckMenuItem*) app->menubar.view.columns.uploaded, setting->download_column.uploaded); gtk_check_menu_item_set_active ( (GtkCheckMenuItem*) app->menubar.view.columns.ratio, setting->download_column.ratio); gtk_check_menu_item_set_active ( (GtkCheckMenuItem*) app->menubar.view.columns.retry, setting->download_column.retry); gtk_check_menu_item_set_active ( (GtkCheckMenuItem*) app->menubar.view.columns.category, setting->download_column.category); gtk_check_menu_item_set_active ( (GtkCheckMenuItem*) app->menubar.view.columns.uri, setting->download_column.uri); gtk_check_menu_item_set_active ( (GtkCheckMenuItem*) app->menubar.view.columns.added_on, setting->download_column.added_on); gtk_check_menu_item_set_active ( (GtkCheckMenuItem*) app->menubar.view.columns.completed_on, setting->download_column.completed_on); } void ugtk_app_set_ui_setting (UgtkApp* app, UgtkSetting* setting) { GtkIconSize icon_size; #ifdef HAVE_APP_INDICATOR // AppIndicator ugtk_tray_icon_use_indicator (&app->trayicon, setting->ui.app_indicator); #endif ugtk_tray_icon_set_visible (&app->trayicon, setting->ui.show_trayicon); // ---------------------------------------------------- // large icon if (setting->ui.large_icon) icon_size = GTK_ICON_SIZE_LARGE_TOOLBAR; else icon_size = GTK_ICON_SIZE_SMALL_TOOLBAR; // toolbar gtk_toolbar_set_icon_size ((GtkToolbar*) app->toolbar.self, icon_size); // state list ugtk_node_view_use_large_icon (app->traveler.state.view, setting->ui.large_icon, setting->download_column.width.state); // category list ugtk_node_view_use_large_icon (app->traveler.category.view, setting->ui.large_icon, setting->download_column.width.state); // download list ugtk_node_view_use_large_icon (app->traveler.download.view, setting->ui.large_icon, setting->download_column.width.state); // summary ugtk_node_view_use_large_icon (app->summary.view, setting->ui.large_icon, setting->download_column.width.state); } // decide sensitive for menu, toolbar void ugtk_app_decide_download_sensitive (UgtkApp* app) { GtkTreeSelection* selection; gboolean sensitive; static gboolean sensitive_last = TRUE; gint n_selected; selection = gtk_tree_view_get_selection (app->traveler.download.view); n_selected = gtk_tree_selection_count_selected_rows (selection); if (n_selected > 0) sensitive = TRUE; else sensitive = FALSE; // change sensitive after select/unselect if (sensitive_last != sensitive) { sensitive_last = sensitive; gtk_widget_set_sensitive (app->toolbar.runnable, sensitive); gtk_widget_set_sensitive (app->toolbar.pause, sensitive); gtk_widget_set_sensitive (app->toolbar.properties, sensitive); gtk_widget_set_sensitive (app->menubar.download.open, sensitive); gtk_widget_set_sensitive (app->menubar.download.open_folder, sensitive); gtk_widget_set_sensitive (app->menubar.download.delete, sensitive); gtk_widget_set_sensitive (app->menubar.download.delete_file, sensitive); gtk_widget_set_sensitive (app->menubar.download.force_start, sensitive); gtk_widget_set_sensitive (app->menubar.download.runnable, sensitive); gtk_widget_set_sensitive (app->menubar.download.pause, sensitive); gtk_widget_set_sensitive (app->menubar.download.move_to.item, sensitive); gtk_widget_set_sensitive (app->menubar.download.prioriy.item, sensitive); } // properties if (n_selected > 1) { gtk_widget_set_sensitive (app->toolbar.properties, FALSE); gtk_widget_set_sensitive (app->menubar.download.properties, FALSE); } else { gtk_widget_set_sensitive (app->toolbar.properties, sensitive); gtk_widget_set_sensitive (app->menubar.download.properties, sensitive); } // Move Up/Down/Top/Bottom functions need reset sensitive when selection changed. // These need by on_move_download_xxx() series. if (n_selected > 0) { // Any Category/Status can't move download position if they were sorted. if (app->setting.download_column.sort.nth == UGTK_NODE_COLUMN_STATE) sensitive = TRUE; else sensitive = FALSE; } // move up/down/top/bottom gtk_widget_set_sensitive (app->toolbar.move_up, sensitive); gtk_widget_set_sensitive (app->toolbar.move_down, sensitive); gtk_widget_set_sensitive (app->toolbar.move_top, sensitive); gtk_widget_set_sensitive (app->toolbar.move_bottom, sensitive); gtk_widget_set_sensitive (app->menubar.download.move_up, sensitive); gtk_widget_set_sensitive (app->menubar.download.move_down, sensitive); gtk_widget_set_sensitive (app->menubar.download.move_top, sensitive); gtk_widget_set_sensitive (app->menubar.download.move_bottom, sensitive); } // decide sensitive for menu, toolbar void ugtk_app_decide_category_sensitive (UgtkApp* app) { static gboolean sensitive_last = TRUE; gboolean sensitive; if (app->traveler.category.cursor.node) sensitive = TRUE; else sensitive = FALSE; if (sensitive_last != sensitive) { sensitive_last = sensitive; gtk_widget_set_sensitive (app->menubar.category.properties, sensitive); gtk_widget_set_sensitive (app->menubar.view.columns.self, sensitive); } // cursor at "All Category" if (app->traveler.category.cursor.pos == 0) { gtk_widget_set_sensitive (app->menubar.file.save_category, FALSE); gtk_widget_set_sensitive (app->menubar.category.delete, FALSE); } else { gtk_widget_set_sensitive (app->menubar.file.save_category, sensitive); gtk_widget_set_sensitive (app->menubar.category.delete, sensitive); } // Move Up if (app->traveler.category.cursor.pos <= 1) gtk_widget_set_sensitive (app->menubar.category.move_up, FALSE); else gtk_widget_set_sensitive (app->menubar.category.move_up, TRUE); // Move Down if (app->traveler.category.cursor.pos == 0 || app->traveler.category.cursor.node->next == NULL) { gtk_widget_set_sensitive (app->menubar.category.move_down, FALSE); } else gtk_widget_set_sensitive (app->menubar.category.move_down, TRUE); ugtk_app_decide_download_sensitive (app); } void ugtk_app_decide_trayicon_visible (UgtkApp* app) { gboolean visible; if (app->setting.ui.show_trayicon) visible = TRUE; else { if (gtk_widget_get_visible ((GtkWidget*) app->window.self)) visible = FALSE; else visible = TRUE; } ugtk_tray_icon_set_visible (&app->trayicon, visible); } void ugtk_app_decide_to_quit (UgtkApp* app) { UgtkConfirmDialog* cdialog; if (app->setting.ui.exit_confirmation == FALSE) ugtk_app_quit (app); else if (app->dialogs.exit_confirmation) gtk_widget_show (app->dialogs.exit_confirmation); else { cdialog = ugtk_confirm_dialog_new (UGTK_CONFIRM_DIALOG_EXIT, app); ugtk_confirm_dialog_run (cdialog); } } // ------------------------------------ // create node by UI void ugtk_app_create_category (UgtkApp* app) { UgtkNodeDialog* ndialog; UgetNode* cnode_src; UgetNode* cnode; gchar* title; title = g_strconcat (UGTK_APP_NAME, " - ", _("New Category"), NULL); ndialog = ugtk_node_dialog_new (title, app, TRUE); g_free (title); ugtk_download_form_set_folders (&ndialog->download, &app->setting); // category list cnode_src = app->traveler.category.cursor.node->data; if (cnode_src->parent != &app->real) cnode_src = app->real.children; cnode = uget_node_new (NULL); cnode->name = ug_strdup_printf ("%s%s", _("Copy - "), cnode_src->name); ug_info_assign (&cnode->info, &cnode_src->info, NULL); ugtk_node_dialog_set (ndialog, cnode); ugtk_node_dialog_run (ndialog, UGTK_NODE_DIALOG_NEW_CATEGORY, cnode); } void ugtk_app_create_download (UgtkApp* app, const char* sub_title, const char* uri) { UgtkNodeDialog* ndialog; UgUri uuri; UgetNode* cnode; GList* list; union { gchar* title; UgetNode* cnode; } temp; if (sub_title) temp.title = g_strconcat (UGTK_APP_NAME, " - ", sub_title, NULL); else temp.title = g_strconcat (UGTK_APP_NAME, " - ", _("New Download"), NULL); ndialog = ugtk_node_dialog_new (temp.title, app, FALSE); g_free (temp.title); ugtk_download_form_set_folders (&ndialog->download, &app->setting); // category list cnode = app->traveler.category.cursor.node->data; if (cnode->parent != &app->real) cnode = app->real.children; if (uri != NULL) { // set URI entry gtk_entry_set_text ((GtkEntry*) ndialog->download.uri_entry, uri); ndialog->download.changed.uri = TRUE; // match category by URI ug_uri_init (&uuri, uri); temp.cnode = uget_app_match_category ((UgetApp*) app, &uuri, NULL); if (temp.cnode) cnode = temp.cnode; } else if ( (list = ugtk_clipboard_get_uris (&app->clipboard)) != NULL ) { // use first URI from clipboard to set URI entry gtk_entry_set_text ((GtkEntry*) ndialog->download.uri_entry, list->data); ndialog->download.changed.uri = TRUE; // match category by URI from clipboard ug_uri_init (&uuri, list->data); temp.cnode = uget_app_match_category ((UgetApp*) app, &uuri, NULL); if (temp.cnode) cnode = temp.cnode; // g_list_free_full (list, g_free); ugtk_download_form_complete_entry (&ndialog->download); } if (cnode) cnode = cnode->data; ugtk_node_dialog_set_category (ndialog, cnode); ugtk_node_dialog_run (ndialog, UGTK_NODE_DIALOG_NEW_DOWNLOAD, NULL); } // ------------------------------------ // delete selected node void ugtk_app_delete_category (UgtkApp* app) { UgetNode* cnode; int pos; cnode = app->traveler.category.cursor.node->data; pos = app->traveler.category.cursor.pos; // move cursor if (pos <= 0) return; if (cnode->next) ugtk_traveler_select_category (&app->traveler, pos + 1, -1); else { if (app->real.n_children > 1) ugtk_traveler_select_category (&app->traveler, pos - 1, -1); else { // The last category will be deleted. ugtk_app_add_default_category (app); ugtk_traveler_select_category (&app->traveler, pos + 1, -1); } } // remove category uget_app_delete_category ((UgetApp*) app, cnode); // sync UgtkMenubar.download.move_to ugtk_menubar_sync_category (&app->menubar, app, TRUE); } void ugtk_app_delete_download (UgtkApp* app, gboolean delete_files) { UgetNode* cursor; UgetNode* node; GList* link; GList* list = NULL; // check shift key status GdkWindow* gdk_win; GdkDevice* dev_pointer; GdkModifierType mask; // check shift key status gdk_win = gtk_widget_get_parent_window ((GtkWidget*) app->traveler.download.view); dev_pointer = gdk_device_manager_get_client_pointer ( gdk_display_get_device_manager (gdk_window_get_display (gdk_win))); gdk_window_get_device_position (gdk_win, dev_pointer, NULL, NULL, &mask); cursor = app->traveler.download.cursor.node; if (cursor) cursor = cursor->data; list = ugtk_traveler_get_selected (&app->traveler); for (link = list; link; link = link->next) { node = link->data; node = node->data; link->data = node; if (delete_files || mask & GDK_SHIFT_MASK) uget_app_delete_download ((UgetApp*) app, node, delete_files); else { if (uget_app_recycle_download ((UgetApp*) app, node)) continue; } // if current node has been deleted if (cursor == node) cursor = NULL; link->data = NULL; } if (delete_files == FALSE && (mask & GDK_SHIFT_MASK) == 0) { ugtk_traveler_set_cursor (&app->traveler, cursor); ugtk_traveler_set_selected (&app->traveler, list); } g_list_free (list); // refresh gtk_widget_queue_draw ((GtkWidget*) app->traveler.category.view); gtk_widget_queue_draw ((GtkWidget*) app->traveler.state.view); app->user_action = TRUE; } // ------------------------------------ // edit selected node void ugtk_app_edit_category (UgtkApp* app) { UgtkNodeDialog* ndialog; UgetNode* node; gchar* title; if (app->traveler.category.cursor.pos == 0) node = app->real.children; else node = app->traveler.category.cursor.node; if (node == NULL) return; title = g_strconcat (UGTK_APP_NAME " - ", _("Category Properties"), NULL); ndialog = ugtk_node_dialog_new (title, app, TRUE); g_free (title); ugtk_download_form_set_folders (&ndialog->download, &app->setting); ugtk_node_dialog_set (ndialog, node->data); ugtk_node_dialog_run (ndialog, UGTK_NODE_DIALOG_EDIT_CATEGORY, node->data); } void ugtk_app_edit_download (UgtkApp* app) { UgtkNodeDialog* ndialog; UgetNode* node; gchar* title; title = g_strconcat (UGTK_APP_NAME " - ", _("Download Properties"), NULL); ndialog = ugtk_node_dialog_new (title, app, FALSE); g_free (title); ugtk_download_form_set_folders (&ndialog->download, &app->setting); node = app->traveler.download.cursor.node; ugtk_node_dialog_set (ndialog, node->data); ugtk_node_dialog_run (ndialog, UGTK_NODE_DIALOG_EDIT_DOWNLOAD, node->data); } // ------------------------------------ // queue/pause void ugtk_app_queue_download (UgtkApp* app, gboolean keep_active) { UgetNode* node; UgetNode* cursor; GList* list; GList* link; cursor = app->traveler.download.cursor.node; if (cursor) cursor = cursor->data; list = ugtk_traveler_get_selected (&app->traveler); for (link = list; link; link = link->next) { node = link->data; node = node->data; link->data = node; if (keep_active && node->state & UGET_STATE_ACTIVE) continue; uget_app_queue_download ((UgetApp*) app, node); } if (app->traveler.state.cursor.pos == 0) { ugtk_traveler_set_cursor (&app->traveler, cursor); ugtk_traveler_set_selected (&app->traveler, list); } g_list_free (list); // refresh other data & status gtk_widget_queue_draw ((GtkWidget*) app->traveler.download.view); gtk_widget_queue_draw ((GtkWidget*) app->traveler.category.view); gtk_widget_queue_draw ((GtkWidget*) app->traveler.state.view); // ugtk_summary_show (&app->summary, app->traveler.download.cursor.node); } void ugtk_app_pause_download (UgtkApp* app) { UgetNode* node; UgetNode* cursor; GList* list; GList* link; cursor = app->traveler.download.cursor.node; if (cursor) cursor = cursor->data; list = ugtk_traveler_get_selected (&app->traveler); for (link = list; link; link = link->next) { node = link->data; node = node->data; link->data = node; uget_app_pause_download ((UgetApp*) app, node); } if (app->traveler.state.cursor.pos == 0) { ugtk_traveler_set_cursor (&app->traveler, cursor); ugtk_traveler_set_selected (&app->traveler, list); } g_list_free (list); // refresh other data & status gtk_widget_queue_draw ((GtkWidget*) app->traveler.download.view); gtk_widget_queue_draw ((GtkWidget*) app->traveler.category.view); gtk_widget_queue_draw ((GtkWidget*) app->traveler.state.view); // ugtk_summary_show (&app->summary, app->traveler.download.cursor.node); app->user_action = TRUE; } void ugtk_app_switch_download_state (UgtkApp* app) { UgetNode* node; UgetNode* cursor; GList* list; GList* link; cursor = app->traveler.download.cursor.node; if (cursor) cursor = cursor->data; list = ugtk_traveler_get_selected (&app->traveler); for (link = list; link; link = link->next) { node = link->data; node = node->data; link->data = node; if (node->state & UGET_STATE_PAUSED) uget_app_queue_download ((UgetApp*) app, node); else if (node->state & UGET_STATE_ACTIVE) uget_app_pause_download ((UgetApp*) app, node); } if (app->traveler.state.cursor.pos == 0) { ugtk_traveler_set_cursor (&app->traveler, cursor); ugtk_traveler_set_selected (&app->traveler, list); } g_list_free (list); // refresh other data & status gtk_widget_queue_draw ((GtkWidget*) app->traveler.download.view); gtk_widget_queue_draw ((GtkWidget*) app->traveler.category.view); gtk_widget_queue_draw ((GtkWidget*) app->traveler.state.view); // ugtk_summary_show (&app->summary, app->traveler.download.cursor.node); app->user_action = TRUE; } // ------------------------------------ // move selected node void ugtk_app_move_download_up (UgtkApp* app) { if (ugtk_traveler_move_selected_up (&app->traveler) > 0) { gtk_widget_set_sensitive (app->toolbar.move_down, TRUE); gtk_widget_set_sensitive (app->toolbar.move_bottom, TRUE); gtk_widget_set_sensitive (app->menubar.download.move_down, TRUE); gtk_widget_set_sensitive (app->menubar.download.move_bottom, TRUE); } else { gtk_widget_set_sensitive (app->toolbar.move_up, FALSE); gtk_widget_set_sensitive (app->toolbar.move_top, FALSE); gtk_widget_set_sensitive (app->menubar.download.move_up, FALSE); gtk_widget_set_sensitive (app->menubar.download.move_top, FALSE); } } void ugtk_app_move_download_down (UgtkApp* app) { if (ugtk_traveler_move_selected_down (&app->traveler) > 0) { gtk_widget_set_sensitive (app->toolbar.move_up, TRUE); gtk_widget_set_sensitive (app->toolbar.move_top, TRUE); gtk_widget_set_sensitive (app->menubar.download.move_up, TRUE); gtk_widget_set_sensitive (app->menubar.download.move_top, TRUE); } else { gtk_widget_set_sensitive (app->toolbar.move_down, FALSE); gtk_widget_set_sensitive (app->toolbar.move_bottom, FALSE); gtk_widget_set_sensitive (app->menubar.download.move_down, FALSE); gtk_widget_set_sensitive (app->menubar.download.move_bottom, FALSE); } } void ugtk_app_move_download_top (UgtkApp* app) { if (ugtk_traveler_move_selected_top (&app->traveler) > 0) { gtk_widget_set_sensitive (app->toolbar.move_down, TRUE); gtk_widget_set_sensitive (app->toolbar.move_bottom, TRUE); gtk_widget_set_sensitive (app->menubar.download.move_down, TRUE); gtk_widget_set_sensitive (app->menubar.download.move_bottom, TRUE); } gtk_widget_set_sensitive (app->toolbar.move_up, FALSE); gtk_widget_set_sensitive (app->toolbar.move_top, FALSE); gtk_widget_set_sensitive (app->menubar.download.move_up, FALSE); gtk_widget_set_sensitive (app->menubar.download.move_top, FALSE); } void ugtk_app_move_download_bottom (UgtkApp* app) { if (ugtk_traveler_move_selected_bottom (&app->traveler) > 0) { gtk_widget_set_sensitive (app->toolbar.move_up, TRUE); gtk_widget_set_sensitive (app->toolbar.move_top, TRUE); gtk_widget_set_sensitive (app->menubar.download.move_up, TRUE); gtk_widget_set_sensitive (app->menubar.download.move_top, TRUE); } gtk_widget_set_sensitive (app->toolbar.move_down, FALSE); gtk_widget_set_sensitive (app->toolbar.move_bottom, FALSE); gtk_widget_set_sensitive (app->menubar.download.move_down, FALSE); gtk_widget_set_sensitive (app->menubar.download.move_bottom, FALSE); } void ugtk_app_move_download_to (UgtkApp* app, UgetNode* cnode) { UgetNode* node; GList* link; GList* list = NULL; if (cnode == app->traveler.category.cursor.node->data) return; list = ugtk_traveler_get_selected (&app->traveler); for (link = list; link; link = link->next) { node = link->data; node = node->data; if (node->parent == cnode) continue; uget_node_remove (node->parent, node); uget_node_unref_fake (node); uget_node_append (cnode, node); } g_list_free (list); // refresh gtk_widget_queue_draw ((GtkWidget*) app->traveler.category.view); gtk_widget_queue_draw ((GtkWidget*) app->traveler.state.view); } // ------------------------------------ // torrent & metalink static GtkWidget* create_file_chooser (GtkWindow* parent, GtkFileChooserAction action, const gchar* title, const gchar* filter_name, const gchar* mine_type) { GtkWidget* dialog; GtkFileFilter* filter; dialog = gtk_file_chooser_dialog_new (title, parent, action, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OK, GTK_RESPONSE_OK, NULL); gtk_window_set_destroy_with_parent ((GtkWindow*) dialog, TRUE); if (filter_name) { filter = gtk_file_filter_new (); gtk_file_filter_set_name (filter, filter_name); gtk_file_filter_add_mime_type (filter, mine_type); gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter); } return dialog; } static void on_create_torrent_response (GtkWidget* dialog, gint response, UgtkApp* app) { gchar* file; if (response != GTK_RESPONSE_OK ) { gtk_widget_destroy (dialog); return; } // get filename file = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)); // file = gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (dialog)); gtk_widget_destroy (dialog); ugtk_app_create_download (app, _("New Torrent"), file); g_free (file); } static void on_create_metalink_response (GtkWidget* dialog, gint response, UgtkApp* app) { gchar* file; if (response != GTK_RESPONSE_OK) { gtk_widget_destroy (dialog); return; } // get filename file = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)); // file = gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (dialog)); gtk_widget_destroy (dialog); ugtk_app_create_download (app, _("New Metalink"), file); g_free (file); } void ugtk_app_create_torrent (UgtkApp* app) { GtkWidget* dialog; gchar* title; title = g_strconcat (UGTK_APP_NAME " - ", _("Open Torrent file"), NULL); dialog = create_file_chooser (app->window.self, GTK_FILE_CHOOSER_ACTION_OPEN, title, _("Torrent file (*.torrent)"), "application/x-bittorrent"); g_free (title); g_signal_connect (dialog, "response", G_CALLBACK (on_create_torrent_response), app); gtk_widget_show (dialog); } void ugtk_app_create_metalink (UgtkApp* app) { GtkFileFilter* filter; GtkWidget* dialog; gchar* title; title = g_strconcat (UGTK_APP_NAME " - ", _("Open Metalink file"), NULL); dialog = create_file_chooser (app->window.self, GTK_FILE_CHOOSER_ACTION_OPEN, title, NULL, NULL); g_free (title); filter = gtk_file_filter_new (); gtk_file_filter_set_name (filter, "Metalink file (*.metalink, *.meta4)"); gtk_file_filter_add_pattern (filter, "*.metalink"); gtk_file_filter_add_pattern (filter, "*.meta4"); // gtk_file_filter_add_mime_type (filter, "application/metalink+xml"); // gtk_file_filter_add_mime_type (filter, "application/metalink4+xml"); gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter); g_signal_connect (dialog, "response", G_CALLBACK (on_create_metalink_response), app); gtk_widget_show (dialog); } // ------------------------------------ // import/export static void on_save_category_response (GtkWidget* dialog, gint response, UgtkApp* app) { UgetNode* cnode; gchar* file; gtk_widget_set_sensitive ((GtkWidget*) app->window.self, TRUE); if (response != GTK_RESPONSE_OK) { gtk_widget_destroy (dialog); return; } if (app->traveler.category.cursor.pos == 0) return; // get filename file = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)); // file = gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (dialog)); gtk_widget_destroy (dialog); cnode = app->traveler.category.cursor.node; if (uget_app_save_category ((UgetApp*) app, cnode->data, file, NULL) == FALSE) ugtk_app_show_message (app, GTK_MESSAGE_ERROR, _("Failed to save category file.")); g_free (file); } static void on_load_category_response (GtkWidget* dialog, gint response, UgtkApp* app) { gchar* file; gtk_widget_set_sensitive ((GtkWidget*) app->window.self, TRUE); if (response != GTK_RESPONSE_OK) { gtk_widget_destroy (dialog); return; } // get filename file = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)); // file = gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (dialog)); gtk_widget_destroy (dialog); if (uget_app_load_category ((UgetApp*) app, file, NULL)) ugtk_menubar_sync_category (&app->menubar, app, TRUE); else ugtk_app_show_message (app, GTK_MESSAGE_ERROR, _("Failed to load category file.")); g_free (file); } void ugtk_app_save_category (UgtkApp* app) { GtkWidget* dialog; gchar* title; gtk_widget_set_sensitive ((GtkWidget*) app->window.self, FALSE); title = g_strconcat (UGTK_APP_NAME " - ", _("Save Category file"), NULL); dialog = create_file_chooser (app->window.self, GTK_FILE_CHOOSER_ACTION_SAVE, title, NULL, NULL); g_free (title); g_signal_connect (dialog, "response", G_CALLBACK (on_save_category_response), app); gtk_widget_show (dialog); } void ugtk_app_load_category (UgtkApp* app) { GtkWidget* dialog; gchar* title; gtk_widget_set_sensitive ((GtkWidget*) app->window.self, FALSE); title = g_strconcat (UGTK_APP_NAME " - ", _("Open Category file"), NULL); dialog = create_file_chooser (app->window.self, GTK_FILE_CHOOSER_ACTION_OPEN, title, _("JSON file (*.json)"), "application/json"); g_free (title); g_signal_connect (dialog, "response", G_CALLBACK (on_load_category_response), app); gtk_widget_show (dialog); } static void on_import_html_file_response (GtkWidget* dialog, gint response, UgtkApp* app) { UgHtmlFilter* filter; UgHtmlFilterTag* tag_a; UgHtmlFilterTag* tag_img; UgtkBatchDialog* bdialog; UgtkSelectorPage* page; UgetNode* cnode; gchar* string; gchar* file; if (response != GTK_RESPONSE_OK ) { gtk_widget_destroy (dialog); return; } // read URLs from html file string = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)); gtk_widget_destroy (dialog); file = g_filename_to_utf8 (string, -1, NULL, NULL, NULL); g_free (string); string = NULL; // parse html filter = ug_html_filter_new (); tag_a = ug_html_filter_tag_new ("A", "HREF"); // ug_html_filter_add_tag (filter, tag_a); tag_img = ug_html_filter_tag_new ("IMG", "SRC"); // ug_html_filter_add_tag (filter, tag_img); ug_html_filter_parse_file (filter, file); g_free (file); if (filter->base_href) string = g_strdup (filter->base_href); ug_html_filter_free (filter); // UgtkBatchDialog bdialog = ugtk_batch_dialog_new ( gtk_window_get_title ((GtkWindow*) dialog), app); ugtk_download_form_set_folders (&bdialog->download, &app->setting); ugtk_batch_dialog_use_selector (bdialog); // category cnode = app->traveler.category.cursor.node->data; if (cnode->parent != &app->real) cnode = app->real.children; ugtk_batch_dialog_set_category (bdialog, cnode); // set if (string) { gtk_entry_set_text (bdialog->selector.href_entry, string); g_free (string); } // add link page = ugtk_selector_add_page (&bdialog->selector, _("Link ")); ugtk_selector_page_add_uris (page, (GList*)tag_a->attr_values.head); ug_list_clear (&tag_a->attr_values, TRUE); ug_html_filter_tag_unref (tag_a); // add image page = ugtk_selector_add_page (&bdialog->selector, _("Image ")); ugtk_selector_page_add_uris (page, (GList*)tag_img->attr_values.head); ug_list_clear (&tag_img->attr_values, TRUE); ug_html_filter_tag_unref (tag_img); ugtk_batch_dialog_run (bdialog); } static void on_import_text_file_response (GtkWidget* dialog, gint response, UgtkApp* app) { UgtkBatchDialog* bdialog; UgtkSelectorPage* page; UgetNode* cnode; gchar* string; gchar* file; GList* list; GError* error = NULL; if (response != GTK_RESPONSE_OK ) { gtk_widget_destroy (dialog); return; } // read URLs from text file string = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)); gtk_widget_destroy (dialog); file = g_filename_to_utf8 (string, -1, NULL, NULL, NULL); g_free (string); list = ugtk_text_file_get_uris (file, &error); g_free (file); if (error) { ugtk_app_show_message (app, GTK_MESSAGE_ERROR, error->message); g_error_free (error); return; } // UgtkBatchDialog bdialog = ugtk_batch_dialog_new ( gtk_window_get_title ((GtkWindow*) dialog), app); ugtk_batch_dialog_use_selector (bdialog); ugtk_download_form_set_folders (&bdialog->download, &app->setting); // category cnode = app->traveler.category.cursor.node->data; if (cnode->parent != &app->real) cnode = app->real.children; ugtk_batch_dialog_set_category (bdialog, cnode); page = ugtk_selector_add_page (&bdialog->selector, _("Text File")); ugtk_selector_hide_href (&bdialog->selector); ugtk_selector_page_add_uris (page, list); g_list_free (list); ugtk_batch_dialog_run (bdialog); } static void on_export_text_file_response (GtkWidget* dialog, gint response, UgtkApp* app) { GIOChannel* channel; UgetCommon* common; UgetNode* node; gchar* fname; if (response != GTK_RESPONSE_OK ) { gtk_widget_destroy (dialog); return; } // write all URLs to text file fname = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)); gtk_widget_destroy (dialog); channel = g_io_channel_new_file (fname, "w", NULL); g_free (fname); node = app->traveler.category.cursor.node->data; for (node = node->children; node; node = node->next) { common = ug_info_get (&node->data->info, UgetCommonInfo); if (common == NULL) continue; if (common->uri) { g_io_channel_write_chars (channel, common->uri, -1, NULL, NULL); #ifdef _WIN32 g_io_channel_write_chars (channel, "\r\n", 2, NULL, NULL); #else g_io_channel_write_chars (channel, "\n", 1, NULL, NULL); #endif } } g_io_channel_unref (channel); } void ugtk_app_import_html_file (UgtkApp* app) { GtkWidget* dialog; gchar* title; title = g_strconcat (UGTK_APP_NAME " - ", _("Import URLs from HTML file"), NULL); dialog = create_file_chooser (app->window.self, GTK_FILE_CHOOSER_ACTION_OPEN, title, _("HTML file (*.htm, *.html)"), "text/html"); g_free (title); g_signal_connect (dialog, "response", G_CALLBACK (on_import_html_file_response), app); gtk_widget_show (dialog); } void ugtk_app_import_text_file (UgtkApp* app) { GtkWidget* dialog; gchar* title; title = g_strconcat (UGTK_APP_NAME " - ", _("Import URLs from text file"), NULL); dialog = create_file_chooser (app->window.self, GTK_FILE_CHOOSER_ACTION_OPEN, title, _("Plain text file"), "text/plain"); g_free (title); g_signal_connect (dialog, "response", G_CALLBACK (on_import_text_file_response), app); gtk_widget_show (dialog); } void ugtk_app_export_text_file (UgtkApp* app) { GtkWidget* dialog; gchar* title; title = g_strconcat (UGTK_APP_NAME " - ", _("Export URLs to text file"), NULL); dialog = create_file_chooser (app->window.self, GTK_FILE_CHOOSER_ACTION_SAVE, title, NULL, NULL); g_free (title); g_signal_connect (dialog, "response", G_CALLBACK (on_export_text_file_response), app); gtk_widget_show (dialog); } // ------------------------------------ // batch void ugtk_app_sequence_batch (UgtkApp* app) { UgtkBatchDialog* bdialog; UgetNode* cnode; gchar* title; title = g_strconcat (UGTK_APP_NAME " - ", _("URL Sequence batch"), NULL); bdialog = ugtk_batch_dialog_new (title, app); g_free (title); ugtk_batch_dialog_use_sequencer (bdialog); ugtk_download_form_set_folders (&bdialog->download, &app->setting); // category list cnode = app->traveler.category.cursor.node->data; if (cnode->parent != &app->real) cnode = app->real.children; ugtk_batch_dialog_set_category (bdialog, cnode); ugtk_batch_dialog_run (bdialog); } void ugtk_app_clipboard_batch (UgtkApp* app) { UgtkBatchDialog* bdialog; UgtkSelectorPage* page; UgetNode* cnode; GList* list; gchar* title; list = ugtk_clipboard_get_uris (&app->clipboard); if (list == NULL) { ugtk_app_show_message (app, GTK_MESSAGE_ERROR, _("No URLs found in clipboard.")); return; } // filter existing if (app->setting.ui.skip_existing) { if (ugtk_app_filter_existing (app, list) == 0) { // g_list_foreach (list, (GFunc) g_free, NULL); g_list_free (list); ugtk_app_show_message (app, GTK_MESSAGE_INFO, _("All URLs had existed.")); return; } } title = g_strconcat (UGTK_APP_NAME " - ", _("Clipboard batch"), NULL); bdialog = ugtk_batch_dialog_new (title, app); g_free (title); ugtk_download_form_set_folders (&bdialog->download, &app->setting); ugtk_batch_dialog_use_selector (bdialog); // selector ugtk_selector_hide_href (&bdialog->selector); page = ugtk_selector_add_page (&bdialog->selector, _("Clipboard")); ugtk_selector_page_add_uris (page, list); g_list_free (list); // category list cnode = app->traveler.category.cursor.node->data; if (cnode->parent != &app->real) cnode = app->real.children; ugtk_batch_dialog_set_category (bdialog, cnode); ugtk_batch_dialog_run (bdialog); } int ugtk_app_filter_existing (UgtkApp* app, GList* uris) { int counts; for (counts = 0; uris; uris = uris->next) { if (uris->data == NULL) continue; if (uget_uri_hash_find (app->uri_hash, (char*) uris->data) == FALSE) counts++; else { g_free (uris->data); uris->data = NULL; } } return counts; } // ------------------------------------ // emit signal "row-changed" for UgtkNodeTree and UgtkNodeList void ugtk_app_download_changed (UgtkApp* app, UgetNode* dnode) { GtkTreeModel* model; GtkTreePath* path; GtkTreeIter iter; if (ugtk_traveler_get_iter (&app->traveler, &iter, dnode)) { model = GTK_TREE_MODEL (app->traveler.download.model); path = gtk_tree_model_get_path (model, &iter); if (path) { gtk_tree_model_row_changed (model, path, &iter); gtk_tree_path_free (path); } } } void ugtk_app_category_changed (UgtkApp* app, UgetNode* cnode) { GtkTreeIter iter; GtkTreePath* path; GtkTreeModel* model; model = GTK_TREE_MODEL (app->traveler.category.model); if (app->traveler.category.cursor.pos > 0) { iter.stamp = app->traveler.category.model->stamp; iter.user_data = cnode; // update category path = gtk_tree_model_get_path (model, &iter); gtk_tree_model_row_changed (model, path, &iter); gtk_tree_path_free (path); } // update "All Category" path = gtk_tree_path_new_first (); gtk_tree_model_get_iter_first (model, &iter); gtk_tree_model_row_changed (model, path, &iter); gtk_tree_path_free (path); // refresh status list gtk_widget_queue_draw ((GtkWidget*) app->traveler.state.view); } void ugtk_app_add_default_category (UgtkApp* app) { UgetNode* cnode; UgetCommon* common; UgetCategory* category; static int counts = 0; cnode = uget_node_new (NULL); cnode->name = ug_strdup_printf ("%s %d", _("New"), counts++); common = ug_info_realloc (&cnode->info, UgetCommonInfo); common->folder = ug_strdup (g_get_home_dir ()); category = ug_info_realloc (&cnode->info, UgetCategoryInfo); *(char**)ug_array_alloc (&category->schemes, 1) = ug_strdup ("ftps"); *(char**)ug_array_alloc (&category->schemes, 1) = ug_strdup ("magnet"); *(char**)ug_array_alloc (&category->hosts, 1) = ug_strdup (".edu"); *(char**)ug_array_alloc (&category->hosts, 1) = ug_strdup (".idv"); *(char**)ug_array_alloc (&category->file_exts, 1) = ug_strdup ("torrent"); *(char**)ug_array_alloc (&category->file_exts, 1) = ug_strdup ("metalink"); uget_app_add_category ((UgetApp*) app, cnode, TRUE); } // ------------------------------------ // others static void on_message_response (GtkWidget* dialog, gint response, GtkWidget** value) { gtk_widget_destroy (dialog); *value = NULL; } void ugtk_app_show_message (UgtkApp* app, GtkMessageType type, const gchar* message) { GtkWidget* dialog; GtkWidget** value; gchar* title; dialog = gtk_message_dialog_new (app->window.self, GTK_DIALOG_DESTROY_WITH_PARENT, type, GTK_BUTTONS_OK, "%s", message); // set title switch (type) { case GTK_MESSAGE_ERROR: if (app->dialogs.error) gtk_widget_destroy (app->dialogs.error); app->dialogs.error = dialog; value = &app->dialogs.error; title = g_strconcat (UGTK_APP_NAME " - ", _("Error"), NULL); break; default: if (app->dialogs.message) gtk_widget_destroy (app->dialogs.message); app->dialogs.message = dialog; value = &app->dialogs.message; title = g_strconcat (UGTK_APP_NAME " - ", _("Message"), NULL); break; } gtk_window_set_title ((GtkWindow*) dialog, title); g_free (title); // signal handler g_signal_connect (dialog, "response", G_CALLBACK (on_message_response), value); gtk_widget_show (dialog); } // ------------------------------------------------------- // UgtkClipboard void ugtk_clipboard_init (struct UgtkClipboard* clipboard, const gchar* pattern) { clipboard->self = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD); clipboard->text = NULL; clipboard->regex = g_regex_new (pattern, G_REGEX_CASELESS, 0, NULL); clipboard->website = TRUE; } void ugtk_clipboard_set_pattern (struct UgtkClipboard* clipboard, const gchar* pattern) { if (clipboard->regex) g_regex_unref (clipboard->regex); if (pattern) clipboard->regex = g_regex_new (pattern, G_REGEX_CASELESS, 0, NULL); else clipboard->regex = g_regex_new ("", G_REGEX_CASELESS, 0, NULL); } void ugtk_clipboard_set_text (struct UgtkClipboard* clipboard, gchar* text) { g_free (clipboard->text); clipboard->text = text; gtk_clipboard_set_text (clipboard->self, text, -1); } GList* ugtk_clipboard_get_uris (struct UgtkClipboard* clipboard) { GList* list; gchar* text; if (gtk_clipboard_wait_is_text_available (clipboard->self) == FALSE) return NULL; text = gtk_clipboard_wait_for_text (clipboard->self); if (text == NULL) return NULL; // get URIs that scheme is not "file" from text list = ugtk_text_get_uris (text); list = ugtk_uri_list_remove_scheme (list, "file"); g_free (text); return list; } GList* ugtk_clipboard_get_matched (struct UgtkClipboard* clipboard, const gchar* text) { GList* link; GList* list; gchar* temp; if (text == NULL) { g_free (clipboard->text); clipboard->text = NULL; return NULL; } // compare temp = (clipboard->text) ? clipboard->text : ""; if (g_ascii_strcasecmp (text, temp) == 0) return NULL; // replace text g_free (clipboard->text); clipboard->text = g_strdup (text); // get and filter list list = ugtk_text_get_uris (text); list = ugtk_uri_list_remove_scheme (list, "file"); // filter by filename extension for (link = list; link; link = link->next) { temp = ug_filename_from_uri (link->data); // get filename extension if (temp) text = strrchr (temp, '.'); else text = NULL; // free URIs if not matched if (text == NULL || g_regex_match (clipboard->regex, text+1, 0, NULL) == FALSE) { // storage or media website if (clipboard->website == FALSE || uget_site_get_id (link->data) == UGET_SITE_UNKNOWN) { g_free (link->data); link->data = NULL; } } ug_free (temp); } list = g_list_remove_all (list, NULL); return list; } // ------------------------------------------------------- // UgtkStatusbar void ugtk_statusbar_set_info (struct UgtkStatusbar* statusbar, gint n_selected) { static guint context_id = 0; gchar* string; if (context_id == 0) context_id = gtk_statusbar_get_context_id (statusbar->self, "selected"); gtk_statusbar_pop (statusbar->self, context_id); if (n_selected > 0) { string = g_strdup_printf (_("Selected %d items"), n_selected); gtk_statusbar_push (statusbar->self, context_id, string); g_free (string); } } void ugtk_statusbar_set_speed (struct UgtkStatusbar* statusbar, gint64 down_speed, gint64 up_speed) { char* string; string = ug_str_from_int_unit (down_speed, "/s"); gtk_label_set_text (statusbar->down_speed, string); ug_free (string); string = ug_str_from_int_unit (up_speed, "/s"); gtk_label_set_text (statusbar->up_speed, string); ug_free (string); } uget-2.2.0/ui-gtk/UgtkTraveler.h0000644000175000000120000001035713224532612013364 00000000000000/* * * Copyright (C) 2012-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #ifndef UGTK_TRAVELER_H #define UGTK_TRAVELER_H #include #include #include #include #ifdef __cplusplus extern "C" { #endif // Uget GTK node Traveler typedef struct UgtkTraveler UgtkTraveler; typedef struct UgtkApp UgtkApp; struct UgtkTraveler { UgtkApp* app; struct { GtkWidget* self; GtkTreeView* view; UgtkNodeList* model; struct { // pos_last used by "cursor-changed" signal handler // if selection changed by user, pos != pos_last. int pos; int pos_last; UgetNode* node; } cursor; } state; struct { GtkWidget* self; GtkTreeView* view; UgtkNodeTree* model; struct { // pos_last used by "cursor-changed" signal handler // if selection changed by user, pos != pos_last. int pos; int pos_last; UgetNode* node; } cursor; } category; struct { GtkWidget* self; GtkTreeView* view; UgtkNodeTree* model; struct { // pos_last used by "cursor-changed" signal handler // if selection changed by user, pos != pos_last. int pos; int pos_last; UgetNode* node; } cursor; } download; // ugtk_traveler_reserve_selection() // ugtk_traveler_restore_selection() struct { GList* list; UgetNode* node; } reserved; }; void ugtk_traveler_init (UgtkTraveler* traveler, UgtkApp* app); void ugtk_traveler_select_category (UgtkTraveler* traveler, int nth_category, int nth_state); // get download iter void ugtk_traveler_set_cursor (UgtkTraveler* traveler, UgetNode* dnode); UgetNode* ugtk_traveler_get_cursor (UgtkTraveler* traveler); gboolean ugtk_traveler_get_iter (UgtkTraveler* traveler, GtkTreeIter* iter, UgetNode* dnode); // return all selected download node (reverse order) GList* ugtk_traveler_get_selected (UgtkTraveler* traveler); void ugtk_traveler_set_selected (UgtkTraveler* traveler, GList* nodes); GList* ugtk_traveler_reserve_selection (UgtkTraveler* traveler); void ugtk_traveler_restore_selection (UgtkTraveler* traveler); gint ugtk_traveler_move_selected_up (UgtkTraveler* traveler); gint ugtk_traveler_move_selected_down (UgtkTraveler* traveler); gint ugtk_traveler_move_selected_top (UgtkTraveler* traveler); gint ugtk_traveler_move_selected_bottom (UgtkTraveler* traveler); void ugtk_traveler_set_sorting (UgtkTraveler* traveler, gboolean user_sortable, UgtkNodeColumn nth_column, GtkSortType type); #ifdef __cplusplus } #endif #endif // UGTK_TRAVELER_H uget-2.2.0/ui-gtk/UgtkNodeDialog.h0000644000175000000120000001044413224532612013602 00000000000000/* * * Copyright (C) 2005-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #ifndef UGTK_NODE_DIALOG_H #define UGTK_NODE_DIALOG_H #include #include #include #include #include #ifdef __cplusplus extern "C" { #endif typedef struct UgtkNodeDialog UgtkNodeDialog; typedef enum { UGTK_NODE_DIALOG_NEW_DOWNLOAD, UGTK_NODE_DIALOG_NEW_CATEGORY, UGTK_NODE_DIALOG_EDIT_DOWNLOAD, UGTK_NODE_DIALOG_EDIT_CATEGORY, } UgtkNodeDialogMode; #define UGTK_NODE_DIALOG_MEMBERS \ GtkDialog* self; \ GtkBox* hbox; \ GtkWidget* notebook; \ GtkTreeView* node_view; \ UgtkNodeTree* node_tree; \ gulong handler_id[3]; \ UgtkApp* app; \ UgetNode* node; \ UgtkProxyForm proxy; \ UgtkDownloadForm download; \ UgtkCategoryForm category struct UgtkNodeDialog { UGTK_NODE_DIALOG_MEMBERS; // GtkDialog* self; // GtkBox* hbox; // GtkWidget* notebook; // GtkTreeView* node_view; // UgtkNodeTree* node_tree; // gulong handler_id[3]; // UgtkApp* app; // UgetNode* node; // UgtkProxyForm proxy; // UgtkDownloadForm download; // UgtkCategoryForm category; // handler_id[0] : "row-changed" // handler_id[1] : "row-deleted" // handler_id[2] : "row-inserted" }; UgtkNodeDialog* ugtk_node_dialog_new (const char* title, UgtkApp* app, gboolean has_category_form); void ugtk_node_dialog_free (UgtkNodeDialog* ndialog); // enable/disable category node list view in left side // return index of selected category int ugtk_node_dialog_get_category (UgtkNodeDialog* ndialog, UgetNode** cnode); void ugtk_node_dialog_set_category (UgtkNodeDialog* ndialog, UgetNode* cnode); // set/get node's info to/from UgtkNodeDialog void ugtk_node_dialog_get (UgtkNodeDialog* ndialog, UgetNode* node); void ugtk_node_dialog_set (UgtkNodeDialog* ndialog, UgetNode* node); void ugtk_node_dialog_run (UgtkNodeDialog* ndialog, UgtkNodeDialogMode mode, UgetNode* node4edit); void ugtk_node_dialog_store_recent (UgtkNodeDialog* ndialog, UgtkApp* app); void ugtk_node_dialog_apply_recent (UgtkNodeDialog* ndialog, UgtkApp* app); void ugtk_node_dialog_monitor_uri (UgtkNodeDialog* ndialog); gboolean ugtk_node_dialog_confirm_existing (UgtkNodeDialog* ndialog, const char* uri); // initialize notebook and it's form void ugtk_node_dialog_init (UgtkNodeDialog* ndialog, const char* title, UgtkApp* app, gboolean has_category_form); #ifdef __cplusplus } #endif #endif // End of UGTK_NODE_DIALOG_H uget-2.2.0/ui-gtk/UgtkApp-ui.c0000644000175000000120000004205613224532612012727 00000000000000/* * * Copyright (C) 2012-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #include #include #include #include #include // GdkScreen #include static void ugtk_statusbar_init_ui (struct UgtkStatusbar* app_statusbar); static void ugtk_toolbar_init_ui (struct UgtkToolbar* app_toolbar, GtkAccelGroup* accel_group); static void ugtk_window_init_ui (struct UgtkWindow* window, UgtkApp* app); static void ugtk_app_init_size (UgtkApp* app); #if defined _WIN32 || defined _WIN64 static void ugtk_app_init_ui_win32 (UgtkApp* app, int screen_width); #endif void ugtk_app_init_ui (UgtkApp* app) { // Registers a new accelerator "Ctrl+N" with the global accelerator map. gtk_accel_map_add_entry (UGTK_APP_ACCEL_PATH_NEW, GDK_KEY_n, GDK_CONTROL_MASK); gtk_accel_map_add_entry (UGTK_APP_ACCEL_PATH_LOAD, GDK_KEY_o, GDK_CONTROL_MASK); gtk_accel_map_add_entry (UGTK_APP_ACCEL_PATH_SAVE, GDK_KEY_s, GDK_CONTROL_MASK); gtk_accel_map_add_entry (UGTK_APP_ACCEL_PATH_SAVE_ALL, GDK_KEY_s, GDK_CONTROL_MASK | GDK_SHIFT_MASK); gtk_accel_map_add_entry (UGTK_APP_ACCEL_PATH_DELETE, GDK_KEY_Delete, 0); // gtk_accel_map_add_entry (UGTK_APP_ACCEL_PATH_DELETE_F, GDK_KEY_Delete, GDK_SHIFT_MASK); gtk_accel_map_add_entry (UGTK_APP_ACCEL_PATH_DELETE_F, GDK_KEY_Delete, GDK_CONTROL_MASK); gtk_accel_map_add_entry (UGTK_APP_ACCEL_PATH_OPEN, GDK_KEY_Return, 0); gtk_accel_map_add_entry (UGTK_APP_ACCEL_PATH_OPEN_F, GDK_KEY_Return, GDK_SHIFT_MASK); // accelerators app->accel_group = gtk_accel_group_new (); // tray icon ugtk_tray_icon_init (&app->trayicon); // Main Window and it's widgets ugtk_banner_init (&app->banner); ugtk_menubar_init_ui (&app->menubar, app->accel_group); ugtk_summary_init (&app->summary, app->accel_group); ugtk_traveler_init (&app->traveler, app); ugtk_statusbar_init_ui (&app->statusbar); ugtk_toolbar_init_ui (&app->toolbar, app->accel_group); ugtk_window_init_ui (&app->window, app); ugtk_app_init_size (app); } // set default size static void ugtk_app_init_size (UgtkApp* app) { GdkScreen* screen; gint width, height; gint paned_position; screen = gdk_screen_get_default (); if (screen) { width = gdk_screen_get_width (screen); height = gdk_screen_get_height (screen); } else { width = 0; height = 0; } // decide window & traveler size if (width <= 640) { width = 620; height = 430; paned_position = 165; } if (width <= 800) { width = width * 95 / 100; height = height * 9 / 10; paned_position = 180; } else if (width <= 1000) { width = width * 90 / 100; height = height * 8 / 10; paned_position = 200; } else { width = width * 85 / 100; height = height * 8 / 10; paned_position = width * 22 / 100; } gtk_window_resize (app->window.self, width, height); gtk_paned_set_position (app->window.hpaned, paned_position); #if defined _WIN32 || defined _WIN64 ugtk_app_init_ui_win32 (app, width); #endif } #if defined _WIN32 || defined _WIN64 static void ugtk_app_init_ui_win32 (UgtkApp* app, int screen_width) { GSettings* gset; gint sidebar_width; #if 0 // This will use icons\hicolor\index.theme GtkIconTheme* icon_theme; gchar* path; icon_theme = gtk_icon_theme_get_default (); path = g_build_filename (UG_DATADIR, "icons", NULL); gtk_icon_theme_append_search_path (icon_theme, path); g_free (path); #endif if (screen_width <= 800) sidebar_width = 0; else if (screen_width <= 1200) sidebar_width = 180; else sidebar_width = 220; gset = g_settings_new ("org.gtk.Settings.FileChooser"); g_settings_set_boolean (gset, "sort-directories-first", TRUE); // default of "sidebar-width" == 148 if (sidebar_width > 0 && g_settings_get_int(gset, "sidebar-width") == 148) g_settings_set_int (gset, "sidebar-width", sidebar_width); } #endif // _WIN32 || _WIN64 // ---------------------------------------------------------------------------- // UgtkWindow static void ugtk_window_init_ui (struct UgtkWindow* window, UgtkApp* app) { GtkBox* vbox; GtkBox* lbox; // left side vbox GtkBox* rbox; // right side vbox window->self = (GtkWindow*) gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (window->self, UGTK_APP_NAME); // gtk_window_resize (window->self, 640, 480); gtk_window_add_accel_group (window->self, app->accel_group); gtk_window_set_default_icon_name (UGTK_APP_ICON_NAME); #if GTK_MAJOR_VERSION <= 3 && GTK_MINOR_VERSION < 14 gtk_window_set_has_resize_grip (window->self, FALSE); #endif // top container for Main Window vbox = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_add (GTK_CONTAINER (window->self), GTK_WIDGET (vbox)); // banner + menubar gtk_box_pack_start (vbox, app->banner.self, FALSE, FALSE, 0); gtk_box_pack_start (vbox, app->menubar.self, FALSE, FALSE, 0); // hpaned window->hpaned = (GtkPaned*) gtk_paned_new (GTK_ORIENTATION_HORIZONTAL); gtk_box_pack_start (vbox, GTK_WIDGET (window->hpaned), TRUE, TRUE, 0); lbox = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 2); rbox = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_paned_pack1 (window->hpaned, GTK_WIDGET (lbox), FALSE, TRUE); gtk_paned_pack2 (window->hpaned, GTK_WIDGET (rbox), TRUE, FALSE); gtk_box_pack_start (lbox, gtk_label_new (_("Status")), FALSE, FALSE, 0); gtk_box_pack_start (lbox, app->traveler.state.self, FALSE, FALSE, 0); gtk_box_pack_start (lbox, gtk_label_new (_("Category")), FALSE, FALSE, 0); gtk_box_pack_start (lbox, app->traveler.category.self, TRUE, TRUE, 0); gtk_box_pack_start (rbox, app->toolbar.self, FALSE, FALSE, 0); // vpaned window->vpaned = (GtkPaned*) gtk_paned_new (GTK_ORIENTATION_VERTICAL); gtk_box_pack_start (rbox, (GtkWidget*) window->vpaned, TRUE, TRUE, 0); gtk_paned_pack1 (window->vpaned, app->traveler.download.self , TRUE, TRUE); gtk_paned_pack2 (window->vpaned, app->summary.self, FALSE, TRUE); gtk_box_pack_start (vbox, GTK_WIDGET (app->statusbar.self), FALSE, FALSE, 0); gtk_widget_show_all ((GtkWidget*) vbox); } // ---------------------------------------------------------------------------- // UgtkStatusbar // static void ugtk_statusbar_init_ui (struct UgtkStatusbar* sbar) { GtkBox* hbox; GtkWidget* widget; PangoContext* context; PangoLayout* layout; int text_width; sbar->self = (GtkStatusbar*) gtk_statusbar_new (); hbox = GTK_BOX (sbar->self); // calculate text width context = gtk_widget_get_pango_context (GTK_WIDGET (sbar->self)); layout = pango_layout_new (context); pango_layout_set_text (layout, "9999 MiB/s", -1); pango_layout_get_pixel_size (layout, &text_width, NULL); g_object_unref (layout); if (text_width < 100) text_width = 100; // upload speed label widget = gtk_label_new (""); sbar->up_speed = (GtkLabel*) widget; gtk_widget_set_size_request (widget, text_width, 0); gtk_box_pack_end (hbox, widget, FALSE, TRUE, 2); // gtk_label_set_width_chars (sbar->down_speed, 15); gtk_misc_set_alignment (GTK_MISC (widget), 0, 0.5); gtk_box_pack_end (hbox, gtk_label_new ("\xE2\x86\x91"), FALSE, TRUE, 2); // "↑" gtk_box_pack_end (hbox, gtk_separator_new (GTK_ORIENTATION_VERTICAL), FALSE, TRUE, 8); // download speed label widget = gtk_label_new (""); sbar->down_speed = (GtkLabel*) widget; gtk_widget_set_size_request (widget, text_width, 0); gtk_box_pack_end (hbox, widget, FALSE, TRUE, 2); // gtk_label_set_width_chars (sbar->down_speed, 15); gtk_misc_set_alignment (GTK_MISC (widget), 0, 0.5); gtk_box_pack_end (hbox, gtk_label_new ("\xE2\x86\x93"), FALSE, TRUE, 2); // "↓" } // ---------------------------------------------------------------------------- // UgtkToolbar // static void ugtk_toolbar_init_ui (struct UgtkToolbar* ugt, GtkAccelGroup* accel_group) { GtkToolbar* toolbar; GtkToolItem* tool_item; GtkWidget* image; GtkWidget* menu; GtkWidget* menu_item; // toolbar ugt->toolbar = gtk_toolbar_new (); toolbar = GTK_TOOLBAR (ugt->toolbar); gtk_toolbar_set_style (toolbar, GTK_TOOLBAR_ICONS); gtk_toolbar_set_icon_size (toolbar, GTK_ICON_SIZE_SMALL_TOOLBAR); ugt->self = ugt->toolbar; gtk_widget_show (ugt->self); // New button --- start --- #if GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 10 image = gtk_image_new_from_icon_name ("document-new", GTK_ICON_SIZE_SMALL_TOOLBAR); tool_item = (GtkToolItem*) gtk_menu_tool_button_new (image, NULL); #else tool_item = (GtkToolItem*) gtk_menu_tool_button_new_from_stock (GTK_STOCK_NEW); #endif gtk_tool_item_set_tooltip_text (tool_item, _("Create new download")); gtk_menu_tool_button_set_arrow_tooltip_text ((GtkMenuToolButton*)tool_item, "Create new item"); gtk_tool_item_set_homogeneous (tool_item, FALSE); gtk_toolbar_insert (toolbar, tool_item, -1); ugt->create = GTK_WIDGET (tool_item); // menu for tool button (accelerators) menu = gtk_menu_new (); gtk_menu_set_accel_group ((GtkMenu*) menu, accel_group); gtk_menu_tool_button_set_menu ((GtkMenuToolButton*)tool_item, menu); // New Download (accelerators) menu_item = gtk_image_menu_item_new_with_mnemonic (_("New _Download...")); gtk_menu_item_set_accel_path ((GtkMenuItem*) menu_item, UGTK_APP_ACCEL_PATH_NEW); #if GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 10 image = gtk_image_new_from_icon_name ("document-new", GTK_ICON_SIZE_MENU); #else image = gtk_image_new_from_stock (GTK_STOCK_NEW, GTK_ICON_SIZE_MENU); #endif gtk_image_menu_item_set_image ((GtkImageMenuItem*)menu_item, image); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); ugt->create_download = menu_item; // New Category menu_item = gtk_image_menu_item_new_with_mnemonic (_("New _Category...")); #if GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 10 image = gtk_image_new_from_icon_name ("gtk-dnd-multiple", GTK_ICON_SIZE_MENU); #else image = gtk_image_new_from_stock (GTK_STOCK_DND_MULTIPLE, GTK_ICON_SIZE_MENU); #endif gtk_image_menu_item_set_image ((GtkImageMenuItem*)menu_item, image); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); ugt->create_category = menu_item; // New Clipboard batch menu_item = gtk_image_menu_item_new_with_mnemonic (_("New Clipboard _batch...")); #if GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 10 image = gtk_image_new_from_icon_name ("edit-paste", GTK_ICON_SIZE_MENU); #else image = gtk_image_new_from_stock (GTK_STOCK_PASTE, GTK_ICON_SIZE_MENU); #endif gtk_image_menu_item_set_image ((GtkImageMenuItem*)menu_item, image); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); ugt->create_clipboard = menu_item; gtk_widget_show_all (menu); // New URL Sequence batch menu_item = gtk_image_menu_item_new_with_mnemonic (_("New _URL Sequence batch...")); #if GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 10 image = gtk_image_new_from_icon_name ("view-sort-ascending", GTK_ICON_SIZE_MENU); #else image = gtk_image_new_from_stock (GTK_STOCK_SORT_ASCENDING, GTK_ICON_SIZE_MENU); #endif gtk_image_menu_item_set_image ((GtkImageMenuItem*)menu_item, image); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); ugt->create_sequence = menu_item; gtk_widget_show_all (menu); gtk_menu_shell_append ((GtkMenuShell*)menu, gtk_separator_menu_item_new() ); // New Torrent menu_item = gtk_image_menu_item_new_with_mnemonic (_("New Torrent...")); // image = gtk_image_new_from_stock (GTK_STOCK_FILE, GTK_ICON_SIZE_MENU); // gtk_image_menu_item_set_image ((GtkImageMenuItem*)menu_item, image); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); ugt->create_torrent = menu_item; gtk_widget_show_all (menu); // New Metalink menu_item = gtk_image_menu_item_new_with_mnemonic (_("New Metalink...")); // image = gtk_image_new_from_stock (GTK_STOCK_FILE, GTK_ICON_SIZE_MENU); // gtk_image_menu_item_set_image ((GtkImageMenuItem*)menu_item, image); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); ugt->create_metalink = menu_item; gtk_widget_show_all (menu); // New button --- end --- #if GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 10 image = gtk_image_new_from_icon_name ("document-save", GTK_ICON_SIZE_SMALL_TOOLBAR); tool_item = (GtkToolItem*) gtk_tool_button_new (image, NULL); #else tool_item = (GtkToolItem*) gtk_tool_button_new_from_stock (GTK_STOCK_SAVE); #endif gtk_tool_item_set_tooltip_text (tool_item, _("Save all settings")); gtk_toolbar_insert (toolbar, tool_item, -1); ugt->save = GTK_WIDGET (tool_item); tool_item = gtk_separator_tool_item_new (); gtk_toolbar_insert (toolbar, tool_item, -1); #if GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 10 image = gtk_image_new_from_icon_name ("media-playback-start", GTK_ICON_SIZE_SMALL_TOOLBAR); tool_item = (GtkToolItem*) gtk_tool_button_new (image, NULL); #else tool_item = (GtkToolItem*) gtk_tool_button_new_from_stock (GTK_STOCK_MEDIA_PLAY); #endif gtk_tool_item_set_tooltip_text (tool_item, _("Set selected download runnable")); gtk_toolbar_insert (toolbar, tool_item, -1); ugt->runnable = GTK_WIDGET (tool_item); #if GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 10 image = gtk_image_new_from_icon_name ("media-playback-pause", GTK_ICON_SIZE_SMALL_TOOLBAR); tool_item = (GtkToolItem*) gtk_tool_button_new (image, NULL); #else tool_item = (GtkToolItem*) gtk_tool_button_new_from_stock (GTK_STOCK_MEDIA_PAUSE); #endif gtk_tool_item_set_tooltip_text (tool_item, _("Set selected download to pause")); gtk_toolbar_insert (toolbar, tool_item, -1); ugt->pause = GTK_WIDGET (tool_item); #if GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 10 image = gtk_image_new_from_icon_name ("document-properties", GTK_ICON_SIZE_SMALL_TOOLBAR); tool_item = (GtkToolItem*) gtk_tool_button_new (image, NULL); #else tool_item = (GtkToolItem*) gtk_tool_button_new_from_stock (GTK_STOCK_PROPERTIES); #endif gtk_tool_item_set_tooltip_text (tool_item, _("Set selected download properties")); gtk_toolbar_insert (toolbar, tool_item, -1); ugt->properties = GTK_WIDGET (tool_item); tool_item = gtk_separator_tool_item_new (); gtk_toolbar_insert (toolbar, tool_item, -1); #if GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 10 image = gtk_image_new_from_icon_name ("go-up", GTK_ICON_SIZE_SMALL_TOOLBAR); tool_item = (GtkToolItem*) gtk_tool_button_new (image, NULL); #else tool_item = (GtkToolItem*) gtk_tool_button_new_from_stock (GTK_STOCK_GO_UP); #endif gtk_tool_item_set_tooltip_text (tool_item, _("Move selected download up")); gtk_toolbar_insert (toolbar, tool_item, -1); ugt->move_up = GTK_WIDGET (tool_item); #if GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 10 image = gtk_image_new_from_icon_name ("go-down", GTK_ICON_SIZE_SMALL_TOOLBAR); tool_item = (GtkToolItem*) gtk_tool_button_new (image, NULL); #else tool_item = (GtkToolItem*) gtk_tool_button_new_from_stock (GTK_STOCK_GO_DOWN); #endif gtk_tool_item_set_tooltip_text (tool_item, _("Move selected download down")); gtk_toolbar_insert (toolbar, tool_item, -1); ugt->move_down = GTK_WIDGET (tool_item); #if GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 10 image = gtk_image_new_from_icon_name ("go-top", GTK_ICON_SIZE_SMALL_TOOLBAR); tool_item = (GtkToolItem*) gtk_tool_button_new (image, NULL); #else tool_item = (GtkToolItem*) gtk_tool_button_new_from_stock (GTK_STOCK_GOTO_TOP); #endif gtk_tool_item_set_tooltip_text (tool_item, _("Move selected download to top")); gtk_toolbar_insert (toolbar, tool_item, -1); ugt->move_top = GTK_WIDGET (tool_item); #if GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 10 image = gtk_image_new_from_icon_name ("go-bottom", GTK_ICON_SIZE_SMALL_TOOLBAR); tool_item = (GtkToolItem*) gtk_tool_button_new (image, NULL); #else tool_item = (GtkToolItem*) gtk_tool_button_new_from_stock (GTK_STOCK_GOTO_BOTTOM); #endif gtk_tool_item_set_tooltip_text (tool_item, _("Move selected download to bottom")); gtk_toolbar_insert (toolbar, tool_item, -1); ugt->move_bottom = GTK_WIDGET (tool_item); gtk_widget_show_all ((GtkWidget*) toolbar); } uget-2.2.0/ui-gtk/UgtkBanner.c0000644000175000000120000002305413224532612012776 00000000000000/* * * Copyright (C) 2005-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #include #include #include #include static GdkCursor* hand_cursor = NULL; static GdkCursor* regular_cursor = NULL; static gboolean motion_notify_event (GtkWidget* tv_widget, GdkEventMotion* event, UgtkBanner* banner); static gboolean event_after (GtkWidget* text_view, GdkEvent* ev, UgtkBanner* banner); static GtkWidget* create_x_button (UgtkBanner* banner); void ugtk_banner_init (struct UgtkBanner* banner) { GtkStyleContext* style_context; GdkRGBA rgba; hand_cursor = gdk_cursor_new (GDK_HAND2); regular_cursor = gdk_cursor_new (GDK_XTERM); banner->self = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); banner->buffer = gtk_text_buffer_new (NULL); banner->tag_link = gtk_text_buffer_create_tag (banner->buffer, NULL, "underline", PANGO_UNDERLINE_SINGLE, NULL); banner->text_view = (GtkTextView*) gtk_text_view_new_with_buffer (banner->buffer); g_object_unref (banner->buffer); gtk_text_view_set_cursor_visible (banner->text_view, FALSE); gtk_text_view_set_editable (banner->text_view, FALSE); gtk_box_pack_start (GTK_BOX (banner->self), GTK_WIDGET (banner->text_view), TRUE, TRUE, 0); g_signal_connect (banner->text_view, "event-after", G_CALLBACK (event_after), banner); g_signal_connect (banner->text_view, "motion-notify-event", G_CALLBACK (motion_notify_event), banner); // style: color style_context = gtk_widget_get_style_context (GTK_WIDGET (banner->text_view)); gtk_style_context_get_background_color (style_context, GTK_STATE_FLAG_SELECTED, &rgba); // gtk_widget_override_background_color ( // GTK_WIDGET (banner->text_view), GTK_STATE_FLAG_NORMAL, &rgba); gtk_style_context_get_color (style_context, GTK_STATE_FLAG_SELECTED, &rgba); // gtk_widget_override_color ( // GTK_WIDGET (banner->text_view), GTK_STATE_FLAG_NORMAL, &rgba); // close button gtk_box_pack_end (GTK_BOX (banner->self), create_x_button (banner), FALSE, FALSE, 0); banner->show_builtin = 2; banner->rss.self = NULL; banner->rss.feed = NULL; banner->rss.item = NULL; } int ugtk_banner_show_rss (UgtkBanner* banner, UgetRss* urss) { banner->rss.self = urss; banner->rss.feed = NULL; banner->rss.item = NULL; banner->rss.feed = uget_rss_find_updated (urss, NULL); if (banner->rss.feed) banner->rss.item = uget_rss_feed_find (banner->rss.feed, banner->rss.feed->checked); if (banner->rss.item) ugtk_banner_show (banner, banner->rss.item->title, banner->rss.item->link); else { gtk_widget_hide (banner->self); return FALSE; } return TRUE; } void ugtk_banner_show (UgtkBanner* banner, const char* title, const char* url) { GtkTextIter iter; gtk_text_buffer_set_text(banner->buffer, "", 0); gtk_text_buffer_get_iter_at_offset (banner->buffer, &iter, 0); gtk_text_buffer_insert (banner->buffer, &iter, " ", 2); g_free (banner->link); if (url == NULL) { banner->link = NULL; gtk_text_buffer_insert (banner->buffer, &iter, title, -1); } else { banner->link = g_strdup (url); gtk_text_buffer_insert_with_tags (banner->buffer, &iter, title, -1, banner->tag_link, NULL); } gtk_widget_show (banner->self); } void ugtk_banner_show_donation (UgtkBanner* banner) { GtkTextIter iter; gtk_text_buffer_set_text(banner->buffer, "", 0); gtk_text_buffer_get_iter_at_offset (banner->buffer, &iter, 0); gtk_text_buffer_insert (banner->buffer, &iter, " ", 2); gtk_text_buffer_insert (banner->buffer, &iter, _("Attention uGetters:"), -1); gtk_text_buffer_insert (banner->buffer, &iter, " ", 1); gtk_text_buffer_insert (banner->buffer, &iter, _("we are running a Donation Drive " "for uGet's Future Development, please click "), -1); gtk_text_buffer_insert_with_tags (banner->buffer, &iter, _("HERE"), -1, banner->tag_link, NULL); g_free (banner->link); banner->link = g_strdup ("http://ugetdm.com/donate"); gtk_widget_show (banner->self); } void ugtk_banner_show_survey (UgtkBanner* banner) { GtkTextIter iter; gtk_text_buffer_set_text(banner->buffer, "", 0); gtk_text_buffer_get_iter_at_offset (banner->buffer, &iter, 0); gtk_text_buffer_insert (banner->buffer, &iter, " ", 2); gtk_text_buffer_insert (banner->buffer, &iter, _("Attention uGetters:"), -1); gtk_text_buffer_insert (banner->buffer, &iter, " ", 1); gtk_text_buffer_insert (banner->buffer, &iter, _("please fill out this quick User Survey for uGet."), -1); gtk_text_buffer_insert (banner->buffer, &iter, " - ", 3); gtk_text_buffer_insert_with_tags (banner->buffer, &iter, _("click here to take survey"), -1, banner->tag_link, NULL); g_free (banner->link); banner->link = g_strdup ("http://ugetdm.com/survey"); gtk_widget_show (banner->self); } // ---------------------------------------------------------------------------- // static functions /* Links can also be activated by clicking. */ static gboolean event_after (GtkWidget* text_view, GdkEvent* ev, UgtkBanner* banner) { GtkTextIter start, end, iter; GtkTextBuffer *buffer; GdkEventButton *event; gint x, y; GSList* slist; if (ev->type != GDK_BUTTON_RELEASE) return FALSE; event = (GdkEventButton *)ev; if (event->button != GDK_BUTTON_PRIMARY) return FALSE; buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text_view)); /* we shouldn't follow a link if the user has selected something */ gtk_text_buffer_get_selection_bounds (buffer, &start, &end); if (gtk_text_iter_get_offset (&start) != gtk_text_iter_get_offset (&end)) return FALSE; gtk_text_view_window_to_buffer_coords (GTK_TEXT_VIEW (text_view), GTK_TEXT_WINDOW_WIDGET, (gint) event->x, (gint) event->y, &x, &y); gtk_text_view_get_iter_at_location (GTK_TEXT_VIEW (text_view), &iter, x, y); slist = gtk_text_iter_get_tags (&iter); if (slist) { if (banner->link) ugtk_launch_uri (banner->link); g_slist_free (slist); } return FALSE; } /* Update the cursor image if the pointer moved. */ /* Looks at all tags covering the position (x, y) in the text view, * and if one of them is a link, change the cursor to the "hands" cursor * typically used by web browsers. */ static gboolean motion_notify_event (GtkWidget* tv_widget, GdkEventMotion* event, UgtkBanner* banner) { GtkTextView* text_view; gint x, y; gboolean hovering = FALSE; GSList* slist; GtkTextIter iter; text_view = GTK_TEXT_VIEW (tv_widget); gtk_text_view_window_to_buffer_coords (text_view, GTK_TEXT_WINDOW_WIDGET, (gint) event->x, (gint) event->y, &x, &y); // set cursor if appropriate gtk_text_view_get_iter_at_location (text_view, &iter, x, y); slist = gtk_text_iter_get_tags (&iter); if (slist) hovering = TRUE; if (banner->hovering_over_link != hovering) { banner->hovering_over_link = hovering; if (banner->hovering_over_link) { gdk_window_set_cursor (gtk_text_view_get_window (text_view, GTK_TEXT_WINDOW_TEXT), hand_cursor); } else { gdk_window_set_cursor (gtk_text_view_get_window (text_view, GTK_TEXT_WINDOW_TEXT), regular_cursor); } } if (slist) g_slist_free (slist); return FALSE; } // ------------------------------------ static gboolean on_x_button_release (GtkWidget* text_view, GdkEvent* ev, UgtkBanner* banner) { GdkEventButton* event; event = (GdkEventButton*) ev; if (event->button != GDK_BUTTON_PRIMARY) return FALSE; if (banner->rss.self) { if (banner->rss.feed && banner->rss.item) banner->rss.feed->checked = banner->rss.item->updated; if (ugtk_banner_show_rss (banner, banner->rss.self)) return FALSE; } if (banner->show_builtin > 0) { banner->show_builtin--; if (banner->show_builtin == 1) ugtk_banner_show_donation (banner); else { ugtk_banner_show_survey (banner); banner->show_builtin = 0; } return FALSE; } gtk_widget_hide (banner->self); return FALSE; } static GtkWidget* create_x_button (UgtkBanner* banner) { GtkWidget* event_box; GtkWidget* label; label = gtk_label_new (" X "); event_box = gtk_event_box_new (); gtk_container_add (GTK_CONTAINER (event_box), label); g_signal_connect (event_box, "button-release-event", G_CALLBACK (on_x_button_release), banner); return event_box; } uget-2.2.0/ui-gtk/UgtkCategoryForm.h0000644000175000000120000000471513224532612014202 00000000000000/* * * Copyright (C) 2005-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #ifndef UGTK_CATEGORY_FORM_H #define UGTK_CATEGORY_FORM_H #include #include #ifdef __cplusplus extern "C" { #endif typedef struct UgtkCategoryForm UgtkCategoryForm; struct UgtkCategoryForm { GtkWidget* self; GtkWidget* name_label; GtkWidget* name_entry; GtkWidget* spin_active; GtkWidget* spin_finished; GtkWidget* spin_recycled; GtkWidget* hosts_label; GtkWidget* hosts_entry; GtkWidget* schemes_label; GtkWidget* schemes_entry; GtkWidget* types_label; GtkWidget* types_entry; }; void ugtk_category_form_init (UgtkCategoryForm* cform); void ugtk_category_form_get (UgtkCategoryForm* cform, UgetNode* cnode); void ugtk_category_form_set (UgtkCategoryForm* cform, UgetNode* cnode); void ugtk_category_form_set_multiple (UgtkCategoryForm* cform, gboolean multiple_mode); #ifdef __cplusplus } #endif #endif // End of UGTK_CATEGORY_FROM_H uget-2.2.0/ui-gtk/UgtkTraveler.c0000644000175000000120000006232613224532612013362 00000000000000/* * * Copyright (C) 2012-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #include #include // signal handler static void on_state_cursor_changed (GtkTreeView* view, UgtkTraveler* traveler); static void on_category_cursor_changed (GtkTreeView* view, UgtkTraveler* traveler); static void on_download_cursor_changed (GtkTreeView* view, UgtkTraveler* traveler); static void on_category_row_deleted (GtkTreeModel* model, GtkTreePath* path, UgtkTraveler* traveler); static void on_download_row_deleted (GtkTreeModel* model, GtkTreePath* path, UgtkTraveler* traveler); // static data const static void* sort_callbacks[UGTK_NODE_N_COLUMNS]; const static UgCompareFunc compare_funcs[UGTK_NODE_N_COLUMNS]; void ugtk_traveler_init (UgtkTraveler* traveler, UgtkApp* app) { GtkScrolledWindow* scroll; GtkTreePath* path; GtkTreeViewColumn* column; gint nth; traveler->app = app; // status traveler->state.self = ugtk_node_view_new_for_state (); traveler->state.view = GTK_TREE_VIEW (traveler->state.self); traveler->state.model = ugtk_node_list_new (NULL, 4, TRUE); gtk_tree_view_set_model (traveler->state.view, GTK_TREE_MODEL (traveler->state.model)); // category traveler->category.self = gtk_scrolled_window_new (NULL, NULL); traveler->category.view = (GtkTreeView*) ugtk_node_view_new_for_category (); traveler->category.model = ugtk_node_tree_new (&app->sorted, TRUE); ugtk_node_tree_set_prefix (traveler->category.model, &app->mix, 1); gtk_tree_view_set_model (traveler->category.view, GTK_TREE_MODEL (traveler->category.model)); gtk_widget_set_size_request (traveler->category.self, 165, 100); scroll = GTK_SCROLLED_WINDOW (traveler->category.self); gtk_scrolled_window_set_shadow_type (scroll, GTK_SHADOW_IN); gtk_scrolled_window_set_policy (scroll, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_container_add (GTK_CONTAINER (scroll), GTK_WIDGET (traveler->category.view)); // download traveler->download.self = gtk_scrolled_window_new (NULL, NULL); traveler->download.view = (GtkTreeView*) ugtk_node_view_new_for_download (); traveler->download.model = ugtk_node_tree_new (NULL, TRUE); gtk_tree_view_set_model (traveler->download.view, GTK_TREE_MODEL (traveler->download.model)); scroll = GTK_SCROLLED_WINDOW (traveler->download.self); gtk_scrolled_window_set_shadow_type (scroll, GTK_SHADOW_IN); gtk_scrolled_window_set_policy (scroll, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_container_add (GTK_CONTAINER (scroll), GTK_WIDGET (traveler->download.view)); path = gtk_tree_path_new_first (); gtk_tree_view_set_cursor (traveler->state.view, path, NULL, FALSE); gtk_tree_view_set_cursor (traveler->category.view, path, NULL, FALSE); gtk_tree_path_free (path); // cursor position traveler->state.cursor.pos = -1; traveler->category.cursor.pos = -1; traveler->download.cursor.pos = -1; // signal g_signal_connect (traveler->state.view, "cursor-changed", G_CALLBACK (on_state_cursor_changed), traveler); g_signal_connect (traveler->category.view, "cursor-changed", G_CALLBACK (on_category_cursor_changed), traveler); g_signal_connect (traveler->download.view, "cursor-changed", G_CALLBACK (on_download_cursor_changed), traveler); g_signal_connect (traveler->category.model, "row-deleted", G_CALLBACK (on_category_row_deleted), traveler); g_signal_connect (traveler->download.model, "row-deleted", G_CALLBACK (on_download_row_deleted), traveler); for (nth = UGTK_NODE_COLUMN_STATE; nth < UGTK_NODE_N_COLUMNS; nth++) { column = gtk_tree_view_get_column (traveler->download.view, nth); g_signal_connect (column, "clicked", G_CALLBACK (sort_callbacks[nth]), traveler); } } void ugtk_traveler_select_category (UgtkTraveler* traveler, int nth_category, int nth_state) { GtkTreePath* path; if (nth_category != -1) { path = gtk_tree_path_new (); gtk_tree_path_append_index (path, nth_category); gtk_tree_view_set_cursor (traveler->category.view, path, NULL, FALSE); gtk_tree_path_free (path); } if (nth_state != -1) { path = gtk_tree_path_new (); gtk_tree_path_append_index (path, nth_state); gtk_tree_view_set_cursor (traveler->state.view, path, NULL, FALSE); gtk_tree_path_free (path); } } void ugtk_traveler_set_cursor (UgtkTraveler* traveler, UgetNode* node) { GtkTreePath* path; GtkTreeIter iter; if (node && ugtk_traveler_get_iter (traveler, &iter, node)) { path = gtk_tree_model_get_path ( GTK_TREE_MODEL (traveler->download.model), &iter); if (path) { // traveler->download.cursor.node = iter.user_data; // traveler->download.cursor.pos = *gtk_tree_path_get_indices (path); gtk_tree_view_set_cursor (traveler->download.view, path, NULL, FALSE); gtk_tree_path_free (path); } } } UgetNode* ugtk_traveler_get_cursor (UgtkTraveler* traveler) { GtkTreePath* path; int nth; gtk_tree_view_get_cursor (traveler->download.view, &path, NULL); if (path == NULL) return NULL; nth = *gtk_tree_path_get_indices (path); gtk_tree_path_free (path); return uget_node_nth_child (traveler->download.model->root, nth); } gboolean ugtk_traveler_get_iter (UgtkTraveler* traveler, GtkTreeIter* iter, UgetNode* node) { if (node->parent == (UgetNode*) traveler->download.model->root) { iter->stamp = traveler->download.model->stamp; iter->user_data = node; return TRUE; } for (node = node->fake; node; node = node->peer) { if (ugtk_traveler_get_iter (traveler, iter, node)) return TRUE; } return FALSE; } GList* ugtk_traveler_get_selected (UgtkTraveler* traveler) { GtkTreeSelection* selection; GtkTreeModel* model; GtkTreeIter iter; GList* list; GList* nodes; GList* cur; selection = gtk_tree_view_get_selection (traveler->download.view); list = gtk_tree_selection_get_selected_rows (selection, &model); nodes = NULL; for (cur = list; cur; cur = cur->next) { gtk_tree_model_get_iter (model, &iter, cur->data); nodes = g_list_prepend (nodes, iter.user_data); } g_list_free_full (list, (GDestroyNotify) gtk_tree_path_free); return nodes; } void ugtk_traveler_set_selected (UgtkTraveler* traveler, GList* nodes) { GtkTreeSelection* selection; GtkTreeIter iter; selection = gtk_tree_view_get_selection (traveler->download.view); gtk_tree_selection_unselect_all (selection); for (; nodes; nodes = nodes->next) { if (nodes->data == NULL) continue; if (ugtk_traveler_get_iter (traveler, &iter, nodes->data)) gtk_tree_selection_select_iter (selection, &iter); } } GList* ugtk_traveler_reserve_selection (UgtkTraveler* traveler) { GList* list; GList* link; g_list_free_full (traveler->reserved.list, (GDestroyNotify) uget_node_unref); if (traveler->reserved.node) uget_node_unref (traveler->reserved.node); list = ugtk_traveler_get_selected (traveler); for (link = list; link; link = link->next) { link->data = ((UgetNode*)link->data)->data; uget_node_ref (link->data); } traveler->reserved.list = list; traveler->reserved.node = traveler->download.cursor.node; if (traveler->reserved.node) { traveler->reserved.node = traveler->reserved.node->data; uget_node_ref (traveler->reserved.node); } return list; } void ugtk_traveler_restore_selection (UgtkTraveler* traveler) { GList* list; UgetNode* node; list = traveler->reserved.list; node = traveler->reserved.node; ugtk_traveler_set_cursor (traveler, node); ugtk_traveler_set_selected (traveler, list); if (node) uget_node_unref (node); g_list_free_full (list, (GDestroyNotify) uget_node_unref); traveler->reserved.list = NULL; traveler->reserved.node = NULL; } gint ugtk_traveler_move_selected_up (UgtkTraveler* traveler) { GtkTreePath* path; UgetNode* node; UgetNode* prev; UgetNode* top; GList* list; GList* link; int counts = 0; list = ugtk_traveler_get_selected (traveler); list = g_list_reverse (list); for (top = NULL, link = list; link; link = link->next) { node = link->data; prev = node->prev; if (top == prev) { top = node; continue; } top = node; for (;;) { if (node->real == NULL || prev->real == NULL) break; if (node->real->parent != prev->real->parent) break; node = node->real; prev = prev->real; } uget_node_move (node->parent, prev, node); counts++; } if (counts > 0) { // scroll to first selected download and move cursor node = list->data; path = gtk_tree_path_new_from_indices ( uget_node_child_position (node->parent, node), -1); gtk_tree_view_scroll_to_cell (traveler->download.view, path, NULL, FALSE, 0, 0); gtk_tree_view_set_cursor (traveler->download.view, path, NULL, FALSE); gtk_tree_path_free (path); // redraw gtk_widget_queue_draw ((GtkWidget*) traveler->download.view); // change selected indices ugtk_traveler_set_selected (traveler, list); } g_list_free (list); return counts; } gint ugtk_traveler_move_selected_down (UgtkTraveler* traveler) { GtkTreePath* path; UgetNode* node; UgetNode* next; UgetNode* bottom; GList* list; GList* link; int counts = 0; list = ugtk_traveler_get_selected (traveler); for (bottom = NULL, link = list; link; link = link->next) { node = link->data; next = node->next; if (bottom == next) { bottom = node; continue; } bottom = node; for (;;) { if (node->real == NULL || next->real == NULL) break; if (node->real->parent != next->real->parent) break; node = node->real; next = next->real; } uget_node_move (node->parent, next->next, node); counts++; } if (counts > 0) { // scroll to last selected download and move cursor node = list->data; path = gtk_tree_path_new_from_indices ( uget_node_child_position (node->parent, node), -1); gtk_tree_view_scroll_to_cell (traveler->download.view, path, NULL, FALSE, 0, 0); gtk_tree_view_set_cursor (traveler->download.view, path, NULL, FALSE); gtk_tree_path_free (path); // redraw gtk_widget_queue_draw ((GtkWidget*) traveler->download.view); // change selected indices ugtk_traveler_set_selected (traveler, list); } g_list_free (list); return counts; } gint ugtk_traveler_move_selected_top (UgtkTraveler* traveler) { GtkTreePath* path; UgetNode* node; UgetNode* sibling; UgetNode* top; GList* list; GList* link; int counts = 0; list = ugtk_traveler_get_selected (traveler); list = g_list_reverse (list); node = list->data; top = node->parent->children; for (link = list; link; link = link->next) { node = link->data; if (top == node) { top = top->next; continue; } sibling = top; for (;;) { if (node->real == NULL || sibling->real == NULL) break; if (node->real->parent != sibling->real->parent) break; node = node->real; sibling = sibling->real; } uget_node_move (node->parent, sibling, node); counts++; } if (counts > 0) { // scroll to top and move cursor gtk_tree_view_scroll_to_point (traveler->download.view, -1, 0); path = gtk_tree_path_new_first (); gtk_tree_view_set_cursor (traveler->download.view, path, NULL, FALSE); gtk_tree_path_free (path); // redraw gtk_widget_queue_draw ((GtkWidget*) traveler->download.view); // change selected indices ugtk_traveler_set_selected (traveler, list); } g_list_free (list); return counts; } gint ugtk_traveler_move_selected_bottom (UgtkTraveler* traveler) { GtkTreePath* path; UgetNode* node; UgetNode* sibling; UgetNode* bottom; GList* list; GList* link; int counts = 0; list = ugtk_traveler_get_selected (traveler); node = list->data; bottom = node->parent->last; for (link = list; link; link = link->next) { node = link->data; if (bottom == node) { bottom = bottom->prev; continue; } sibling = bottom; for (;;) { if (node->real == NULL || sibling->real == NULL) break; if (node->real->parent != sibling->real->parent) break; node = node->real; sibling = sibling->real; } // check this for move to bottom only if (sibling->next == node) continue; // node will be inserted after sibling uget_node_move (node->parent, sibling->next, node); counts++; } if (counts > 0) { // scroll to bottom and move cursor node = list->data; path = gtk_tree_path_new_from_indices ( node->parent->n_children -1, -1); gtk_tree_view_scroll_to_cell (traveler->download.view, path, NULL, FALSE, 0, 0); gtk_tree_view_set_cursor (traveler->download.view, path, NULL, FALSE); gtk_tree_path_free (path); // redraw gtk_widget_queue_draw ((GtkWidget*) traveler->download.view); // change selected indices ugtk_traveler_set_selected (traveler, list); } g_list_free (list); return counts; } void ugtk_traveler_set_sorting (UgtkTraveler* traveler, gboolean sortable, UgtkNodeColumn nth_col, GtkSortType type) { GtkTreeViewColumn* column; UgtkNodeColumn pos; GList* selected; for (pos = 0; pos < UGTK_NODE_N_COLUMNS; pos++) { column = gtk_tree_view_get_column (traveler->download.view, pos); gtk_tree_view_column_set_clickable (column, sortable); // clear column sort status gtk_tree_view_column_set_sort_order (column, GTK_SORT_ASCENDING); gtk_tree_view_column_set_sort_indicator (column, FALSE); } if (nth_col >= UGTK_NODE_N_COLUMNS) return; selected = ugtk_traveler_get_selected (traveler); if (nth_col <= 0) uget_app_set_sorting ((UgetApp*) traveler->app, NULL, FALSE); else { column = gtk_tree_view_get_column (traveler->download.view, nth_col); gtk_tree_view_column_set_sort_order (column, type); gtk_tree_view_column_set_sort_indicator (column, TRUE); uget_app_set_sorting ((UgetApp*) traveler->app, compare_funcs[nth_col], (type == GTK_SORT_DESCENDING) ? TRUE : FALSE); } ugtk_traveler_set_selected (traveler, selected); g_list_free (selected); // redraw gtk_widget_queue_draw ((GtkWidget*) traveler->download.view); } // ---------------------------------------------------------------------------- // signal handler static void on_state_cursor_changed (GtkTreeView* view, UgtkTraveler* traveler) { GtkTreeModel* model; GtkTreePath* path; GtkTreeIter iter; // clear download cursor traveler->download.cursor.node = NULL; traveler->state.cursor.pos_last = traveler->state.cursor.pos; gtk_tree_view_get_cursor (view, &path, NULL); if (path == NULL) { traveler->state.cursor.pos = -1; traveler->state.cursor.node = NULL; return; } if (traveler->state.cursor.pos == gtk_tree_path_get_indices (path)[0]) return; traveler->state.cursor.pos = gtk_tree_path_get_indices (path)[0]; model = gtk_tree_view_get_model (view); gtk_tree_model_get_iter (model, &iter, path); gtk_tree_path_free (path); traveler->state.cursor.node = iter.user_data; // change download.model and refresh it's view gtk_tree_view_set_model (traveler->download.view, NULL); if (iter.user_data) { traveler->download.model->root = iter.user_data; gtk_tree_view_set_model (traveler->download.view, GTK_TREE_MODEL (traveler->download.model)); } } static void on_category_cursor_changed (GtkTreeView* view, UgtkTraveler* traveler) { GtkTreeModel* model; GtkTreePath* path; GtkTreeIter iter; // clear download cursor traveler->download.cursor.node = NULL; traveler->category.cursor.pos_last = traveler->category.cursor.pos; gtk_tree_view_get_cursor (view, &path, NULL); if (path == NULL) { traveler->category.cursor.pos = -1; traveler->category.cursor.node = NULL; return; } if (traveler->category.cursor.pos == gtk_tree_path_get_indices (path)[0]) return; traveler->category.cursor.pos = gtk_tree_path_get_indices (path)[0]; model = gtk_tree_view_get_model (view); gtk_tree_model_get_iter (model, &iter, path); gtk_tree_path_free (path); traveler->category.cursor.node = iter.user_data; // change state.model and refresh it's view model = GTK_TREE_MODEL (traveler->state.model); path = gtk_tree_path_new_from_indices (traveler->state.cursor.pos, -1); gtk_tree_view_set_model (traveler->state.view, NULL); traveler->state.model->root = iter.user_data; gtk_tree_view_set_model (traveler->state.view, model); gtk_tree_view_set_cursor (traveler->state.view, path, NULL, FALSE); gtk_tree_path_free (path); // traveler->state.view will emit signal "cursor_changed" and // call on_state_cursor_changed() } static void on_download_cursor_changed (GtkTreeView* view, UgtkTraveler* traveler) { GtkTreeModel* model; GtkTreePath* path; GtkTreeIter iter; traveler->download.cursor.pos_last = traveler->download.cursor.pos; gtk_tree_view_get_cursor (view, &path, NULL); if (path == NULL) { traveler->download.cursor.pos = -1; traveler->download.cursor.node = NULL; return; } traveler->download.cursor.pos = gtk_tree_path_get_indices (path)[0]; model = gtk_tree_view_get_model (view); gtk_tree_model_get_iter (model, &iter, path); gtk_tree_path_free (path); traveler->download.cursor.node = iter.user_data; } static void on_category_row_deleted (GtkTreeModel* model, GtkTreePath* p, UgtkTraveler* traveler) { GtkTreePath* path; GtkTreeIter iter; // update cursor position when row deleted gtk_tree_view_get_cursor (traveler->category.view, &path, NULL); if (path == NULL) { traveler->category.cursor.pos = 0; traveler->category.cursor.node = NULL; return; } gtk_tree_model_get_iter (model, &iter, path); traveler->category.cursor.node = iter.user_data; traveler->category.cursor.pos = gtk_tree_path_get_indices (path)[0]; gtk_tree_path_free (path); } static void on_download_row_deleted (GtkTreeModel* model, GtkTreePath* p, UgtkTraveler* traveler) { GtkTreePath* path; GtkTreeIter iter; // update cursor position when row deleted gtk_tree_view_get_cursor (traveler->download.view, &path, NULL); if (path == NULL) { traveler->download.cursor.node = NULL; traveler->download.cursor.pos = 0; return; } gtk_tree_model_get_iter (model, &iter, path); traveler->download.cursor.node = iter.user_data; traveler->download.cursor.pos = gtk_tree_path_get_indices (path)[0]; gtk_tree_path_free (path); } // ---------------------------------------------------------------------------- // signal handler for GtkTreeViewColumn static void ugtk_tree_view_column_clicked (GtkTreeViewColumn* column, UgtkNodeColumn nth_column, UgtkTraveler* traveler) { GtkSortType sorttype; UgtkApp* app; gint pos; // get column sort status column = gtk_tree_view_get_column (traveler->download.view, nth_column); sorttype = gtk_tree_view_column_get_sort_order (column); if (gtk_tree_view_column_get_sort_indicator (column)) { if (sorttype == GTK_SORT_ASCENDING) sorttype = GTK_SORT_DESCENDING; else sorttype = GTK_SORT_ASCENDING; } // clear column sort status for (pos = UGTK_NODE_COLUMN_NAME; pos < UGTK_NODE_N_COLUMNS; pos++) { GtkTreeViewColumn* tmp_column; tmp_column = gtk_tree_view_get_column (traveler->download.view, pos); gtk_tree_view_column_set_sort_order (tmp_column, GTK_SORT_ASCENDING); gtk_tree_view_column_set_sort_indicator (tmp_column, FALSE); } app = traveler->app; app->setting.download_column.sort.nth = nth_column; app->setting.download_column.sort.type = sorttype; if (nth_column > UGTK_NODE_COLUMN_STATE) { gtk_tree_view_column_set_sort_order (column, sorttype); gtk_tree_view_column_set_sort_indicator (column, TRUE); } uget_app_set_sorting ((UgetApp*) app, compare_funcs[nth_column], (sorttype == GTK_SORT_DESCENDING) ? TRUE : FALSE); // Any Category/Status can't move download position if they were sorted. ugtk_app_decide_download_sensitive (app); gtk_widget_queue_draw ((GtkWidget*) traveler->download.view); } static void on_state_column_clicked (GtkTreeViewColumn *column, UgtkTraveler* traveler) { ugtk_tree_view_column_clicked (column, UGTK_NODE_COLUMN_STATE, traveler); } static void on_name_column_clicked (GtkTreeViewColumn *column, UgtkTraveler* traveler) { ugtk_tree_view_column_clicked (column, UGTK_NODE_COLUMN_NAME, traveler); } static void on_complete_column_clicked (GtkTreeViewColumn *column, UgtkTraveler* traveler) { ugtk_tree_view_column_clicked (column, UGTK_NODE_COLUMN_COMPLETE, traveler); } static void on_size_column_clicked (GtkTreeViewColumn *column, UgtkTraveler* traveler) { ugtk_tree_view_column_clicked (column, UGTK_NODE_COLUMN_TOTAL, traveler); } static void on_percent_column_clicked (GtkTreeViewColumn *column, UgtkTraveler* traveler) { ugtk_tree_view_column_clicked (column, UGTK_NODE_COLUMN_PERCENT, traveler); } static void on_elapsed_column_clicked (GtkTreeViewColumn *column, UgtkTraveler* traveler) { ugtk_tree_view_column_clicked (column, UGTK_NODE_COLUMN_ELAPSED, traveler); } static void on_left_column_clicked (GtkTreeViewColumn *column, UgtkTraveler* traveler) { ugtk_tree_view_column_clicked (column, UGTK_NODE_COLUMN_LEFT, traveler); } static void on_speed_column_clicked (GtkTreeViewColumn *column, UgtkTraveler* traveler) { ugtk_tree_view_column_clicked (column, UGTK_NODE_COLUMN_SPEED, traveler); } static void on_upload_speed_column_clicked (GtkTreeViewColumn *column, UgtkTraveler* traveler) { ugtk_tree_view_column_clicked (column, UGTK_NODE_COLUMN_UPLOAD_SPEED, traveler); } static void on_uploaded_column_clicked (GtkTreeViewColumn *column, UgtkTraveler* traveler) { ugtk_tree_view_column_clicked (column, UGTK_NODE_COLUMN_UPLOADED, traveler); } static void on_ratio_column_clicked (GtkTreeViewColumn *column, UgtkTraveler* traveler) { ugtk_tree_view_column_clicked (column, UGTK_NODE_COLUMN_RATIO, traveler); } static void on_retry_column_clicked (GtkTreeViewColumn *column, UgtkTraveler* traveler) { ugtk_tree_view_column_clicked (column, UGTK_NODE_COLUMN_RETRY, traveler); } static void on_category_column_clicked (GtkTreeViewColumn *column, UgtkTraveler* traveler) { ugtk_tree_view_column_clicked (column, UGTK_NODE_COLUMN_CATEGORY, traveler); } static void on_url_column_clicked (GtkTreeViewColumn *column, UgtkTraveler* traveler) { ugtk_tree_view_column_clicked (column, UGTK_NODE_COLUMN_URI, traveler); } static void on_added_on_column_clicked (GtkTreeViewColumn *column, UgtkTraveler* traveler) { ugtk_tree_view_column_clicked (column, UGTK_NODE_COLUMN_ADDED_ON, traveler); } static void on_completed_on_column_clicked (GtkTreeViewColumn *column, UgtkTraveler* traveler) { ugtk_tree_view_column_clicked (column, UGTK_NODE_COLUMN_COMPLETED_ON, traveler); } // ---------------------------------------------------------------------------- // static data const static void* sort_callbacks[UGTK_NODE_N_COLUMNS] = { on_state_column_clicked, on_name_column_clicked, on_complete_column_clicked, on_size_column_clicked, on_percent_column_clicked, on_elapsed_column_clicked, on_left_column_clicked, on_speed_column_clicked, on_upload_speed_column_clicked, on_uploaded_column_clicked, on_ratio_column_clicked, on_retry_column_clicked, on_category_column_clicked, on_url_column_clicked, on_added_on_column_clicked, on_completed_on_column_clicked, }; const static UgCompareFunc compare_funcs[UGTK_NODE_N_COLUMNS] = { (UgCompareFunc) NULL, (UgCompareFunc) uget_node_compare_name, (UgCompareFunc) uget_node_compare_complete, (UgCompareFunc) uget_node_compare_size, (UgCompareFunc) uget_node_compare_percent, (UgCompareFunc) uget_node_compare_elapsed, (UgCompareFunc) uget_node_compare_left, (UgCompareFunc) uget_node_compare_speed, (UgCompareFunc) uget_node_compare_upload_speed, (UgCompareFunc) uget_node_compare_uploaded, (UgCompareFunc) uget_node_compare_ratio, (UgCompareFunc) uget_node_compare_retry, (UgCompareFunc) uget_node_compare_parent_name, (UgCompareFunc) uget_node_compare_uri, (UgCompareFunc) uget_node_compare_added_time, (UgCompareFunc) uget_node_compare_completed_time, }; uget-2.2.0/ui-gtk/UgtkNodeList.c0000644000175000000120000004373213224532612013317 00000000000000/* * * Copyright (C) 2012-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ /* * This file base on GTK+ 2.0 Tree View Tutorial - custom-list.c */ #include #define NODE_LIST_N_COLUMNS 1 /* boring declarations of local functions */ static void init (UgtkNodeList* ugtree); static void class_init (UgtkNodeListClass *klass); static void tree_model_init (GtkTreeModelIface *iface); static void finalize (GObject* object); static GtkTreeModelFlags get_flags (GtkTreeModel* tree_model); static gint get_n_columns (GtkTreeModel* tree_model); static GType get_column_type (GtkTreeModel* tree_model, gint index); static gboolean get_iter (GtkTreeModel* tree_model, GtkTreeIter* iter, GtkTreePath* path); static GtkTreePath* get_path (GtkTreeModel* tree_model, GtkTreeIter* iter); static void get_value (GtkTreeModel* tree_model, GtkTreeIter* iter, gint column, GValue* value); static gboolean iter_next (GtkTreeModel* tree_model, GtkTreeIter* iter); static gboolean iter_children (GtkTreeModel* tree_model, GtkTreeIter* iter, GtkTreeIter* parent); static gboolean iter_has_child (GtkTreeModel* tree_model, GtkTreeIter* iter); static gint iter_n_children (GtkTreeModel* tree_model, GtkTreeIter* iter); static gboolean iter_nth_child (GtkTreeModel* tree_model, GtkTreeIter* iter, GtkTreeIter* parent, gint n); static gboolean iter_parent (GtkTreeModel* tree_model, GtkTreeIter* iter, GtkTreeIter* child); static GObjectClass* parent_class = NULL; /* GObject stuff - nothing to worry about */ /***************************************************************************** * * class_init: more boilerplate GObject/GType stuff. * Init callback for the type system, * called once when our new class is created. * *****************************************************************************/ static void class_init (UgtkNodeListClass* klass) { GObjectClass *object_class; parent_class = (GObjectClass*) g_type_class_peek_parent (klass); object_class = (GObjectClass*) klass; object_class->finalize = finalize; } /***************************************************************************** * * tree_model_init: init callback for the interface registration * in ugtk_node_list_get_type. Here we override * the GtkTreeModel interface functions that * we implement. * *****************************************************************************/ static void tree_model_init (GtkTreeModelIface* iface) { iface->get_flags = get_flags; iface->get_n_columns = get_n_columns; iface->get_column_type = get_column_type; iface->get_iter = get_iter; iface->get_path = get_path; iface->get_value = get_value; iface->iter_next = iter_next; iface->iter_children = iter_children; iface->iter_has_child = iter_has_child; iface->iter_n_children = iter_n_children; iface->iter_nth_child = iter_nth_child; iface->iter_parent = iter_parent; } /***************************************************************************** * * init: this is called everytime a new object object * instance is created (we do that in g_object_new). * Initialise the list structure's fields here. * *****************************************************************************/ static void init (UgtkNodeList* ulist) { ulist->stamp = g_random_int(); /* Random int to check whether an iter belongs to our model */ } /***************************************************************************** * * finalize: this is called just before a object is * destroyed. Free dynamically allocated memory here. * *****************************************************************************/ static void finalize (GObject* object) { // UgtkNodeList *ulist = UGTK_NODE_LIST(object); // must chain up - finalize parent (*parent_class->finalize) (object); } /***************************************************************************** * * get_flags: tells the rest of the world whether our tree model * has any special characteristics. In our case, * we have a list model (instead of a tree), and each * tree iter is valid as long as the row in question * exists, as it only contains a pointer to our struct. * *****************************************************************************/ static GtkTreeModelFlags get_flags (GtkTreeModel* tree_model) { g_return_val_if_fail (UGTK_IS_NODE_LIST(tree_model), (GtkTreeModelFlags)0); return (GTK_TREE_MODEL_LIST_ONLY | GTK_TREE_MODEL_ITERS_PERSIST); } /***************************************************************************** * * get_n_columns: tells the rest of the world how many data * columns we export via the tree model interface * *****************************************************************************/ static gint get_n_columns (GtkTreeModel* tree_model) { g_return_val_if_fail (UGTK_IS_NODE_LIST(tree_model), 0); return NODE_LIST_N_COLUMNS; } /***************************************************************************** * * get_column_type: tells the rest of the world which type of * data an exported model column contains * *****************************************************************************/ static GType get_column_type (GtkTreeModel* tree_model, gint index) { g_return_val_if_fail (UGTK_IS_NODE_LIST(tree_model), G_TYPE_INVALID); g_return_val_if_fail (index < NODE_LIST_N_COLUMNS && index >= 0, G_TYPE_INVALID); return G_TYPE_POINTER; } /***************************************************************************** * * get_iter: converts a tree path (physical position) into a * tree iter structure (the content of the iter * fields will only be used internally by our model). * We simply store a pointer to our CustomRecord * structure that represents that row in the tree iter. * *****************************************************************************/ static gboolean get_iter (GtkTreeModel* tree_model, GtkTreeIter* iter, GtkTreePath* path) { UgtkNodeList* ulist; UgetNode* node; gint* indices; gint depth; g_assert (UGTK_IS_NODE_LIST(tree_model)); g_assert (path != NULL); ulist = UGTK_NODE_LIST(tree_model); if (ulist->root == NULL) return FALSE; indices = gtk_tree_path_get_indices(path); depth = gtk_tree_path_get_depth(path); g_assert (depth == 1); if (ulist->root_visible) { if (indices[0] == 0) node = ulist->root; else if (indices[0] <= ulist->n_fake) node = uget_node_nth_fake (ulist->root, indices[0] - 1); else return FALSE; } else { if (indices[0] < ulist->n_fake) node = uget_node_nth_fake (ulist->root, indices[0]); else return FALSE; } if (node == NULL) return FALSE; else { // We store a pointer to UgNode in the iter iter->stamp = ulist->stamp; iter->user_data = node; iter->user_data2 = NULL; /* unused */ iter->user_data3 = NULL; /* unused */ return TRUE; } } /***************************************************************************** * * get_path: converts a tree iter into a tree path (ie. the * physical position of that row in the list). * *****************************************************************************/ static GtkTreePath* get_path (GtkTreeModel* tree_model, GtkTreeIter* iter) { GtkTreePath* path; UgtkNodeList* ulist; UgetNode* node; gint n; g_return_val_if_fail (UGTK_IS_NODE_LIST(tree_model), NULL); g_return_val_if_fail (iter != NULL, NULL); g_return_val_if_fail (iter->user_data != NULL, NULL); node = iter->user_data; path = gtk_tree_path_new(); ulist = UGTK_NODE_LIST (tree_model); if (ulist->root_visible == FALSE) n = uget_node_fake_position (node->real, node); else { if (ulist->root == node) n = 0; else n = uget_node_fake_position (node->real, node) + 1; } gtk_tree_path_prepend_index (path, n); return path; } /***************************************************************************** * * get_value: Returns a row's exported data columns * (_get_value is what gtk_tree_model_get uses) * *****************************************************************************/ static void get_value (GtkTreeModel* tree_model, GtkTreeIter* iter, gint column, GValue* value) { // UgtkNodeList* ulist; g_return_if_fail (UGTK_IS_NODE_LIST (tree_model)); g_return_if_fail (iter != NULL); g_return_if_fail (column < NODE_LIST_N_COLUMNS); g_value_init (value, G_TYPE_POINTER); // ulist = UGTK_NODE_LIST (tree_model); g_value_set_pointer (value, iter->user_data); } /***************************************************************************** * * iter_next: Takes an iter structure and sets it to point * to the next row. * *****************************************************************************/ static gboolean iter_next (GtkTreeModel* tree_model, GtkTreeIter* iter) { UgtkNodeList* ulist; UgetNode* node; g_return_val_if_fail (UGTK_IS_NODE_LIST (tree_model), FALSE); ulist = UGTK_NODE_LIST(tree_model); if (ulist->root == NULL) return FALSE; node = iter->user_data; if (ulist->root_visible && ulist->root == node) node = node->fake; else node = node->peer; if (node == NULL || uget_node_fake_position (node->real, node) >= ulist->n_fake) return FALSE; else { iter->stamp = ulist->stamp; iter->user_data = node; return TRUE; } } /***************************************************************************** * * iter_children: Returns TRUE or FALSE depending on whether * the row specified by 'parent' has any children. * If it has children, then 'iter' is set to * point to the first child. Special case: if * 'parent' is NULL, then the first top-level * row should be returned if it exists. * *****************************************************************************/ static gboolean iter_children (GtkTreeModel* tree_model, GtkTreeIter* iter, GtkTreeIter* parent) { UgtkNodeList* ulist; UgetNode* node; g_return_val_if_fail (UGTK_IS_NODE_LIST (tree_model), FALSE); g_return_val_if_fail (parent == NULL, FALSE); ulist = UGTK_NODE_LIST (tree_model); if (ulist->root == NULL) return FALSE; if (ulist->root_visible) node = ulist->root; else node = ulist->root->fake; // Set iter to first child item. if (node == NULL) return FALSE; else { iter->stamp = ulist->stamp; iter->user_data = node; return TRUE; } } /***************************************************************************** * * iter_has_child: Returns TRUE or FALSE depending on whether * the row specified by 'iter' has any children. * We only have a list and thus no children. * *****************************************************************************/ static gboolean iter_has_child (GtkTreeModel* tree_model, GtkTreeIter* iter) { return FALSE; } /***************************************************************************** * * iter_n_children: Returns the number of children the row * specified by 'iter' has. This is usually 0, * as we only have a list and thus do not have * any children to any rows. A special case is * when 'iter' is NULL, in which case we need * to return the number of top-level nodes, * ie. the number of rows in our list. * *****************************************************************************/ static gint iter_n_children (GtkTreeModel* tree_model, GtkTreeIter* iter) { UgtkNodeList* ulist; UgetNode* node; gint n = 0; g_return_val_if_fail (UGTK_IS_NODE_LIST (tree_model), -1); g_return_val_if_fail (iter == NULL, -1); ulist = UGTK_NODE_LIST (tree_model); if (ulist->root == NULL) return 0; node = iter->user_data; for (n = 0, node = node->fake; node; node = node->peer) n++; if (n > ulist->n_fake) n = ulist->n_fake; if (ulist->root_visible) n++; return n; } /***************************************************************************** * * iter_nth_child: If the row specified by 'parent' has any * children, set 'iter' to the n-th child and * return TRUE if it exists, otherwise FALSE. * A special case is when 'parent' is NULL, in * which case we need to set 'iter' to the n-th * row if it exists. * *****************************************************************************/ static gboolean iter_nth_child (GtkTreeModel* tree_model, GtkTreeIter* iter, GtkTreeIter* parent, gint n) { UgtkNodeList* ulist; UgetNode* node; g_return_val_if_fail (UGTK_IS_NODE_LIST (tree_model), FALSE); g_return_val_if_fail (parent == NULL, FALSE); ulist = UGTK_NODE_LIST (tree_model); if (ulist->root == NULL) return FALSE; if (ulist->root_visible) { if (n == 0) node = ulist->root; else if (n <= ulist->n_fake) node = uget_node_nth_fake (ulist->root, n - 1); else return FALSE; } else { if (n < ulist->n_fake) node = uget_node_nth_fake (ulist->root, n); else return FALSE; } if (node == NULL) return FALSE; else { iter->stamp = ulist->stamp; iter->user_data = node; return TRUE; } } /***************************************************************************** * * iter_parent: Point 'iter' to the parent node of 'child'. As * we have a list and thus no children and no * parents of children, we can just return FALSE. * *****************************************************************************/ static gboolean iter_parent (GtkTreeModel* tree_model, GtkTreeIter* iter, GtkTreeIter* child) { return FALSE; } /***************************************************************************** * * ugtk_node_list_get_type: here we register our new type and its interfaces * with the type system. If you want to implement * additional interfaces like GtkTreeSortable, you * will need to do it here. * *****************************************************************************/ GType ugtk_node_list_get_type (void) { static GType ugtk_node_list_type = 0; /* Some boilerplate type registration stuff */ if (ugtk_node_list_type == 0) { static const GTypeInfo ugtk_node_list_info = { sizeof (UgtkNodeListClass), NULL, /* base_init */ NULL, /* base_finalize */ (GClassInitFunc) class_init, NULL, /* class finalize */ NULL, /* class_data */ sizeof (UgtkNodeList), 0, /* n_preallocs */ (GInstanceInitFunc) init }; static const GInterfaceInfo tree_model_info = { (GInterfaceInitFunc) tree_model_init, NULL, NULL }; /* First register the new derived type with the GObject type system */ ugtk_node_list_type = g_type_register_static (G_TYPE_OBJECT, "UgtkNodeList", &ugtk_node_list_info, (GTypeFlags)0); /* Now register our GtkTreeModel interface with the type system */ g_type_add_interface_static (ugtk_node_list_type, GTK_TYPE_TREE_MODEL, &tree_model_info); } return ugtk_node_list_type; } /***************************************************************************** * * ugtk_node_list_new: This is what you use in your own code to create a * new tree model for you to use. * *****************************************************************************/ UgtkNodeList* ugtk_node_list_new (UgetNode* root, gint n_fake, gboolean root_visible) { UgtkNodeList* ulist; ulist = (UgtkNodeList*) g_object_new (UGTK_TYPE_NODE_LIST, NULL); ulist->root = root; ulist->n_fake = n_fake; ulist->root_visible = root_visible; g_assert( ulist != NULL ); return ulist; } uget-2.2.0/ui-gtk/UgtkSetting.h0000644000175000000120000001367513224532612013223 00000000000000/* * * Copyright (C) 2012-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #ifndef UGTK_SETTING_H #define UGTK_SETTING_H #ifdef HAVE_CONFIG_H #include #endif #include #include #include #ifdef __cplusplus extern "C" { #endif typedef struct UgtkSetting UgtkSetting; typedef enum { UGTK_SCHEDULE_TURN_OFF, UGTK_SCHEDULE_UPLOAD_ONLY, // reserve UGTK_SCHEDULE_LIMITED_SPEED, UGTK_SCHEDULE_NORMAL, UGTK_SCHEDULE_N_STATE, } UgtkScheduleState; typedef enum { UGTK_PLUGIN_ORDER_CURL, UGTK_PLUGIN_ORDER_ARIA2, UGTK_PLUGIN_ORDER_CURL_ARIA2, UGTK_PLUGIN_ORDER_ARIA2_CURL, UGTK_PLUGIN_N_ORDER, } UgtkPluginOrder; struct UgtkSetting { // "WindowSetting" struct UgtkWindowSetting { // visible: boolean int toolbar; int statusbar; int category; int summary; int banner; // window position: int int x; int y; int width; int height; // window ststus: boolean int maximized; // user action int nth_category; int nth_state; int paned_position_h; int paned_position_v; } window; // "SummarySetting" struct UgtkSummarySetting { // visible: boolean int name; int folder; int category; int uri; int message; } summary; // "DownloadColumn" struct UgtkDownloadColumnSetting { // visible: boolean int complete; int total; int percent; int elapsed; // consuming time int left; // remaining time int speed; int upload_speed; int uploaded; int ratio; int retry; int category; int uri; int added_on; int completed_on; // width: integer struct UgtkDownloadColumnWidth { int state; // state icon int name; int complete; int total; int percent; int elapsed; // consuming time int left; // remaining time int speed; int upload_speed; int uploaded; int ratio; int retry; int category; int uri; int added_on; int completed_on; } width; struct { int type; // GtkSortType int nth; // UgtkNodeColumn } sort; } download_column; // "UserInterface" struct UgtkUserInterfaceSetting { // boolean int exit_confirmation; int delete_confirmation; int show_trayicon; int start_in_tray; int close_to_tray; int start_in_offline_mode; int start_notification; int sound_notification; int apply_recent; int skip_existing; int large_icon; #ifdef HAVE_APP_INDICATOR int app_indicator; #endif } ui; // "ClipboardSetting" struct UgtkClipboardSetting { char* pattern; int monitor; int quiet; int nth_category; int website; } clipboard; // "BandwidthSetting" - global speed limits struct UgtkBandwidthSetting { struct { int upload; // KiB / second int download; // KiB / second } normal, scheduler; } bandwidth; // "SchedulerSetting" struct UgtkSchedulerSetting { int enable; UgArrayInt state; // [7][24] 1 week, 7 days, 24 hours } scheduler; // "CommandlineSetting" struct UgtkCommandlineSetting { int quiet; // --quiet int nth_category; // --category-index } commandline; // "PluginOrder" int plugin_order; // UgtkPluginOrder: matching order // UgetPluginAria2 option struct UgtkPluginAria2Setting { // aria2 speed limit struct { int download; // KiB / second int upload; // KiB / second } limit; // aria2 options int launch; int shutdown; char* token; char* path; char* args; char* uri; } aria2; // UgetPluginMedia option struct UgtkPluginMediaSetting { int match_mode; int quality; int type; } media; // Completion Auto-Actions struct UgtkCompletionSetting { int remember; int action; char* command; char* on_error; } completion; struct UgtkAutoSaveSetting { int enable; int interval; } auto_save; // "FolderHistory" UgList folder_history; int offline_mode; }; void ugtk_setting_init (UgtkSetting* setting); int ugtk_setting_save (UgtkSetting* setting, const char* file); int ugtk_setting_load (UgtkSetting* setting, const char* file); void ugtk_setting_reset (UgtkSetting* setting); void ugtk_setting_add_folder (UgtkSetting* setting, const char* folder); void ugtk_setting_fix_data (UgtkSetting* setting); #ifdef __cplusplus } #endif #endif // UGTK_SETTING_H uget-2.2.0/ui-gtk/UgtkNodeView.c0000644000175000000120000010564113224532612013314 00000000000000/* * * Copyright (C) 2012-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #include #include #include #include #include #include #include // ------------------------------------ // column data & functions for Common #if GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 10 static const UgPair state_icon_pair[] = { {(void*)(intptr_t) UGET_STATE_FINISHED, "go-last"}, {(void*)(intptr_t) UGET_STATE_RECYCLED, "list-remove"}, {(void*)(intptr_t) UGET_STATE_PAUSED, "media-playback-pause"}, {(void*)(intptr_t) UGET_STATE_ERROR, "dialog-error"}, {(void*)(intptr_t) UGET_STATE_UPLOADING, "go-up"}, {(void*)(intptr_t) UGET_STATE_COMPLETED, "gtk-yes"}, {(void*)(intptr_t) UGET_STATE_QUEUING, "text-x-generic"}, {(void*)(intptr_t) UGET_STATE_ACTIVE, "media-playback-start"}, }; #else static const UgPair state_icon_pair[] = { {(void*)(intptr_t) UGET_STATE_FINISHED, GTK_STOCK_GOTO_LAST}, {(void*)(intptr_t) UGET_STATE_RECYCLED, GTK_STOCK_DELETE}, {(void*)(intptr_t) UGET_STATE_PAUSED, GTK_STOCK_MEDIA_PAUSE}, {(void*)(intptr_t) UGET_STATE_ERROR, GTK_STOCK_DIALOG_ERROR}, {(void*)(intptr_t) UGET_STATE_UPLOADING, GTK_STOCK_GO_UP}, {(void*)(intptr_t) UGET_STATE_COMPLETED, GTK_STOCK_YES}, {(void*)(intptr_t) UGET_STATE_QUEUING, GTK_STOCK_FILE}, {(void*)(intptr_t) UGET_STATE_ACTIVE, GTK_STOCK_MEDIA_PLAY}, }; #endif static const int state_icon_pair_len = sizeof (state_icon_pair) / sizeof (UgPair); static void col_set_icon (GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, GtkTreeModel *model, GtkTreeIter *iter, gpointer data) { UgetNode* node; const gchar* icon_name; int key, index; // gtk_tree_model_get (model, iter, 0, &node, -1); node = iter->user_data; // avoid crash in GTK3 if (node == NULL) return; node = node->data; #if GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 10 icon_name = "text-x-generic"; #else icon_name = GTK_STOCK_FILE; #endif // select icon_name for (index = 0; index < state_icon_pair_len; index++) { key = (intptr_t)state_icon_pair[index].key; if ((key & node->state) == key) { icon_name = state_icon_pair[index].data; break; } } #if GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 10 g_object_set (cell, "icon-name", icon_name, NULL); #else g_object_set (cell, "stock-id", icon_name, NULL); #endif } // ------------------------------------ // column functions for Download static void col_set_name (GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, GtkTreeModel *model, GtkTreeIter *iter, gpointer data) { // UgtkNodeTree* utree; UgetCommon* common; UgetNode* node; char* name; // gtk_tree_model_get (model, iter, 0, &node, -1); node = iter->user_data; // avoid crash in GTK3 if (node == NULL) return; // if (UGTK_IS_NODE_TREE (model)) { // // prefix.root // utree = UGTK_NODE_TREE (model); // if (utree->prefix.root && utree->prefix.root->children == node) { // g_object_set (cell, "text", utree->prefix.name, NULL); // return; // } // } node = node->data; name = _("unnamed"); if (node->name) name = node->name; else { common = ug_info_get (&node->info, UgetCommonInfo); if (common) { if (common->file) name = common->file; else if (common->uri) name = common->uri; } } g_object_set (cell, "text", name, NULL); } static void col_set_complete (GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, GtkTreeModel *model, GtkTreeIter *iter, gpointer data) { UgetNode* node; UgetProgress* progress; char* string; // gtk_tree_model_get (model, iter, 0, &node, -1); node = iter->user_data; // avoid crash in GTK3 if (node == NULL) return; node = node->data; progress = ug_info_get (&node->info, UgetProgressInfo); if (progress && progress->total) string = ug_str_from_int_unit (progress->complete, NULL); else string = NULL; g_object_set (cell, "text", string, NULL); ug_free (string); } static void col_set_total (GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, GtkTreeModel *model, GtkTreeIter *iter, gpointer data) { UgetNode* node; UgetProgress* progress; char* string; // gtk_tree_model_get (model, iter, 0, &node, -1); node = iter->user_data; // avoid crash in GTK3 if (node == NULL) return; node = node->data; progress = ug_info_get (&node->info, UgetProgressInfo); if (progress && progress->total) string = ug_str_from_int_unit (progress->total, NULL); else string = NULL; g_object_set (cell, "text", string, NULL); ug_free (string); } static void col_set_percent (GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, GtkTreeModel *model, GtkTreeIter *iter, gpointer data) { UgetNode* node; UgetProgress* progress; char* string; // gtk_tree_model_get (model, iter, 0, &node, -1); node = iter->user_data; // avoid crash in GTK3 if (node == NULL) return; node = node->data; progress = ug_info_get (&node->info, UgetProgressInfo); if (progress && progress->total) { string = ug_strdup_printf ("%d%c", progress->percent, '%'); g_object_set (cell, "visible", TRUE, NULL); g_object_set (cell, "value", progress->percent, NULL); g_object_set (cell, "text", string, NULL); ug_free (string); } else { g_object_set (cell, "visible", FALSE, NULL); g_object_set (cell, "value", 0, NULL); g_object_set (cell, "text", "", NULL); } } // consume time static void col_set_elapsed (GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, GtkTreeModel *model, GtkTreeIter *iter, gpointer data) { UgetNode* node; UgetProgress* progress; char* string; // gtk_tree_model_get (model, iter, 0, &node, -1); node = iter->user_data; // avoid crash in GTK3 if (node == NULL) return; node = node->data; progress = ug_info_get (&node->info, UgetProgressInfo); if (progress) string = ug_str_from_seconds ((int) progress->elapsed, TRUE); else string = NULL; g_object_set (cell, "text", string, NULL); ug_free (string); } // remain time static void col_set_left (GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, GtkTreeModel *model, GtkTreeIter *iter, gpointer data) { UgetNode* node; UgetProgress* progress; UgetRelation* relation; char* string; // gtk_tree_model_get (model, iter, 0, &node, -1); node = iter->user_data; // avoid crash in GTK3 if (node == NULL) return; node = node->data; progress = ug_info_get (&node->info, UgetProgressInfo); relation = ug_info_get (&node->info, UgetRelationInfo); if (progress && relation && relation->task.plugin) string = ug_str_from_seconds ((int) progress->left, TRUE); else string = NULL; g_object_set (cell, "text", string, NULL); ug_free (string); } static void col_set_speed (GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, GtkTreeModel *model, GtkTreeIter *iter, gpointer data) { UgetNode* node; UgetProgress* progress; UgetRelation* relation; char* string; // gtk_tree_model_get (model, iter, 0, &node, -1); node = iter->user_data; // avoid crash in GTK3 if (node == NULL) return; node = node->data; progress = ug_info_get (&node->info, UgetProgressInfo); relation = ug_info_get (&node->info, UgetRelationInfo); if (progress && relation && relation->task.plugin) string = ug_str_from_int_unit (progress->download_speed, "/s"); else string = NULL; g_object_set (cell, "text", string, NULL); ug_free (string); } static void col_set_upload_speed (GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, GtkTreeModel *model, GtkTreeIter *iter, gpointer data) { UgetNode* node; UgetProgress* progress; UgetRelation* relation; char* string; // gtk_tree_model_get (model, iter, 0, &node, -1); node = iter->user_data; // avoid crash in GTK3 if (node == NULL) return; node = node->data; progress = ug_info_get (&node->info, UgetProgressInfo); relation = ug_info_get (&node->info, UgetRelationInfo); if (progress && relation && relation->task.plugin && progress->upload_speed) string = ug_str_from_int_unit (progress->upload_speed, "/s"); else string = NULL; g_object_set (cell, "text", string, NULL); ug_free (string); } static void col_set_uploaded (GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, GtkTreeModel *model, GtkTreeIter *iter, gpointer data) { UgetNode* node; UgetProgress* progress; char* string; // gtk_tree_model_get (model, iter, 0, &node, -1); node = iter->user_data; // avoid crash in GTK3 if (node == NULL) return; node = node->data; progress = ug_info_get (&node->info, UgetProgressInfo); if (progress && progress->uploaded) string = ug_str_from_int_unit (progress->uploaded, NULL); else string = NULL; g_object_set (cell, "text", string, NULL); ug_free (string); } static void col_set_ratio (GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, GtkTreeModel *model, GtkTreeIter *iter, gpointer data) { UgetNode* node; UgetProgress* progress; char* string; // gtk_tree_model_get (model, iter, 0, &node, -1); node = iter->user_data; // avoid crash in GTK3 if (node == NULL) return; node = node->data; progress = ug_info_get (&node->info, UgetProgressInfo); if (progress && progress->ratio) string = ug_strdup_printf ("%.2f", progress->ratio); else string = NULL; g_object_set (cell, "text", string, NULL); ug_free (string); } static void col_set_retry (GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, GtkTreeModel *model, GtkTreeIter *iter, gpointer data) { UgetNode* node; UgetCommon* common; char* string; // gtk_tree_model_get (model, iter, 0, &node, -1); node = iter->user_data; // avoid crash in GTK3 if (node == NULL) return; node = node->data; common = ug_info_get (&node->info, UgetCommonInfo); if (common == NULL || common->retry_count == 0) string = NULL; else if (common->retry_count < 100) string = ug_strdup_printf ("%d", common->retry_count); else { g_object_set (cell, "text", "> 99", NULL); return; } g_object_set (cell, "text", string, NULL); ug_free (string); } static void col_set_category (GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, GtkTreeModel *model, GtkTreeIter *iter, gpointer data) { UgetNode* node; char* string; // gtk_tree_model_get (model, iter, 0, &node, -1); node = iter->user_data; // avoid crash in GTK3 if (node == NULL) return; node = node->data; if (node->parent) string = node->parent->name; else string = NULL; g_object_set (cell, "text", string, NULL); } static void col_set_uri (GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, GtkTreeModel *model, GtkTreeIter *iter, gpointer data) { UgetNode* node; UgetCommon* common; char* string; // gtk_tree_model_get (model, iter, 0, &node, -1); node = iter->user_data; // avoid crash in GTK3 if (node == NULL) return; node = node->data; common = ug_info_get (&node->info, UgetCommonInfo); if (common) string = common->uri; else string = NULL; g_object_set (cell, "text", string, NULL); } static void col_set_added_on (GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, GtkTreeModel *model, GtkTreeIter *iter, gpointer data) { UgetNode* node; UgetLog* ulog; char* string; // gtk_tree_model_get (model, iter, 0, &node, -1); node = iter->user_data; // avoid crash in GTK3 if (node == NULL) return; node = node->data; ulog = ug_info_get (&node->info, UgetLogInfo); if (ulog && ulog->added_time) string = ug_str_from_time (ulog->added_time, FALSE); else string = NULL; g_object_set (cell, "text", string, NULL); ug_free (string); } static void col_set_completed_on (GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, GtkTreeModel *model, GtkTreeIter *iter, gpointer data) { UgetNode* node; UgetLog* ulog; char* string; // gtk_tree_model_get (model, iter, 0, &node, -1); node = iter->user_data; // avoid crash in GTK3 if (node == NULL) return; node = node->data; ulog = ug_info_get (&node->info, UgetLogInfo); if (ulog && ulog->completed_time) string = ug_str_from_time (ulog->completed_time, FALSE); else string = NULL; g_object_set (cell, "text", string, NULL); ug_free (string); } // ------------------------------------ // column functions for Category, Status static void col_set_quantity (GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, GtkTreeModel *model, GtkTreeIter *iter, gpointer data) { UgetNode* node; gchar* quantity; // gtk_tree_model_get (model, iter, 0, &node, -1); node = iter->user_data; // avoid crash in GTK3 if (node == NULL) return; quantity = ug_strdup_printf ("%u", node->n_children); g_object_set (cell, "text", quantity, NULL); ug_free (quantity); } // ------------------------------------ // column functions for Category static void col_set_name_c (GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, GtkTreeModel *model, GtkTreeIter *iter, gpointer data) { UgetNode* node; char* name; // gtk_tree_model_get (model, iter, 0, &node, -1); node = iter->user_data; // avoid crash in GTK3 if (node == NULL) return; // if (UGTK_IS_NODE_TREE (model)) { // UgtkNodeTree* utree; // // prefix.root // utree = UGTK_NODE_TREE (model); // if (utree->prefix.root && utree->prefix.root->children == node) { // g_object_set (cell, "text", _("All Category"), NULL); // return; // } // } node = node->data; if (node->name) name = node->name; else name = _("unnamed"); g_object_set (cell, "text", name, NULL); } static void col_set_icon_c (GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, GtkTreeModel *model, GtkTreeIter *iter, gpointer data) { UgetNode* node; node = iter->user_data; #if GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 10 if (node->state & UGET_STATE_PAUSED) g_object_set (cell, "icon-name", "media-playback-pause", NULL); else g_object_set (cell, "icon-name", "gtk-dnd-multiple", NULL); #else if (node->state & UGET_STATE_PAUSED) g_object_set (cell, "stock-id", GTK_STOCK_MEDIA_PAUSE, NULL); else g_object_set (cell, "stock-id", GTK_STOCK_DND_MULTIPLE, NULL); #endif } // ------------------------------------ // column functions for Status static const UgPair state_name_pair[] = { {(void*)(intptr_t) UGET_STATE_ERROR, N_("Error")}, {(void*)(intptr_t) UGET_STATE_PAUSED, N_("Paused")}, {(void*)(intptr_t) UGET_STATE_UPLOADING, N_("Uploading")}, {(void*)(intptr_t) UGET_STATE_COMPLETED, N_("Completed")}, {(void*)(intptr_t) UGET_STATE_FINISHED, N_("Finished")}, {(void*)(intptr_t) UGET_STATE_RECYCLED, N_("Recycled")}, {(void*)(intptr_t) UGET_STATE_QUEUING, N_("Queuing")}, {(void*)(intptr_t) UGET_STATE_ACTIVE, N_("Active")}, }; static const int state_name_pair_len = sizeof (state_name_pair) / sizeof (UgPair); static void col_set_name_s (GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, GtkTreeModel *model, GtkTreeIter *iter, gpointer data) { UgetNode* node; char* name; int key; int index; // gtk_tree_model_get (model, iter, 0, &node, -1); node = iter->user_data; // avoid crash in GTK3 if (node == NULL) return; name = _("All Status"); if (node->real) { for (index = 0; index < state_name_pair_len; index++) { key = (intptr_t)state_name_pair[index].key; if ((key & node->state) == key) { name = gettext (state_name_pair[index].data); break; } } } g_object_set (cell, "text", name, NULL); } static void col_set_icon_s (GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, GtkTreeModel *model, GtkTreeIter *iter, gpointer data) { UgetNode* node; const gchar* icon_name; int key, index; // gtk_tree_model_get (model, iter, 0, &node, -1); node = iter->user_data; // avoid crash in GTK3 if (node == NULL) return; // select icon_name #if GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 10 icon_name = "gtk-dnd-multiple"; #else icon_name = GTK_STOCK_DND_MULTIPLE; #endif if (node->real) { for (index = 0; index < state_icon_pair_len; index++) { key = (intptr_t)state_icon_pair[index].key; if ((key & node->state) == key) { icon_name = state_icon_pair[index].data; break; } } } #if GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 10 g_object_set (cell, "icon-name", icon_name, NULL); #else g_object_set (cell, "stock-id", icon_name, NULL); #endif } // ---------------------------------------------------------------------------- // UgtkNodeView static GtkWidget* ugtk_node_view_new (GtkTreeCellDataFunc icon_func, GtkTreeCellDataFunc name_func, const gchar* name_title) { GtkTreeView* view; GtkCellRenderer* renderer; GtkTreeViewColumn* column; view = (GtkTreeView*)gtk_tree_view_new (); // UGTK_NODE_COLUMN_STATE // GtkCellRendererPixbuf "stock-size" = 1, 16x16 column = gtk_tree_view_column_new (); // gtk_tree_view_column_set_title (column, ""); renderer = gtk_cell_renderer_pixbuf_new (); gtk_tree_view_column_pack_start (column, renderer, FALSE); gtk_tree_view_column_set_cell_data_func (column, renderer, icon_func, NULL, NULL); // gtk_tree_view_column_set_resizable (column, FALSE); gtk_tree_view_column_set_min_width (column, 18); gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_FIXED); gtk_tree_view_append_column (view, column); // UGTK_NODE_COLUMN_NAME column = gtk_tree_view_column_new (); gtk_tree_view_column_set_title (column, name_title); renderer = gtk_cell_renderer_text_new (); gtk_tree_view_column_pack_start (column, renderer, TRUE); gtk_tree_view_column_set_cell_data_func (column, renderer, name_func, NULL, NULL); gtk_tree_view_column_set_resizable (column, TRUE); gtk_tree_view_column_set_expand (column, TRUE); gtk_tree_view_append_column (view, column); gtk_widget_show (GTK_WIDGET (view)); return (GtkWidget*) view; } GtkWidget* ugtk_node_view_new_for_download (void) { GtkTreeView* view; GtkTreeSelection* selection; GtkCellRenderer* renderer; GtkCellRenderer* renderer_progress; GtkTreeViewColumn* column; view = (GtkTreeView*) ugtk_node_view_new (col_set_icon, col_set_name, _("Name")); selection = gtk_tree_view_get_selection (view); gtk_tree_selection_set_mode (selection, GTK_SELECTION_MULTIPLE); // UGTK_NODE_COLUMN_STATE column = gtk_tree_view_get_column (view, UGTK_NODE_COLUMN_STATE); gtk_tree_view_column_set_resizable (column, TRUE); // UGTK_NODE_COLUMN_NAME column = gtk_tree_view_get_column (view, UGTK_NODE_COLUMN_NAME); gtk_tree_view_column_set_min_width (column, 180); gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_FIXED); // UGTK_NODE_COLUMN_COMPLETE column = gtk_tree_view_column_new (); renderer = gtk_cell_renderer_text_new (); g_object_set (renderer, "xalign", 1.0, NULL); gtk_tree_view_column_set_title (column, _("Complete")); gtk_tree_view_column_pack_start (column, renderer, TRUE); gtk_tree_view_column_set_cell_data_func (column, renderer, col_set_complete, NULL, NULL); gtk_tree_view_column_set_resizable (column, TRUE); gtk_tree_view_column_set_min_width (column, 70); gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_FIXED); gtk_tree_view_column_set_alignment (column, 1.0); gtk_tree_view_append_column (view, column); // UGTK_NODE_COLUMN_TOTAL column = gtk_tree_view_column_new (); gtk_tree_view_column_set_title (column, _("Size")); gtk_tree_view_column_pack_start (column, renderer, TRUE); gtk_tree_view_column_set_cell_data_func (column, renderer, col_set_total, NULL, NULL); gtk_tree_view_column_set_resizable (column, TRUE); gtk_tree_view_column_set_min_width (column, 70); gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_FIXED); gtk_tree_view_column_set_alignment (column, 1.0); gtk_tree_view_append_column (view, column); // UGTK_NODE_COLUMN_PERCENT column = gtk_tree_view_column_new (); renderer_progress = gtk_cell_renderer_progress_new (); gtk_tree_view_column_set_title (column, _("%")); gtk_tree_view_column_pack_start (column, renderer_progress, TRUE); gtk_tree_view_column_set_cell_data_func (column, renderer_progress, col_set_percent, NULL, NULL); gtk_tree_view_column_set_resizable (column, TRUE); gtk_tree_view_column_set_min_width (column, 60); gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_FIXED); gtk_tree_view_column_set_alignment (column, 1.0); gtk_tree_view_append_column (view, column); // UGTK_NODE_COLUMN_ELAPSED for consuming time column = gtk_tree_view_column_new (); gtk_tree_view_column_set_title (column, _("Elapsed")); gtk_tree_view_column_pack_start (column, renderer, TRUE); gtk_tree_view_column_set_cell_data_func (column, renderer, col_set_elapsed, NULL, NULL); gtk_tree_view_column_set_resizable (column, TRUE); gtk_tree_view_column_set_min_width (column, 65); gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_FIXED); gtk_tree_view_column_set_alignment (column, 1.0); gtk_tree_view_append_column (view, column); // UGTK_NODE_COLUMN_LEFT for remaining time column = gtk_tree_view_column_new (); gtk_tree_view_column_set_title (column, _("Left")); gtk_tree_view_column_pack_start (column, renderer, TRUE); gtk_tree_view_column_set_cell_data_func (column, renderer, col_set_left, NULL, NULL); gtk_tree_view_column_set_resizable (column, TRUE); gtk_tree_view_column_set_min_width (column, 65); gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_FIXED); gtk_tree_view_column_set_alignment (column, 1.0); gtk_tree_view_append_column (view, column); // UGTK_NODE_COLUMN_SPEED column = gtk_tree_view_column_new (); gtk_tree_view_column_set_title (column, _("Speed")); gtk_tree_view_column_pack_start (column, renderer, TRUE); gtk_tree_view_column_set_cell_data_func (column, renderer, col_set_speed, NULL, NULL); gtk_tree_view_column_set_resizable (column, TRUE); gtk_tree_view_column_set_min_width (column, 80); gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_FIXED); gtk_tree_view_column_set_alignment (column, 1.0); gtk_tree_view_append_column (view, column); // UGTK_NODE_COLUMN_UPLOAD_SPEED column = gtk_tree_view_column_new (); gtk_tree_view_column_set_title (column, _("Up Speed")); gtk_tree_view_column_pack_start (column, renderer, TRUE); gtk_tree_view_column_set_cell_data_func (column, renderer, col_set_upload_speed, NULL, NULL); gtk_tree_view_column_set_resizable (column, TRUE); gtk_tree_view_column_set_min_width (column, 80); gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_FIXED); gtk_tree_view_column_set_alignment (column, 1.0); gtk_tree_view_append_column (view, column); // UGTK_NODE_COLUMN_UPLOADED column = gtk_tree_view_column_new (); gtk_tree_view_column_set_title (column, _("Uploaded")); gtk_tree_view_column_pack_start (column, renderer, TRUE); gtk_tree_view_column_set_cell_data_func (column, renderer, col_set_uploaded, NULL, NULL); gtk_tree_view_column_set_resizable (column, TRUE); gtk_tree_view_column_set_min_width (column, 70); gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_FIXED); gtk_tree_view_column_set_alignment (column, 1.0); gtk_tree_view_append_column (view, column); // UGTK_NODE_COLUMN_RATIO column = gtk_tree_view_column_new (); gtk_tree_view_column_set_title (column, _("Ratio")); gtk_tree_view_column_pack_start (column, renderer, TRUE); gtk_tree_view_column_set_cell_data_func (column, renderer, col_set_ratio, NULL, NULL); gtk_tree_view_column_set_resizable (column, TRUE); gtk_tree_view_column_set_min_width (column, 45); gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_FIXED); gtk_tree_view_column_set_alignment (column, 1.0); gtk_tree_view_append_column (view, column); // UGTK_NODE_COLUMN_RETRY column = gtk_tree_view_column_new (); gtk_tree_view_column_set_title (column, _("Retry")); gtk_tree_view_column_pack_start (column, renderer, TRUE); gtk_tree_view_column_set_cell_data_func (column, renderer, col_set_retry, NULL, NULL); gtk_tree_view_column_set_resizable (column, TRUE); gtk_tree_view_column_set_min_width (column, 45); gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_FIXED); gtk_tree_view_column_set_alignment (column, 1.0); gtk_tree_view_append_column (view, column); // UGTK_NODE_COLUMN_CATEGORY renderer = gtk_cell_renderer_text_new (); column = gtk_tree_view_column_new (); gtk_tree_view_column_set_title (column, _("Category")); gtk_tree_view_column_pack_start (column, renderer, TRUE); gtk_tree_view_column_set_cell_data_func (column, renderer, col_set_category, NULL, NULL); gtk_tree_view_column_set_resizable (column, TRUE); gtk_tree_view_column_set_min_width (column, 100); gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_FIXED); gtk_tree_view_append_column (view, column); // UGTK_NODE_COLUMN_URI // renderer = gtk_cell_renderer_text_new (); column = gtk_tree_view_column_new (); gtk_tree_view_column_set_title (column, _("URI")); gtk_tree_view_column_pack_start (column, renderer, TRUE); gtk_tree_view_column_set_cell_data_func (column, renderer, col_set_uri, NULL, NULL); gtk_tree_view_column_set_resizable (column, TRUE); gtk_tree_view_column_set_min_width (column, 300); gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_FIXED); gtk_tree_view_append_column (view, column); // UGTK_NODE_COLUMN_ADDED_ON // renderer = gtk_cell_renderer_text_new (); column = gtk_tree_view_column_new (); gtk_tree_view_column_set_title (column, _("Added On")); gtk_tree_view_column_pack_start (column, renderer, TRUE); gtk_tree_view_column_set_cell_data_func (column, renderer, col_set_added_on, NULL, NULL); gtk_tree_view_column_set_resizable (column, TRUE); gtk_tree_view_column_set_min_width (column, 140); gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_FIXED); gtk_tree_view_append_column (view, column); // UGTK_NODE_COLUMN_COMPLETED_ON // renderer = gtk_cell_renderer_text_new (); column = gtk_tree_view_column_new (); gtk_tree_view_column_set_title (column, _("Completed On")); gtk_tree_view_column_pack_start (column, renderer, TRUE); gtk_tree_view_column_set_cell_data_func (column, renderer, col_set_completed_on, NULL, NULL); gtk_tree_view_column_set_resizable (column, TRUE); gtk_tree_view_column_set_min_width (column, 140); gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_FIXED); gtk_tree_view_append_column (view, column); gtk_tree_view_set_fixed_height_mode (view, TRUE); gtk_widget_show (GTK_WIDGET (view)); return (GtkWidget*) view; } static void add_column_quantity (GtkTreeView* view) { GtkCellRenderer* renderer; GtkTreeViewColumn* column; // UGTK_NODE_COLUMN_QUANTITY : number of tasks column = gtk_tree_view_column_new (); gtk_tree_view_column_set_title (column, _("Quantity")); // gtk_tree_view_column_set_title (column, _("N")); renderer = gtk_cell_renderer_text_new (); g_object_set (renderer, "xalign", 1.0, NULL); gtk_tree_view_column_pack_start (column, renderer, TRUE); gtk_tree_view_column_set_cell_data_func (column, renderer, col_set_quantity, NULL, NULL); gtk_tree_view_column_set_resizable (column, TRUE); gtk_tree_view_column_set_expand (column, TRUE); gtk_tree_view_column_set_alignment (column, 1.0); // gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE); gtk_tree_view_append_column (view, column); } GtkWidget* ugtk_node_view_new_for_category (void) { GtkTreeView* view; // GtkCellRenderer* renderer; // GtkTreeViewColumn* column; view = (GtkTreeView*) ugtk_node_view_new (col_set_icon_c, col_set_name_c, _("Category")); gtk_tree_view_set_headers_visible (view, FALSE); // UGTK_NODE_COLUMN_NAME // column = gtk_tree_view_get_column (view, 0); // gtk_tree_view_column_set_min_width (column, -1); // gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE); // column Quantity = number of tasks add_column_quantity (view); return (GtkWidget*) view; } GtkWidget* ugtk_node_view_new_for_state (void) { GtkTreeView* view; // GtkTreeViewColumn* column; view = (GtkTreeView*) ugtk_node_view_new (col_set_icon_s, col_set_name_s, _("Status")); gtk_tree_view_set_headers_visible (view, FALSE); // column = gtk_tree_view_get_column (view, 0); // gtk_tree_view_column_set_title (column, _("Status")); // column Quantity = number of tasks add_column_quantity (view); return (GtkWidget*) view; } void ugtk_node_view_use_large_icon (GtkTreeView* view, gboolean is_large, int fixed_width) { GtkTreeViewColumn* column; GtkIconSize icon_size; int icon_width; GList* list; if (is_large) { icon_size = GTK_ICON_SIZE_LARGE_TOOLBAR; icon_width = 24 + 2; // icon size + 2 pixel } else { icon_size = GTK_ICON_SIZE_SMALL_TOOLBAR; icon_width = 16 + 2; // icon size + 2 pixel } column = gtk_tree_view_get_column (view, UGTK_NODE_COLUMN_STATE); gtk_tree_view_column_set_min_width (column, icon_width); gtk_tree_view_column_set_fixed_width (column, fixed_width); list = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT(column)); g_object_set (list->data, "stock-size", icon_size, NULL); g_list_free (list); } uget-2.2.0/ui-gtk/UgtkNodeTree.c0000644000175000000120000005020713224532612013276 00000000000000/* * * Copyright (C) 2012-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ /* * This file base on GTK+ 2.0 Tree View Tutorial - custom-list.c */ #include #define NODE_TREE_N_COLUMNS 1 /* boring declarations of local functions */ static void init (UgtkNodeTree* ugtree); static void class_init (UgtkNodeTreeClass *klass); static void tree_model_init (GtkTreeModelIface *iface); static void finalize (GObject* object); static GtkTreeModelFlags get_flags (GtkTreeModel* tree_model); static gint get_n_columns (GtkTreeModel* tree_model); static GType get_column_type (GtkTreeModel* tree_model, gint index); static gboolean get_iter (GtkTreeModel* tree_model, GtkTreeIter* iter, GtkTreePath* path); static GtkTreePath* get_path (GtkTreeModel* tree_model, GtkTreeIter* iter); static void get_value (GtkTreeModel* tree_model, GtkTreeIter* iter, gint column, GValue* value); static gboolean iter_next (GtkTreeModel* tree_model, GtkTreeIter* iter); static gboolean iter_children (GtkTreeModel* tree_model, GtkTreeIter* iter, GtkTreeIter* parent); static gboolean iter_has_child (GtkTreeModel* tree_model, GtkTreeIter* iter); static gint iter_n_children (GtkTreeModel* tree_model, GtkTreeIter* iter); static gboolean iter_nth_child (GtkTreeModel* tree_model, GtkTreeIter* iter, GtkTreeIter* parent, gint n); static gboolean iter_parent (GtkTreeModel* tree_model, GtkTreeIter* iter, GtkTreeIter* child); static GObjectClass* parent_class = NULL; /* GObject stuff - nothing to worry about */ /***************************************************************************** * * class_init: more boilerplate GObject/GType stuff. * Init callback for the type system, * called once when our new class is created. * *****************************************************************************/ static void class_init (UgtkNodeTreeClass* klass) { GObjectClass *object_class; parent_class = (GObjectClass*) g_type_class_peek_parent (klass); object_class = (GObjectClass*) klass; object_class->finalize = finalize; } /***************************************************************************** * * tree_model_init: init callback for the interface registration * in ugtk_node_tree_get_type. Here we override * the GtkTreeModel interface functions that * we implement. * *****************************************************************************/ static void tree_model_init (GtkTreeModelIface* iface) { iface->get_flags = get_flags; iface->get_n_columns = get_n_columns; iface->get_column_type = get_column_type; iface->get_iter = get_iter; iface->get_path = get_path; iface->get_value = get_value; iface->iter_next = iter_next; iface->iter_children = iter_children; iface->iter_has_child = iter_has_child; iface->iter_n_children = iter_n_children; iface->iter_nth_child = iter_nth_child; iface->iter_parent = iter_parent; } /***************************************************************************** * * init: this is called everytime a new object object * instance is created (we do that in g_object_new). * Initialise the list structure's fields here. * *****************************************************************************/ static void init (UgtkNodeTree* utree) { utree->stamp = g_random_int(); /* Random int to check whether an iter belongs to our model */ } /***************************************************************************** * * finalize: this is called just before a object is * destroyed. Free dynamically allocated memory here. * *****************************************************************************/ static void finalize (GObject* object) { // UgtkNodeTree *utree = UGTK_NODE_TREE(object); // must chain up - finalize parent (*parent_class->finalize) (object); } /***************************************************************************** * * get_flags: tells the rest of the world whether our tree model * has any special characteristics. In our case, * we have a list model (instead of a tree), and each * tree iter is valid as long as the row in question * exists, as it only contains a pointer to our struct. * *****************************************************************************/ static GtkTreeModelFlags get_flags (GtkTreeModel* tree_model) { g_return_val_if_fail (UGTK_IS_NODE_TREE(tree_model), (GtkTreeModelFlags)0); if (UGTK_NODE_TREE (tree_model)->list_only) return (GTK_TREE_MODEL_LIST_ONLY | GTK_TREE_MODEL_ITERS_PERSIST); else return (GTK_TREE_MODEL_ITERS_PERSIST); } /***************************************************************************** * * get_n_columns: tells the rest of the world how many data * columns we export via the tree model interface * *****************************************************************************/ static gint get_n_columns (GtkTreeModel* tree_model) { g_return_val_if_fail (UGTK_IS_NODE_TREE(tree_model), 0); return NODE_TREE_N_COLUMNS; } /***************************************************************************** * * get_column_type: tells the rest of the world which type of * data an exported model column contains * *****************************************************************************/ static GType get_column_type (GtkTreeModel* tree_model, gint index) { g_return_val_if_fail (UGTK_IS_NODE_TREE(tree_model), G_TYPE_INVALID); g_return_val_if_fail (index < NODE_TREE_N_COLUMNS && index >= 0, G_TYPE_INVALID); return G_TYPE_POINTER; } /***************************************************************************** * * get_iter: converts a tree path (physical position) into a * tree iter structure (the content of the iter * fields will only be used internally by our model). * We simply store a pointer to our CustomRecord * structure that represents that row in the tree iter. * *****************************************************************************/ static gboolean get_iter (GtkTreeModel* tree_model, GtkTreeIter* iter, GtkTreePath* path) { UgtkNodeTree* utree; UgetNode* node; gint* indices; gint n, depth; g_assert (UGTK_IS_NODE_TREE(tree_model)); g_assert (path != NULL); utree = UGTK_NODE_TREE(tree_model); indices = gtk_tree_path_get_indices(path); depth = gtk_tree_path_get_depth(path); // prefix.root if (utree->prefix.root) { n = utree->prefix.len; if (n > utree->prefix.root->n_children || n == 0) n = utree->prefix.root->n_children; if (indices[0] < n) node = uget_node_nth_child (utree->prefix.root, indices[0]); else if (utree->root) node = uget_node_nth_child (utree->root, indices[0] - n); else return FALSE; for (n = 1; n < depth; n++) { if (node == NULL) return FALSE; node = uget_node_nth_child (node, indices[n]); } } else { for (node = utree->root, n = 0; n < depth; n++) { if (node == NULL) return FALSE; node = uget_node_nth_child (node, indices[n]); } } if (node == NULL) return FALSE; else { // We store a pointer to UgetNode in the iter iter->stamp = utree->stamp; iter->user_data = node; iter->user_data2 = NULL; /* unused */ iter->user_data3 = NULL; /* unused */ return TRUE; } } /***************************************************************************** * * get_path: converts a tree iter into a tree path (ie. the * physical position of that row in the list). * *****************************************************************************/ static GtkTreePath* get_path (GtkTreeModel* tree_model, GtkTreeIter* iter) { GtkTreePath* path; UgtkNodeTree* utree; UgetNode* node; gint n; g_return_val_if_fail (UGTK_IS_NODE_TREE(tree_model), NULL); g_return_val_if_fail (iter != NULL, NULL); g_return_val_if_fail (iter->user_data != NULL, NULL); node = iter->user_data; path = gtk_tree_path_new(); utree = UGTK_NODE_TREE (tree_model); // prefix.root if (utree->prefix.root) { n = utree->prefix.len; if (n > utree->prefix.root->n_children || n == 0) n = utree->prefix.root->n_children; while (node->parent) { if (node->parent == utree->prefix.root) { gtk_tree_path_prepend_index (path, uget_node_child_position (node->parent, node)); return path; } else if (node->parent == utree->root) { gtk_tree_path_prepend_index (path, uget_node_child_position (node->parent, node) + n); return path; } gtk_tree_path_prepend_index (path, uget_node_child_position (node->parent, node)); node = node->parent; } } else { while (node->parent && node != utree->root) { gtk_tree_path_prepend_index (path, uget_node_child_position (node->parent, node)); node = node->parent; } } return path; } /***************************************************************************** * * get_value: Returns a row's exported data columns * (_get_value is what gtk_tree_model_get uses) * *****************************************************************************/ static void get_value (GtkTreeModel* tree_model, GtkTreeIter* iter, gint column, GValue* value) { // UgtkNodeTree* utree; g_return_if_fail (UGTK_IS_NODE_TREE (tree_model)); g_return_if_fail (iter != NULL); g_return_if_fail (column < NODE_TREE_N_COLUMNS); g_value_init (value, G_TYPE_POINTER); // utree = UGTK_NODE_TREE (tree_model); g_value_set_pointer (value, iter->user_data); } /***************************************************************************** * * iter_next: Takes an iter structure and sets it to point * to the next row. * *****************************************************************************/ static gboolean iter_next (GtkTreeModel* tree_model, GtkTreeIter* iter) { UgtkNodeTree* utree; UgetNode* node; gint n; g_return_val_if_fail (UGTK_IS_NODE_TREE (tree_model), FALSE); utree = UGTK_NODE_TREE (tree_model); node = iter->user_data; if (node == NULL) return FALSE; // prefix.root if (utree->prefix.root && utree->prefix.root == node->parent) { n = utree->prefix.len; if (n > utree->prefix.root->n_children || n == 0) n = utree->prefix.root->n_children; if (uget_node_child_position (node->parent, node) == n - 1) { if (utree->root == NULL || utree->root->children == NULL) return FALSE; iter->stamp = utree->stamp; iter->user_data = utree->root->children; return TRUE; } } if (node->next == NULL) return FALSE; else { iter->stamp = utree->stamp; iter->user_data = node->next; return TRUE; } } /***************************************************************************** * * iter_children: Returns TRUE or FALSE depending on whether * the row specified by 'parent' has any children. * If it has children, then 'iter' is set to * point to the first child. Special case: if * 'parent' is NULL, then the first top-level * row should be returned if it exists. * *****************************************************************************/ static gboolean iter_children (GtkTreeModel* tree_model, GtkTreeIter* iter, GtkTreeIter* parent) { UgtkNodeTree* utree; UgetNode* node; g_return_val_if_fail (UGTK_IS_NODE_TREE (tree_model), FALSE); utree = UGTK_NODE_TREE (tree_model); // parent == NULL is a special case; we need to return the first top-level row if (parent) node = parent->user_data; else { // prefix.root if (utree->prefix.root && utree->prefix.root->children) { iter->stamp = utree->stamp; iter->user_data = utree->prefix.root->children; return TRUE; } node = utree->root; } // Set iter to first child item. if (node == NULL || node->children == NULL) return FALSE; else { iter->stamp = utree->stamp; iter->user_data = node->children; return TRUE; } } /***************************************************************************** * * iter_has_child: Returns TRUE or FALSE depending on whether * the row specified by 'iter' has any children. * We only have a list and thus no children. * *****************************************************************************/ static gboolean iter_has_child (GtkTreeModel* tree_model, GtkTreeIter* iter) { UgetNode* node; node = iter->user_data; if (node->children == NULL) return FALSE; else return TRUE; } /***************************************************************************** * * iter_n_children: Returns the number of children the row * specified by 'iter' has. This is usually 0, * as we only have a list and thus do not have * any children to any rows. A special case is * when 'iter' is NULL, in which case we need * to return the number of top-level nodes, * ie. the number of rows in our list. * *****************************************************************************/ static gint iter_n_children (GtkTreeModel* tree_model, GtkTreeIter* iter) { UgtkNodeTree* utree; UgetNode* node; gint n = 0; g_return_val_if_fail (UGTK_IS_NODE_TREE (tree_model), -1); if (iter == NULL) { utree = UGTK_NODE_TREE (tree_model); // prefix.root if (utree->prefix.root) { n = utree->prefix.len; if (n > utree->prefix.root->n_children || n == 0) n = utree->prefix.root->n_children; } if (utree->root) n += utree->root->n_children; return n; } node = iter->user_data; return node->n_children; } /***************************************************************************** * * iter_nth_child: If the row specified by 'parent' has any * children, set 'iter' to the n-th child and * return TRUE if it exists, otherwise FALSE. * A special case is when 'parent' is NULL, in * which case we need to set 'iter' to the n-th * row if it exists. * *****************************************************************************/ static gboolean iter_nth_child (GtkTreeModel* tree_model, GtkTreeIter* iter, GtkTreeIter* parent, gint n) { UgtkNodeTree* utree; UgetNode* node; gint n_prefix; g_return_val_if_fail (UGTK_IS_NODE_TREE (tree_model), FALSE); utree = UGTK_NODE_TREE (tree_model); // special case: if parent == NULL, set iter to n-th top-level row if (parent) node = parent->user_data; else { // prefix.root if (utree->prefix.root) { n_prefix = utree->prefix.len; if (n_prefix > utree->prefix.root->n_children) n_prefix = utree->prefix.root->n_children; if (n >= n_prefix) n -= n_prefix; else { iter->stamp = utree->stamp; iter->user_data = uget_node_nth_child (utree->prefix.root, n); return TRUE; } } node = utree->root; } if (node == NULL || n >= node->n_children) return FALSE; else { iter->stamp = utree->stamp; iter->user_data = uget_node_nth_child (node, n); return TRUE; } } /***************************************************************************** * * iter_parent: Point 'iter' to the parent node of 'child'. As * we have a list and thus no children and no * parents of children, we can just return FALSE. * *****************************************************************************/ static gboolean iter_parent (GtkTreeModel* tree_model, GtkTreeIter* iter, GtkTreeIter* child) { UgtkNodeTree* utree; UgetNode* node; if (child == NULL || child->user_data == NULL) return FALSE; utree = UGTK_NODE_TREE (tree_model); node = child->user_data; // prefix.root if (node->parent == utree->prefix.root) return FALSE; if (node->parent == utree->root) return FALSE; else { iter->stamp = utree->stamp; iter->user_data = node->parent; return TRUE; } } /***************************************************************************** * * ugtk_node_tree_get_type: here we register our new type and its interfaces * with the type system. If you want to implement * additional interfaces like GtkTreeSortable, you * will need to do it here. * *****************************************************************************/ GType ugtk_node_tree_get_type (void) { static GType ugtk_node_tree_type = 0; /* Some boilerplate type registration stuff */ if (ugtk_node_tree_type == 0) { static const GTypeInfo ugtk_node_tree_info = { sizeof (UgtkNodeTreeClass), NULL, /* base_init */ NULL, /* base_finalize */ (GClassInitFunc) class_init, NULL, /* class finalize */ NULL, /* class_data */ sizeof (UgtkNodeTree), 0, /* n_preallocs */ (GInstanceInitFunc) init }; static const GInterfaceInfo tree_model_info = { (GInterfaceInitFunc) tree_model_init, NULL, NULL }; /* First register the new derived type with the GObject type system */ ugtk_node_tree_type = g_type_register_static (G_TYPE_OBJECT, "UgtkNodeTree", &ugtk_node_tree_info, (GTypeFlags)0); /* Now register our GtkTreeModel interface with the type system */ g_type_add_interface_static (ugtk_node_tree_type, GTK_TYPE_TREE_MODEL, &tree_model_info); } return ugtk_node_tree_type; } /***************************************************************************** * * ugtk_node_tree_new: This is what you use in your own code to create a * new uget tree model for you to use. * *****************************************************************************/ UgtkNodeTree* ugtk_node_tree_new (UgetNode* root, gboolean list_only) { UgtkNodeTree* utree; utree = (UgtkNodeTree*) g_object_new (UGTK_TYPE_NODE_TREE, NULL); utree->root = root; utree->list_only = list_only; g_assert( utree != NULL ); return utree; } void ugtk_node_tree_set_prefix (UgtkNodeTree* utree, UgetNode* prefix_root, gint prefix_len) { utree->prefix.root = prefix_root; utree->prefix.len = prefix_len; } uget-2.2.0/ui-gtk/UgtkMenubar.h0000644000175000000120000001301513224532612013163 00000000000000/* * * Copyright (C) 2012-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #ifndef UGTK_MENUBAR_H #define UGTK_MENUBAR_H #include #ifdef __cplusplus extern "C" { #endif typedef struct UgtkMenubar UgtkMenubar; typedef struct UgtkApp UgtkApp; struct UgtkMenubar { GtkWidget* self; // GtkMenuBar // GtkWidget* self; // GtkMenu* // GtkWidget* shell; // GtkMenuShell* // GtkWidget* other; // GtkMenuItem* struct UgtkFileMenu { // file.create GtkWidget* create_download; GtkWidget* create_category; GtkWidget* create_torrent; GtkWidget* create_metalink; // file.batch struct UgtkFileBatchMenu { GtkWidget* clipboard; // Clipboard batch GtkWidget* sequence; // URL Sequence batch GtkWidget* text_import; // Text file import (.txt) GtkWidget* html_import; // HTML file import (.html) GtkWidget* text_export; // Export to Text file (.txt) } batch; GtkWidget* open_category; GtkWidget* save_category; GtkWidget* save; GtkWidget* offline_mode; GtkWidget* quit; } file; struct UgtkEditMenu { GtkWidget* clipboard_monitor; GtkWidget* clipboard_quiet; GtkWidget* commandline_quiet; GtkWidget* skip_existing; GtkWidget* apply_recent; GtkWidget* settings; // Completion Auto-Actions struct { GtkWidget* disable; GtkWidget* hibernate; GtkWidget* suspend; GtkWidget* shutdown; GtkWidget* reboot; GtkWidget* custom; // separator GtkWidget* remember; GtkWidget* help; } completion; } edit; struct UgtkViewMenu { GtkWidget* toolbar; GtkWidget* statusbar; GtkWidget* category; GtkWidget* summary; struct UgtkViewItemMenu { GtkWidget* name; GtkWidget* folder; GtkWidget* category; // GtkWidget* elapsed; GtkWidget* uri; GtkWidget* message; } summary_items; struct UgtkViewColMenu // download columns { GtkWidget* self; // GtkMenu GtkWidget* complete; GtkWidget* total; GtkWidget* percent; GtkWidget* elapsed; // consuming time GtkWidget* left; // remaining time GtkWidget* speed; GtkWidget* upload_speed; // torrent GtkWidget* uploaded; // torrent GtkWidget* ratio; // torrent GtkWidget* retry; GtkWidget* category; GtkWidget* uri; GtkWidget* added_on; GtkWidget* completed_on; } columns; } view; struct UgtkCategoryMenu { GtkWidget* self; // GtkMenu GtkWidget* create; GtkWidget* delete; GtkWidget* properties; GtkWidget* move_up; GtkWidget* move_down; } category; struct UgtkDownloadMenu { GtkWidget* self; // GtkMenu GtkWidget* create; GtkWidget* delete; GtkWidget* delete_file; // delete file and data. GtkWidget* open; GtkWidget* open_folder; // open containing folder GtkWidget* force_start; GtkWidget* runnable; GtkWidget* pause; struct UgtkDownloadMoveToMenu { GtkWidget* self; // GtkMenu GtkWidget* item; // GtkMenuItem // This array used for mapping menu item and it's category // index 0, 2, 4, 6... GtkMenuItem* // index 1, 3, 5, 7... UgetNode* GPtrArray* array; } move_to; GtkWidget* move_up; GtkWidget* move_down; GtkWidget* move_top; GtkWidget* move_bottom; struct UgtkDownloadPrioriyMenu { GtkWidget* self; // GtkMenu GtkWidget* item; // GtkMenuItem // GtkRadioMenuItem GtkWidget* high; GtkWidget* normal; GtkWidget* low; } prioriy; GtkWidget* properties; } download; struct UgtkHelpMenu { GtkWidget* help_online; GtkWidget* documentation; GtkWidget* support_forum; GtkWidget* submit_feedback; GtkWidget* report_bug; GtkWidget* keyboard_shortcuts; GtkWidget* check_updates; GtkWidget* about_uget; } help; }; void ugtk_menubar_init_ui (UgtkMenubar* menubar, GtkAccelGroup* accel_group); void ugtk_menubar_init_callback (UgtkMenubar* menubar, UgtkApp* app); void ugtk_menubar_sync_category (UgtkMenubar* menubar, UgtkApp* app, gboolean reset); #ifdef __cplusplus } #endif #endif // UGTK_MENUBAR_H uget-2.2.0/ui-gtk/UgtkTrayIcon.c0000644000175000000120000004174613224532612013331 00000000000000/* * * Copyright (C) 2005-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #include #include #include #include #include #define UGTK_TRAY_ICON_NAME "uget-tray-default" #define UGTK_TRAY_ICON_ERROR_NAME "uget-tray-error" #define UGTK_TRAY_ICON_ACTIVE_NAME "uget-tray-downloading" void ugtk_tray_icon_init (UgtkTrayIcon* trayicon) { GtkWidget* image; GtkWidget* menu; GtkWidget* menu_item; gchar* icon_name; gchar* file_name; // UgTrayIcon.menu menu = gtk_menu_new (); // New Download menu_item = gtk_image_menu_item_new_with_mnemonic (_("New _Download...")); #if GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 10 image = gtk_image_new_from_icon_name ("document-new", GTK_ICON_SIZE_MENU); #else image = gtk_image_new_from_stock (GTK_STOCK_NEW, GTK_ICON_SIZE_MENU); #endif gtk_image_menu_item_set_image ((GtkImageMenuItem*)menu_item, image); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); trayicon->menu.create_download = menu_item; // New Clipboard batch menu_item = gtk_image_menu_item_new_with_mnemonic (_("New Clipboard _batch...")); #if GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 10 image = gtk_image_new_from_icon_name ("edit-paste", GTK_ICON_SIZE_MENU); #else image = gtk_image_new_from_stock (GTK_STOCK_PASTE, GTK_ICON_SIZE_MENU); #endif gtk_image_menu_item_set_image ((GtkImageMenuItem*)menu_item, image); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); trayicon->menu.create_clipboard = menu_item; gtk_menu_shell_append ((GtkMenuShell*)menu, gtk_separator_menu_item_new() ); // New Torrent menu_item = gtk_image_menu_item_new_with_mnemonic (_("New Torrent...")); // image = gtk_image_new_from_stock (GTK_STOCK_NEW, GTK_ICON_SIZE_MENU); // gtk_image_menu_item_set_image ((GtkImageMenuItem*)menu_item, image); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); trayicon->menu.create_torrent = menu_item; // New Metalink menu_item = gtk_image_menu_item_new_with_mnemonic (_("New Metalink...")); // image = gtk_image_new_from_stock (GTK_STOCK_NEW, GTK_ICON_SIZE_MENU); // gtk_image_menu_item_set_image ((GtkImageMenuItem*)menu_item, image); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); trayicon->menu.create_metalink = menu_item; gtk_menu_shell_append ((GtkMenuShell*)menu, gtk_separator_menu_item_new() ); // Settings shortcut menu_item = gtk_check_menu_item_new_with_mnemonic (_("Clipboard _Monitor")); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); trayicon->menu.clipboard_monitor = menu_item; menu_item = gtk_check_menu_item_new_with_mnemonic (_("Clipboard works quietly")); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); trayicon->menu.clipboard_quiet = menu_item; menu_item = gtk_check_menu_item_new_with_mnemonic (_("Command-line works quietly")); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); trayicon->menu.commandline_quiet = menu_item; menu_item = gtk_check_menu_item_new_with_mnemonic (_("Skip existing URI")); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); trayicon->menu.skip_existing = menu_item; menu_item = gtk_check_menu_item_new_with_mnemonic (_("Apply recent download settings")); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); trayicon->menu.apply_recent = menu_item; gtk_menu_shell_append ((GtkMenuShell*)menu, gtk_separator_menu_item_new() ); // Settings menu_item = gtk_image_menu_item_new_with_mnemonic (_("_Settings...")); #if GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 10 image = gtk_image_new_from_icon_name ("document-properties", GTK_ICON_SIZE_MENU); #else image = gtk_image_new_from_stock (GTK_STOCK_PROPERTIES, GTK_ICON_SIZE_MENU); #endif gtk_image_menu_item_set_image ((GtkImageMenuItem*)menu_item, image); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); trayicon->menu.settings = menu_item; // About menu_item = gtk_image_menu_item_new_from_stock (GTK_STOCK_ABOUT, NULL); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); trayicon->menu.about = menu_item; gtk_menu_shell_append ((GtkMenuShell*)menu, gtk_separator_menu_item_new() ); #ifdef HAVE_APP_INDICATOR // Show window menu_item = gtk_menu_item_new_with_mnemonic (_("Show window")); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); trayicon->menu.show_window = menu_item; #endif // Offline mode menu_item = gtk_check_menu_item_new_with_mnemonic (_("_Offline Mode")); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); trayicon->menu.offline_mode = menu_item; // Quit menu_item = gtk_image_menu_item_new_from_stock (GTK_STOCK_QUIT, NULL); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); trayicon->menu.quit = menu_item; gtk_widget_show_all (menu); trayicon->menu.self = menu; // decide tray icon file_name = g_build_filename (UG_DATADIR, "icons", "hicolor", "16x16", "apps", "uget-icon.png", NULL); if (g_file_test (file_name, G_FILE_TEST_IS_REGULAR)) icon_name = UGTK_TRAY_ICON_NAME; else icon_name = GTK_STOCK_GO_DOWN; g_free (file_name); #ifdef HAVE_APP_INDICATOR trayicon->indicator = app_indicator_new ("uget-gtk", icon_name, APP_INDICATOR_CATEGORY_APPLICATION_STATUS); trayicon->indicator_temp = trayicon->indicator; if (trayicon->indicator) { app_indicator_set_menu (trayicon->indicator, GTK_MENU (trayicon->menu.self)); // app_indicator_set_attention_icon_full (trayicon->indicator, // UGTK_TRAY_ICON_ACTIVE_NAME, NULL); app_indicator_set_attention_icon (trayicon->indicator, UGTK_TRAY_ICON_ACTIVE_NAME); app_indicator_set_status (trayicon->indicator, APP_INDICATOR_STATUS_PASSIVE); } #endif // HAVE_APP_INDICATOR trayicon->self = gtk_status_icon_new_from_icon_name (icon_name); gtk_status_icon_set_visible (trayicon->self, FALSE); } void ugtk_tray_icon_set_info (UgtkTrayIcon* trayicon, guint n_active, gint64 down_speed, gint64 up_speed) { gchar* string; char* string_down_speed; char* string_up_speed; guint current_state; // change tray icon if (trayicon->error_occurred) { string = UGTK_TRAY_ICON_ERROR_NAME; current_state = UGTK_TRAY_ICON_STATE_ERROR; } else if (n_active > 0) { string = UGTK_TRAY_ICON_ACTIVE_NAME; current_state = UGTK_TRAY_ICON_STATE_RUNNING; } else { string = UGTK_TRAY_ICON_NAME; current_state = UGTK_TRAY_ICON_STATE_NORMAL; } if (trayicon->state != current_state) { trayicon->state = current_state; #ifdef HAVE_APP_INDICATOR if (trayicon->indicator) { trayicon->error_occurred = FALSE; if (app_indicator_get_status (trayicon->indicator) != APP_INDICATOR_STATUS_PASSIVE) { if (current_state == UGTK_TRAY_ICON_STATE_NORMAL) { app_indicator_set_status (trayicon->indicator, APP_INDICATOR_STATUS_ACTIVE); } else { app_indicator_set_attention_icon (trayicon->indicator, string); // app_indicator_set_attention_icon_full (trayicon->indicator, // string, "attention"); app_indicator_set_status (trayicon->indicator, APP_INDICATOR_STATUS_ATTENTION); } } } else #endif // HAVE_APP_INDICATOR gtk_status_icon_set_from_icon_name (trayicon->self, string); } // change tooltip string_down_speed = ug_str_from_int_unit (down_speed, "/s"); string_up_speed = ug_str_from_int_unit (up_speed, "/s"); string = g_strdup_printf ( UGTK_APP_NAME " " PACKAGE_VERSION "\n" "%u %s" "\n" "\xE2\x86\x93 %s" // "↓" " , " "\xE2\x86\x91 %s", // "↑" n_active, _("tasks"), string_down_speed, string_up_speed); #ifdef HAVE_APP_INDICATOR if (trayicon->indicator) { // g_object_set (trayicon->indicator, "icon-desc", string, NULL); // g_object_set (trayicon->indicator, "attention-icon-desc", string, NULL); } else #endif // HAVE_APP_INDICATOR gtk_status_icon_set_tooltip_text (trayicon->self, string); ug_free (string_down_speed); ug_free (string_up_speed); g_free (string); } void ugtk_tray_icon_set_visible (UgtkTrayIcon* trayicon, gboolean visible) { #ifdef HAVE_APP_INDICATOR if (trayicon->indicator) { if (visible) app_indicator_set_status (trayicon->indicator, APP_INDICATOR_STATUS_ACTIVE); else app_indicator_set_status (trayicon->indicator, APP_INDICATOR_STATUS_PASSIVE); } else #endif // HAVE_APP_INDICATOR gtk_status_icon_set_visible (trayicon->self, visible); trayicon->visible = visible; } #ifdef HAVE_APP_INDICATOR void ugtk_tray_icon_use_indicator (UgtkTrayIcon* trayicon, gboolean enable) { ugtk_tray_icon_set_visible (trayicon, FALSE); if (enable) trayicon->indicator = trayicon->indicator_temp; else trayicon->indicator = NULL; ugtk_tray_icon_set_visible (trayicon, trayicon->visible); } #endif // HAVE_APP_INDICATOR // ---------------------------------------------------------------------------- // Callback static void on_trayicon_activate (GtkStatusIcon* status_icon, UgtkApp* app) { gint x, y; if (gtk_widget_get_visible ((GtkWidget*) app->window.self) == TRUE) { // get position and size gtk_window_get_position (app->window.self, &x, &y); gtk_window_get_size (app->window.self, &app->setting.window.width, &app->setting.window.height); // gtk_window_get_position() may return: x == -32000, y == -32000 if (x + app->setting.window.width > 0) app->setting.window.x = x; if (y + app->setting.window.height > 0) app->setting.window.y = y; // hide window #if defined _WIN32 || defined _WIN64 // gtk_window_iconify (app->window.self); #endif gtk_widget_hide ((GtkWidget*) app->window.self); } else { #if defined _WIN32 || defined _WIN64 // gtk_window_deiconify (app->window.self); #endif gtk_widget_show ((GtkWidget*) app->window.self); gtk_window_present (app->window.self); ugtk_app_decide_trayicon_visible (app); // set position and size gtk_window_move (app->window.self, app->setting.window.x, app->setting.window.y); gtk_window_resize (app->window.self, app->setting.window.width, app->setting.window.height); } // clear error status if (app->trayicon.error_occurred) { app->trayicon.error_occurred = FALSE; app->trayicon.state = UGTK_TRAY_ICON_STATE_NORMAL; gtk_status_icon_set_from_icon_name (status_icon, UGTK_TRAY_ICON_NAME); } } static void on_trayicon_popup_menu (GtkStatusIcon* status_icon, guint button, guint activate_time, UgtkTrayIcon* trayicon) { gtk_menu_set_screen ((GtkMenu*) trayicon->menu.self, gtk_status_icon_get_screen (status_icon)); #if defined _WIN32 || defined _WIN64 gtk_menu_popup ((GtkMenu*) trayicon->menu.self, NULL, NULL, NULL, NULL, button, activate_time); #else gtk_menu_popup ((GtkMenu*) trayicon->menu.self, NULL, NULL, gtk_status_icon_position_menu, status_icon, button, activate_time); #endif } #if defined _WIN32 || defined _WIN64 static gboolean tray_menu_timeout (GtkMenu* menu) { gtk_menu_popdown (menu); // return FALSE if the source should be removed. return FALSE; } static gboolean tray_menu_leave_enter (GtkWidget* menu, GdkEventCrossing* event, gpointer data) { static guint tray_menu_timer = 0; if (event->type == GDK_LEAVE_NOTIFY && (event->detail == GDK_NOTIFY_ANCESTOR || event->detail == GDK_NOTIFY_UNKNOWN)) { if (tray_menu_timer == 0) { tray_menu_timer = g_timeout_add (500, (GSourceFunc) tray_menu_timeout, menu); } } else if (event->type == GDK_ENTER_NOTIFY && event->detail == GDK_NOTIFY_ANCESTOR) { if (tray_menu_timer != 0) { g_source_remove (tray_menu_timer); tray_menu_timer = 0; } } return FALSE; } #endif // _WIN32 || _WIN64 static void on_create_download (GtkWidget* widget, UgtkApp* app) { ugtk_app_create_download (app, NULL, NULL); } static void on_clipboard_monitor (GtkWidget* widget, UgtkApp* app) { if (app->trayicon.menu.emission) g_signal_emit_by_name (app->menubar.edit.clipboard_monitor, "activate"); } static void on_clipboard_quiet (GtkWidget* widget, UgtkApp* app) { if (app->trayicon.menu.emission) g_signal_emit_by_name (app->menubar.edit.clipboard_quiet, "activate"); } static void on_commandline_quiet (GtkWidget* widget, UgtkApp* app) { if (app->trayicon.menu.emission) g_signal_emit_by_name (app->menubar.edit.commandline_quiet, "activate"); } static void on_skip_existing (GtkWidget* widget, UgtkApp* app) { if (app->trayicon.menu.emission) g_signal_emit_by_name (app->menubar.edit.skip_existing, "activate"); } static void on_apply_recent (GtkWidget* widget, UgtkApp* app) { if (app->trayicon.menu.emission) g_signal_emit_by_name (app->menubar.edit.apply_recent, "activate"); } static void on_config_settings (GtkWidget* widget, UgtkApp* app) { g_signal_emit_by_name (app->menubar.edit.settings, "activate"); } static void on_offline_mode (GtkWidget* widget, UgtkApp* app) { gboolean offline; offline = gtk_check_menu_item_get_active ((GtkCheckMenuItem*) widget); app->setting.offline_mode = offline; // file menu offline = gtk_check_menu_item_get_active ( (GtkCheckMenuItem*) app->menubar.file.offline_mode); if (offline != app->setting.offline_mode) { gtk_check_menu_item_set_active ( (GtkCheckMenuItem*) app->menubar.file.offline_mode, app->setting.offline_mode); } } static void on_about (GtkWidget* widget, UgtkApp* app) { g_signal_emit_by_name (app->menubar.help.about_uget, "activate"); } #ifdef HAVE_APP_INDICATOR static void on_trayicon_show_window (GtkWidget* widget, UgtkApp* app) { if (gtk_widget_get_visible ((GtkWidget*) app->window.self)) gtk_window_present (app->window.self); else { gtk_widget_show ((GtkWidget*) app->window.self); // gtk_window_deiconify (app->window.self); gtk_window_present (app->window.self); ugtk_app_decide_trayicon_visible (app); } } #endif // HAVE_APP_INDICATOR void ugtk_trayicon_init_callback (struct UgtkTrayIcon* trayicon, UgtkApp* app) { g_signal_connect (trayicon->self, "activate", G_CALLBACK (on_trayicon_activate), app); g_signal_connect (trayicon->self, "popup-menu", G_CALLBACK (on_trayicon_popup_menu), trayicon); #if defined _WIN32 || defined _WIN64 g_signal_connect (trayicon->menu.self, "leave-notify-event", G_CALLBACK (tray_menu_leave_enter), NULL); g_signal_connect (trayicon->menu.self, "enter-notify-event", G_CALLBACK (tray_menu_leave_enter), NULL); #endif g_signal_connect (trayicon->menu.create_download, "activate", G_CALLBACK (on_create_download), app); g_signal_connect_swapped (trayicon->menu.create_clipboard, "activate", G_CALLBACK (ugtk_app_clipboard_batch), app); g_signal_connect_swapped (trayicon->menu.create_torrent, "activate", G_CALLBACK (ugtk_app_create_torrent), app); g_signal_connect_swapped (trayicon->menu.create_metalink, "activate", G_CALLBACK (ugtk_app_create_metalink), app); trayicon->menu.emission = TRUE; g_signal_connect (trayicon->menu.clipboard_monitor, "activate", G_CALLBACK (on_clipboard_monitor), app); g_signal_connect (trayicon->menu.clipboard_quiet, "activate", G_CALLBACK (on_clipboard_quiet), app); g_signal_connect (trayicon->menu.commandline_quiet, "activate", G_CALLBACK (on_commandline_quiet), app); g_signal_connect (trayicon->menu.skip_existing, "activate", G_CALLBACK (on_skip_existing), app); g_signal_connect (trayicon->menu.apply_recent, "activate", G_CALLBACK (on_apply_recent), app); g_signal_connect (trayicon->menu.settings, "activate", G_CALLBACK (on_config_settings), app); g_signal_connect (trayicon->menu.offline_mode, "toggled", G_CALLBACK (on_offline_mode), app); g_signal_connect (trayicon->menu.about, "activate", G_CALLBACK (on_about), app); g_signal_connect_swapped (trayicon->menu.quit, "activate", G_CALLBACK (ugtk_app_decide_to_quit), app); #ifdef HAVE_APP_INDICATOR g_signal_connect (trayicon->menu.show_window, "activate", G_CALLBACK (on_trayicon_show_window), app); #endif // HAVE_APP_INDICATOR } uget-2.2.0/ui-gtk/UgtkAboutDialog.h0000644000175000000120000000434313224532612013770 00000000000000/* * * Copyright (C) 2012-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #ifndef UGTK_ABOUT_DIALOG_H #define UGTK_ABOUT_DIALOG_H #include #ifdef __cplusplus extern "C" { #endif #ifdef __cplusplus } #endif typedef struct UgtkAboutDialog UgtkAboutDialog; struct UgtkAboutDialog { GtkDialog* self; // UgtkApp* app; GdkPixbuf* pixbuf; GtkWidget* scrolled; GtkTextView* textview; GtkTextBuffer* textbuf; }; UgtkAboutDialog* ugtk_about_dialog_new (GtkWindow* parent); void ugtk_about_dialog_free (UgtkAboutDialog* adialog); void ugtk_about_dialog_set_info (UgtkAboutDialog* adialog, const gchar* text); void ugtk_about_dialog_run (UgtkAboutDialog* adialog); #endif // UGTK_ABOUT_DIALOG_H uget-2.2.0/ui-gtk/UgtkDownloadForm.c0000644000175000000120000011527613224532612014174 00000000000000/* * * Copyright (C) 2005-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #include #include #include #include #include // UGTK_APP_NAME #include static void ugtk_download_form_init_page1 (UgtkDownloadForm* dform, UgtkProxyForm* proxy); static void ugtk_download_form_init_page2 (UgtkDownloadForm* dform); // signal handler static void on_spin_changed (GtkEditable *editable, UgtkDownloadForm* dform); static void on_entry_changed (GtkEditable *editable, UgtkDownloadForm* dform); static void on_uri_entry_changed (GtkEditable *editable, UgtkDownloadForm* dform); static void on_http_entry_changed (GtkEditable *editable, UgtkDownloadForm* dform); static void on_select_folder (GtkEntry* entry, GtkEntryIconPosition icon_pos, GdkEvent* event, UgtkDownloadForm* dform); static void on_select_cookie (GtkEntry* entry, GtkEntryIconPosition icon_pos, GdkEvent* event, UgtkDownloadForm* dform); static void on_select_post (GtkEntry* entry, GtkEntryIconPosition icon_pos, GdkEvent* event, UgtkDownloadForm* dform); void ugtk_download_form_init (UgtkDownloadForm* dform, UgtkProxyForm* proxy, GtkWindow* parent) { dform->changed.enable = TRUE; dform->changed.uri = FALSE; dform->changed.file = FALSE; dform->changed.folder = FALSE; dform->changed.user = FALSE; dform->changed.password = FALSE; dform->changed.referrer = FALSE; dform->changed.cookie = FALSE; dform->changed.post = FALSE; dform->changed.agent = FALSE; dform->changed.retry = FALSE; dform->changed.delay = FALSE; dform->changed.timestamp= FALSE; dform->parent = parent; ugtk_download_form_init_page1 (dform, proxy); ugtk_download_form_init_page2 (dform); gtk_widget_show_all (dform->page1); gtk_widget_show_all (dform->page2); } static void ugtk_download_form_init_page1 (UgtkDownloadForm* dform, UgtkProxyForm* proxy) { GtkWidget* widget; GtkGrid* top_grid; GtkGrid* grid; GtkWidget* frame; GtkBox* top_vbox; GtkWidget* vbox; GtkWidget* hbox; dform->page1 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); top_vbox = (GtkBox*) dform->page1; gtk_container_set_border_width (GTK_CONTAINER (top_vbox), 2); top_grid = (GtkGrid*) gtk_grid_new (); gtk_box_pack_start (top_vbox, (GtkWidget*) top_grid, FALSE, FALSE, 0); // URL - entry widget = gtk_entry_new (); // gtk_entry_set_width_chars (GTK_ENTRY (widget), 20); // remove for GTK+ 3.12 gtk_entry_set_activates_default (GTK_ENTRY (widget), TRUE); g_object_set (widget, "margin-left", 1, "margin-right", 1, NULL); g_object_set (widget, "margin-top", 2, "margin-bottom", 2, NULL); g_object_set (widget, "hexpand", TRUE, NULL); gtk_grid_attach (top_grid, widget, 1, 0, 2, 1); g_signal_connect (GTK_EDITABLE (widget), "changed", G_CALLBACK (on_uri_entry_changed), dform); dform->uri_entry = widget; // URL - label widget = gtk_label_new_with_mnemonic (_("_URI:")); gtk_label_set_mnemonic_widget (GTK_LABEL(widget), dform->uri_entry); g_object_set (widget, "margin-left", 3, "margin-right", 3, NULL); g_object_set (widget, "margin-top", 2, "margin-bottom", 2, NULL); gtk_grid_attach (top_grid, widget, 0, 0, 1, 1); dform->uri_label = widget; // Mirrors - entry widget = gtk_entry_new (); // gtk_entry_set_width_chars (GTK_ENTRY (widget), 20); // remove for GTK+ 3.12 gtk_entry_set_activates_default (GTK_ENTRY (widget), TRUE); g_object_set (widget, "margin-left", 1, "margin-right", 1, NULL); g_object_set (widget, "margin-top", 2, "margin-bottom", 2, NULL); g_object_set (widget, "hexpand", TRUE, NULL); gtk_grid_attach (top_grid, widget, 1, 1, 2, 1); g_signal_connect (GTK_EDITABLE (widget), "changed", G_CALLBACK (on_uri_entry_changed), dform); dform->mirrors_entry = widget; // Mirrors - label widget = gtk_label_new_with_mnemonic (_("Mirrors:")); gtk_label_set_mnemonic_widget (GTK_LABEL(widget), dform->mirrors_entry); g_object_set (widget, "margin-left", 3, "margin-right", 3, NULL); g_object_set (widget, "margin-top", 2, "margin-bottom", 2, NULL); gtk_grid_attach (top_grid, widget, 0, 1, 1, 1); dform->mirrors_label = widget; // File - entry widget = gtk_entry_new (); gtk_entry_set_activates_default (GTK_ENTRY (widget), TRUE); g_object_set (widget, "margin", 1, "hexpand", TRUE, NULL); gtk_grid_attach (top_grid, widget, 1, 2, 2, 1); g_signal_connect (GTK_EDITABLE (widget), "changed", G_CALLBACK (on_entry_changed), dform); dform->file_entry = widget; // File - label widget = gtk_label_new_with_mnemonic (_("File:")); gtk_label_set_mnemonic_widget (GTK_LABEL (widget), dform->file_entry); g_object_set (widget, "margin-left", 3, "margin-right", 3, NULL); g_object_set (widget, "margin-top", 1, "margin-bottom", 1, NULL); gtk_grid_attach (top_grid, widget, 0, 2, 1, 1); dform->file_label = widget; // Folder - combo entry + icon dform->folder_combo = gtk_combo_box_text_new_with_entry (); dform->folder_entry = gtk_bin_get_child (GTK_BIN (dform->folder_combo)); widget = dform->folder_entry; gtk_entry_set_activates_default (GTK_ENTRY (widget), TRUE); #if GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 10 gtk_entry_set_icon_from_icon_name (GTK_ENTRY (widget), GTK_ENTRY_ICON_SECONDARY, "folder"); #else gtk_entry_set_icon_from_stock (GTK_ENTRY (widget), GTK_ENTRY_ICON_SECONDARY, GTK_STOCK_DIRECTORY); #endif gtk_entry_set_icon_tooltip_text (GTK_ENTRY (widget), GTK_ENTRY_ICON_SECONDARY, _("Select Folder")); g_object_set (dform->folder_combo, "margin", 1, "hexpand", TRUE, NULL); gtk_grid_attach (top_grid, dform->folder_combo, 1, 3, 1, 1); g_signal_connect (widget, "icon-release", G_CALLBACK (on_select_folder), dform); g_signal_connect (GTK_EDITABLE (widget), "changed", G_CALLBACK (on_entry_changed), dform); // Folder - label widget = gtk_label_new_with_mnemonic (_("_Folder:")); gtk_label_set_mnemonic_widget(GTK_LABEL (widget), dform->folder_combo); g_object_set (widget, "margin-left", 3, "margin-right", 3, NULL); g_object_set (widget, "margin-top", 1, "margin-bottom", 1, NULL); gtk_grid_attach (top_grid, widget, 0, 3, 1, 1); // Referrer - entry widget = gtk_entry_new (); gtk_entry_set_activates_default (GTK_ENTRY (widget), TRUE); g_object_set (widget, "margin", 1, "hexpand", TRUE, NULL); gtk_grid_attach (top_grid, widget, 1, 4, 2, 1); g_signal_connect (GTK_EDITABLE (widget), "changed", G_CALLBACK (on_http_entry_changed), dform); dform->referrer_entry = widget; // Referrer - label widget = gtk_label_new_with_mnemonic (_("Referrer:")); gtk_label_set_mnemonic_widget (GTK_LABEL (widget), dform->referrer_entry); g_object_set (widget, "margin-left", 3, "margin-right", 3, NULL); g_object_set (widget, "margin-top", 1, "margin-bottom", 1, NULL); gtk_grid_attach (top_grid, widget, 0, 4, 1, 1); // dform->referrer_label = widget; // ---------------------------------------------------- // Connections // HBox for Connections hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); gtk_box_pack_start (top_vbox, hbox, FALSE, FALSE, 2); // connections - label // widget = gtk_label_new (_("connections")); // gtk_box_pack_end (GTK_BOX (hbox), widget, FALSE, FALSE, 2); // dform->label_connections = widget; // connections - spin button widget = gtk_spin_button_new_with_range (1.0, 16.0, 1.0); gtk_entry_set_activates_default (GTK_ENTRY (widget), TRUE); // gtk_entry_set_width_chars (GTK_ENTRY (widget), 3); // remove for GTK+ 3.12 gtk_box_pack_end (GTK_BOX (hbox), widget, FALSE, FALSE, 2); dform->spin_connections = widget; // "Max Connections:" - title label widget = gtk_label_new_with_mnemonic (_("_Max Connections:")); gtk_label_set_mnemonic_widget ((GtkLabel*)widget, dform->spin_connections); gtk_box_pack_end (GTK_BOX (hbox), widget, FALSE, FALSE, 2); dform->title_connections = widget; // ---------------------------------------------------- // HBox for "Status" and "Login" hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); gtk_box_pack_start (top_vbox, hbox, FALSE, FALSE, 2); // ---------------------------------------------------- // frame for Status (start mode) frame = gtk_frame_new (_("Status")); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2); gtk_container_set_border_width (GTK_CONTAINER (vbox), 2); gtk_container_add (GTK_CONTAINER (frame), vbox); gtk_box_pack_start (GTK_BOX (hbox), frame, FALSE, FALSE, 0); dform->radio_runnable = gtk_radio_button_new_with_mnemonic (NULL, _("_Runnable")); dform->radio_pause = gtk_radio_button_new_with_mnemonic_from_widget ( (GtkRadioButton*)dform->radio_runnable, _("P_ause")); gtk_box_pack_start (GTK_BOX (vbox), dform->radio_runnable, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), dform->radio_pause, FALSE, FALSE, 0); // ---------------------------------------------------- // frame for login frame = gtk_frame_new (_("Login")); grid = (GtkGrid*) gtk_grid_new (); gtk_container_set_border_width (GTK_CONTAINER (grid), 2); gtk_container_add (GTK_CONTAINER (frame), (GtkWidget*) grid); gtk_box_pack_start (GTK_BOX (hbox), frame, TRUE, TRUE, 2); // User - entry widget = gtk_entry_new (); gtk_entry_set_activates_default (GTK_ENTRY (widget), TRUE); g_object_set (widget, "margin", 1, "hexpand", TRUE, NULL); gtk_grid_attach (grid, widget, 1, 0, 1, 1); g_signal_connect (GTK_EDITABLE (widget), "changed", G_CALLBACK (on_entry_changed), dform); dform->username_entry = widget; // User - label widget = gtk_label_new (_("User:")); g_object_set (widget, "margin-left", 2, "margin-right", 2, NULL); g_object_set (widget, "margin-top", 1, "margin-bottom", 1, NULL); gtk_grid_attach (grid, widget, 0, 0, 1, 1); // dform->username_label = widget; // Password - entry widget = gtk_entry_new (); gtk_entry_set_visibility (GTK_ENTRY (widget), FALSE); gtk_entry_set_activates_default (GTK_ENTRY (widget), TRUE); g_object_set (widget, "margin", 1, "hexpand", TRUE, NULL); gtk_grid_attach (grid, widget, 1, 1, 1, 1); g_signal_connect (GTK_EDITABLE (widget), "changed", G_CALLBACK (on_entry_changed), dform); dform->password_entry = widget; // Password - label widget = gtk_label_new (_("Password:")); g_object_set (widget, "margin-left", 2, "margin-right", 2, NULL); g_object_set (widget, "margin-top", 1, "margin-bottom", 1, NULL); gtk_grid_attach (grid, widget, 0, 1, 1, 1); // dform->password_label = widget; // ---------------------------------------------------- // proxy // ug_proxy_widget_init (&dform->proxy_dform); if (proxy) { widget = proxy->self; gtk_box_pack_start (top_vbox, widget, FALSE, FALSE, 2); } } static void ugtk_download_form_init_page2 (UgtkDownloadForm* dform) { GtkWidget* widget; GtkGrid* grid; dform->page2 = gtk_grid_new (); grid = (GtkGrid*) dform->page2; gtk_container_set_border_width (GTK_CONTAINER (grid), 2); // label - cookie file widget = gtk_label_new (_("Cookie file:")); gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.5); // left, center g_object_set (widget, "margin-left", 2, "margin-right", 2, NULL); g_object_set (widget, "margin-top", 1, "margin-bottom", 1, NULL); gtk_grid_attach (grid, widget, 0, 0, 1, 1); dform->cookie_label = widget; // entry - cookie file widget = gtk_entry_new (); gtk_entry_set_activates_default (GTK_ENTRY (widget), TRUE); #if GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 10 gtk_entry_set_icon_from_icon_name (GTK_ENTRY (widget), GTK_ENTRY_ICON_SECONDARY, "text-x-generic"); #else gtk_entry_set_icon_from_stock (GTK_ENTRY (widget), GTK_ENTRY_ICON_SECONDARY, GTK_STOCK_FILE); #endif gtk_entry_set_icon_tooltip_text (GTK_ENTRY (widget), GTK_ENTRY_ICON_SECONDARY, _("Select Cookie File")); g_object_set (widget, "margin", 1, "hexpand", TRUE, NULL); gtk_grid_attach (grid, widget, 1, 0, 3, 1); g_signal_connect (widget, "icon-release", G_CALLBACK (on_select_cookie), dform); g_signal_connect (GTK_EDITABLE (widget), "changed", G_CALLBACK (on_http_entry_changed), dform); dform->cookie_entry = widget; // label - post file widget = gtk_label_new (_("Post file:")); gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.5); // left, center g_object_set (widget, "margin-left", 2, "margin-right", 2, NULL); g_object_set (widget, "margin-top", 1, "margin-bottom", 1, NULL); gtk_grid_attach (grid, widget, 0, 1, 1, 1); dform->post_label = widget; // entry - post file widget = gtk_entry_new (); gtk_entry_set_activates_default (GTK_ENTRY (widget), TRUE); #if GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 10 gtk_entry_set_icon_from_icon_name (GTK_ENTRY (widget), GTK_ENTRY_ICON_SECONDARY, "text-x-generic"); #else gtk_entry_set_icon_from_stock (GTK_ENTRY (widget), GTK_ENTRY_ICON_SECONDARY, GTK_STOCK_FILE); #endif gtk_entry_set_icon_tooltip_text (GTK_ENTRY (widget), GTK_ENTRY_ICON_SECONDARY, _("Select Post File")); g_object_set (widget, "margin", 1, "hexpand", TRUE, NULL); gtk_grid_attach (grid, widget, 1, 1, 3, 1); g_signal_connect (widget, "icon-release", G_CALLBACK (on_select_post), dform); g_signal_connect (GTK_EDITABLE (widget), "changed", G_CALLBACK (on_http_entry_changed), dform); dform->post_entry = widget; // label - user agent widget = gtk_label_new (_("User Agent:")); gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.5); // left, center g_object_set (widget, "margin-left", 2, "margin-right", 2, NULL); g_object_set (widget, "margin-top", 1, "margin-bottom", 1, NULL); gtk_grid_attach (grid, widget, 0, 2, 1, 1); dform->agent_label = widget; // entry - user agent widget = gtk_entry_new (); gtk_entry_set_activates_default (GTK_ENTRY (widget), TRUE); g_object_set (widget, "margin", 1, "hexpand", TRUE, NULL); gtk_grid_attach (grid, widget, 1, 2, 3, 1); g_signal_connect (GTK_EDITABLE (widget), "changed", G_CALLBACK (on_http_entry_changed), dform); dform->agent_entry = widget; // Retry limit - label widget = gtk_label_new_with_mnemonic (_("Retry _limit:")); gtk_label_set_mnemonic_widget (GTK_LABEL (widget), dform->spin_retry); g_object_set (widget, "margin-left", 2, "margin-right", 2, NULL); g_object_set (widget, "margin-top", 1, "margin-bottom", 1, NULL); gtk_grid_attach (grid, widget, 0, 3, 2, 1); // Retry limit - spin button widget = gtk_spin_button_new_with_range (0.0, 99.0, 1.0); gtk_entry_set_activates_default (GTK_ENTRY (widget), TRUE); g_object_set (widget, "margin-left", 2, "margin-right", 2, NULL); g_object_set (widget, "margin-top", 1, "margin-bottom", 1, NULL); gtk_grid_attach (grid, widget, 2, 3, 1, 1); g_signal_connect (GTK_EDITABLE (widget), "changed", G_CALLBACK (on_spin_changed), dform); dform->spin_retry = widget; // counts - label widget = gtk_label_new (_("counts")); gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.5); g_object_set (widget, "margin-left", 2, "margin-right", 2, NULL); g_object_set (widget, "margin-top", 1, "margin-bottom", 1, NULL); gtk_grid_attach (grid, widget, 3, 3, 1, 1); // Retry delay - label widget = gtk_label_new_with_mnemonic (_("Retry _delay:")); gtk_label_set_mnemonic_widget (GTK_LABEL (widget), dform->spin_delay); g_object_set (widget, "margin-left", 2, "margin-right", 2, NULL); g_object_set (widget, "margin-top", 1, "margin-bottom", 1, NULL); gtk_grid_attach (grid, widget, 0, 4, 2, 1); // Retry delay - spin button widget = gtk_spin_button_new_with_range (0.0, 600.0, 1.0); gtk_entry_set_activates_default (GTK_ENTRY (widget), TRUE); g_object_set (widget, "margin-left", 2, "margin-right", 2, NULL); g_object_set (widget, "margin-top", 1, "margin-bottom", 1, NULL); gtk_grid_attach (grid, widget, 2, 4, 1, 1); g_signal_connect (GTK_EDITABLE (widget), "changed", G_CALLBACK (on_spin_changed), dform); dform->spin_delay = widget; // seconds - label widget = gtk_label_new (_("seconds")); gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.5); g_object_set (widget, "margin-left", 2, "margin-right", 2, NULL); g_object_set (widget, "margin-top", 1, "margin-bottom", 1, NULL); gtk_grid_attach (grid, widget, 3, 4, 1, 1); // label - Max upload speed widget = gtk_label_new (_("Max upload speed:")); g_object_set (widget, "margin-left", 2, "margin-right", 2, NULL); g_object_set (widget, "margin-top", 1, "margin-bottom", 1, NULL); gtk_grid_attach (grid, widget, 0, 5, 2, 1); // spin - Max upload speed widget = gtk_spin_button_new_with_range (0, 99999999, 1); gtk_entry_set_activates_default (GTK_ENTRY (widget), TRUE); // gtk_entry_set_width_chars (GTK_ENTRY (widget), 8); g_object_set (widget, "margin", 1, NULL); gtk_grid_attach (grid, widget, 2, 5, 1, 1); dform->spin_upload_speed = (GtkSpinButton*) widget; // label - "KiB/s" widget = gtk_label_new (_("KiB/s")); gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.5); // left, center g_object_set (widget, "margin", 2, "hexpand", TRUE, NULL); gtk_grid_attach (grid, widget, 3, 5, 1, 1); // label - Max download speed widget = gtk_label_new (_("Max download speed:")); g_object_set (widget, "margin-left", 2, "margin-right", 2, NULL); g_object_set (widget, "margin-top", 1, "margin-bottom", 1, NULL); gtk_grid_attach (grid, widget, 0, 6, 2, 1); // spin - Max download speed widget = gtk_spin_button_new_with_range (0, 99999999, 1); gtk_entry_set_activates_default (GTK_ENTRY (widget), TRUE); // gtk_entry_set_width_chars (GTK_ENTRY (widget), 8); g_object_set (widget, "margin", 1, NULL); gtk_grid_attach (grid, widget, 2, 6, 1, 1); dform->spin_download_speed = (GtkSpinButton*) widget; // label - "KiB/s" widget = gtk_label_new (_("KiB/s")); gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.5); // left, center g_object_set (widget, "margin", 2, "hexpand", TRUE, NULL); gtk_grid_attach (grid, widget, 3, 6, 1, 1); // Retrieve timestamp widget = gtk_check_button_new_with_label (_("Retrieve timestamp")); g_object_set (widget, "margin-top", 3, "margin-bottom", 1, NULL); gtk_grid_attach (grid, widget, 0, 7, 3, 1); dform->timestamp = (GtkToggleButton*) widget; } void ugtk_download_form_get (UgtkDownloadForm* dform, UgetNode* node) { UgetCommon* common; UgetHttp* http; UgUri uuri; const gchar* text; gint number; // ------------------------------------------ // UgetCommon common = ug_info_realloc (&node->info, UgetCommonInfo); // folder text = gtk_entry_get_text ((GtkEntry*)dform->folder_entry); ug_free (common->folder); common->folder = (*text) ? ug_strdup (text) : NULL; ug_str_remove_crlf (common->folder, common->folder); // user text = gtk_entry_get_text ((GtkEntry*)dform->username_entry); ug_free (common->user); common->user = (*text) ? ug_strdup (text) : NULL; ug_str_remove_crlf (common->user, common->user); // password text = gtk_entry_get_text ((GtkEntry*)dform->password_entry); ug_free (common->password); common->password = (*text) ? ug_strdup (text) : NULL; ug_str_remove_crlf (common->password, common->password); // retry_limit number = gtk_spin_button_get_value_as_int ((GtkSpinButton*) dform->spin_retry); common->retry_limit = number; // retry_delay number = gtk_spin_button_get_value_as_int ((GtkSpinButton*) dform->spin_delay); common->retry_delay = number; // max_upload_speed number = gtk_spin_button_get_value_as_int ((GtkSpinButton*) dform->spin_upload_speed) * 1024; common->max_upload_speed = number; // max_download_speed number = gtk_spin_button_get_value_as_int ((GtkSpinButton*) dform->spin_download_speed) * 1024; common->max_download_speed = number; // max_connections number = gtk_spin_button_get_value_as_int ((GtkSpinButton*) dform->spin_connections); common->max_connections = number; // timestamp common->timestamp = gtk_toggle_button_get_active (dform->timestamp); // URI if (gtk_widget_is_sensitive (dform->uri_entry) == TRUE) { text = gtk_entry_get_text ((GtkEntry*)dform->uri_entry); ug_free (common->uri); common->uri = (*text) ? ug_strdup (text) : NULL; ug_str_remove_crlf (common->uri, common->uri); if (common->uri) { ug_uri_init (&uuri, common->uri); // set user number = ug_uri_user (&uuri, &text); if (number > 0) { ug_free (common->user); common->user = ug_strndup (text, number); } // set password number = ug_uri_password (&uuri, &text); if (number > 0) { ug_free (common->password); common->password = ug_strndup (text, number); } // Remove user & password from URL if (uuri.authority != uuri.host) { memmove ((char*)uuri.uri + uuri.authority, (char*)uuri.uri + uuri.host, strlen (uuri.uri + uuri.host) + 1); } } } // mirrors if (gtk_widget_is_sensitive (dform->mirrors_entry) == TRUE) { text = gtk_entry_get_text ((GtkEntry*)dform->mirrors_entry); ug_free (common->mirrors); common->mirrors = (*text) ? ug_strdup (text) : NULL; ug_str_remove_crlf (common->mirrors, common->mirrors); } // file if (gtk_widget_is_sensitive (dform->file_entry) == TRUE) { text = gtk_entry_get_text ((GtkEntry*)dform->file_entry); ug_free (common->file); common->file = (*text) ? ug_strdup (text) : NULL; ug_str_remove_crlf (common->file, common->file); } // ------------------------------------------ // UgetHttp http = ug_info_realloc (&node->info, UgetHttpInfo); // referrer text = gtk_entry_get_text ((GtkEntry*) dform->referrer_entry); ug_free (http->referrer); http->referrer = (*text) ? ug_strdup (text) : NULL; ug_str_remove_crlf (http->referrer, http->referrer); // cookie_file text = gtk_entry_get_text ((GtkEntry*) dform->cookie_entry); ug_free (http->cookie_file); http->cookie_file = (*text) ? ug_strdup (text) : NULL; ug_str_remove_crlf (http->cookie_file, http->cookie_file); // post_file text = gtk_entry_get_text ((GtkEntry*) dform->post_entry); ug_free (http->post_file); http->post_file = (*text) ? ug_strdup (text) : NULL; ug_str_remove_crlf (http->post_file, http->post_file); // user_agent text = gtk_entry_get_text ((GtkEntry*) dform->agent_entry); ug_free (http->user_agent); http->user_agent = (*text) ? ug_strdup (text) : NULL; ug_str_remove_crlf (http->user_agent, http->user_agent); // ------------------------------------------ // UgetNode if (gtk_widget_get_sensitive (dform->radio_pause)) { if (gtk_toggle_button_get_active ((GtkToggleButton*) dform->radio_pause)) node->state |= UGET_STATE_PAUSED; else node->state &= ~UGET_STATE_PAUSED; } } void ugtk_download_form_set (UgtkDownloadForm* dform, UgetNode* node, gboolean keep_changed) { UgetCommon* common; UgetHttp* http; common = ug_info_realloc (&node->info, UgetCommonInfo); http = ug_info_get (&node->info, UgetHttpInfo); // disable changed flags dform->changed.enable = FALSE; // ------------------------------------------ // UgetCommon // set changed flags if (keep_changed == FALSE && common) { dform->changed.uri = common->keeping.uri; dform->changed.mirrors = common->keeping.mirrors; dform->changed.file = common->keeping.file; dform->changed.folder = common->keeping.folder; dform->changed.user = common->keeping.user; dform->changed.password = common->keeping.password; dform->changed.retry = common->keeping.retry_limit; dform->changed.delay = common->keeping.retry_delay; dform->changed.max_upload_speed = common->keeping.max_upload_speed; dform->changed.max_download_speed = common->keeping.max_download_speed; dform->changed.timestamp = common->keeping.timestamp; } // set data if (keep_changed==FALSE || dform->changed.uri==FALSE) { if (gtk_widget_is_sensitive (dform->uri_entry)) { gtk_entry_set_text ((GtkEntry*) dform->uri_entry, (common && common->uri) ? common->uri : ""); } } if (keep_changed==FALSE || dform->changed.mirrors==FALSE) { if (gtk_widget_is_sensitive (dform->mirrors_entry)) { gtk_entry_set_text ((GtkEntry*) dform->mirrors_entry, (common && common->mirrors) ? common->mirrors : ""); } } if (keep_changed==FALSE || dform->changed.file==FALSE) { if (gtk_widget_is_sensitive (dform->file_entry)) { gtk_entry_set_text ((GtkEntry*) dform->file_entry, (common && common->file) ? common->file : ""); // set changed flags if (common && common->file) dform->changed.file = TRUE; } } if (keep_changed==FALSE || dform->changed.folder==FALSE) { g_signal_handlers_block_by_func (GTK_EDITABLE (dform->folder_entry), on_entry_changed, dform); gtk_entry_set_text ((GtkEntry*) dform->folder_entry, (common && common->folder) ? common->folder : ""); g_signal_handlers_unblock_by_func (GTK_EDITABLE (dform->folder_entry), on_entry_changed, dform); } if (keep_changed==FALSE || dform->changed.user==FALSE) { gtk_entry_set_text ((GtkEntry*) dform->username_entry, (common && common->user) ? common->user : ""); } if (keep_changed==FALSE || dform->changed.password==FALSE) { gtk_entry_set_text ((GtkEntry*) dform->password_entry, (common && common->password) ? common->password : ""); } if (keep_changed==FALSE || dform->changed.retry==FALSE) { gtk_spin_button_set_value ((GtkSpinButton*) dform->spin_retry, (common) ? common->retry_limit : 99); } if (keep_changed==FALSE || dform->changed.delay==FALSE) { gtk_spin_button_set_value ((GtkSpinButton*) dform->spin_delay, (common) ? common->retry_delay : 6); } if (keep_changed==FALSE || dform->changed.max_upload_speed==FALSE) { gtk_spin_button_set_value ((GtkSpinButton*) dform->spin_upload_speed, (gdouble) (common->max_upload_speed / 1024)); } if (keep_changed==FALSE || dform->changed.max_download_speed==FALSE) { gtk_spin_button_set_value ((GtkSpinButton*) dform->spin_download_speed, (gdouble) (common->max_download_speed / 1024)); } if (keep_changed==FALSE || dform->changed.connections==FALSE) { gtk_spin_button_set_value ((GtkSpinButton*) dform->spin_connections, common->max_connections); } if (keep_changed==FALSE || dform->changed.timestamp==FALSE) gtk_toggle_button_set_active (dform->timestamp, common->timestamp); // ------------------------------------------ // UgetHttp // set data if (keep_changed==FALSE || dform->changed.referrer==FALSE) { gtk_entry_set_text ((GtkEntry*) dform->referrer_entry, (http && http->referrer) ? http->referrer : ""); } if (keep_changed==FALSE || dform->changed.cookie==FALSE) { gtk_entry_set_text ((GtkEntry*) dform->cookie_entry, (http && http->cookie_file) ? http->cookie_file : ""); } if (keep_changed==FALSE || dform->changed.post==FALSE) { gtk_entry_set_text ((GtkEntry*) dform->post_entry, (http && http->post_file) ? http->post_file : ""); } if (keep_changed==FALSE || dform->changed.agent==FALSE) { gtk_entry_set_text ((GtkEntry*) dform->agent_entry, (http && http->user_agent) ? http->user_agent : ""); } // set changed flags if (keep_changed==FALSE && http) { dform->changed.referrer = http->keeping.referrer; dform->changed.cookie = http->keeping.cookie_file; dform->changed.post = http->keeping.post_file; dform->changed.agent = http->keeping.user_agent; } // ------------------------------------------ // UgetNode if (gtk_widget_get_sensitive (dform->radio_pause)) { if (node->state & UGET_STATE_PAUSED) gtk_toggle_button_set_active ((GtkToggleButton*) dform->radio_pause, TRUE); else gtk_toggle_button_set_active ((GtkToggleButton*) dform->radio_runnable, TRUE); } // enable changed flags dform->changed.enable = TRUE; // complete entry ugtk_download_form_complete_entry (dform); } void ugtk_download_form_set_multiple (UgtkDownloadForm* dform, gboolean multiple_mode) { // dform->multiple = multiple_mode; if (multiple_mode) { gtk_widget_hide (dform->uri_label); gtk_widget_hide (dform->uri_entry); gtk_widget_hide (dform->mirrors_label); gtk_widget_hide (dform->mirrors_entry); gtk_widget_hide (dform->file_label); gtk_widget_hide (dform->file_entry); } else { gtk_widget_show (dform->uri_label); gtk_widget_show (dform->uri_entry); gtk_widget_show (dform->mirrors_label); gtk_widget_show (dform->mirrors_entry); gtk_widget_show (dform->file_label); gtk_widget_show (dform->file_entry); } multiple_mode = !multiple_mode; gtk_widget_set_sensitive (dform->uri_label, multiple_mode); gtk_widget_set_sensitive (dform->uri_entry, multiple_mode); gtk_widget_set_sensitive (dform->mirrors_label, multiple_mode); gtk_widget_set_sensitive (dform->mirrors_entry, multiple_mode); gtk_widget_set_sensitive (dform->file_label, multiple_mode); gtk_widget_set_sensitive (dform->file_entry, multiple_mode); } void ugtk_download_form_set_folders (UgtkDownloadForm* dform, UgtkSetting* setting) { GtkComboBoxText* combo; UgLink* link; dform->changed.enable = FALSE; g_signal_handlers_block_by_func (GTK_EDITABLE (dform->folder_entry), on_entry_changed, dform); combo = GTK_COMBO_BOX_TEXT (dform->folder_combo); for (link = setting->folder_history.head; link; link = link->next) gtk_combo_box_text_append_text (combo, link->data); // set default folder gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 0); g_signal_handlers_unblock_by_func (GTK_EDITABLE (dform->folder_entry), on_entry_changed, dform); dform->changed.enable = TRUE; } void ugtk_download_form_get_folders (UgtkDownloadForm* dform, UgtkSetting* setting) { const gchar* current; current = gtk_entry_get_text ((GtkEntry*) dform->folder_entry); ugtk_setting_add_folder (setting, current); } void ugtk_download_form_complete_entry (UgtkDownloadForm* dform) { const gchar* text; // gchar* temp; UgUri upart; gboolean completed = FALSE; // URL text = gtk_entry_get_text ((GtkEntry*) dform->uri_entry); ug_uri_init (&upart, text); if (upart.host != -1) { // disable changed flags dform->changed.enable = FALSE; #if 0 // complete file entry text = gtk_entry_get_text ((GtkEntry*) dform->file_entry); if (text[0] == 0 || dform->changed.file == FALSE) { temp = ug_uri_get_file (&upart); gtk_entry_set_text ((GtkEntry*) dform->file_entry, (temp) ? temp : "index.htm"); g_free (temp); } // complete user entry text = gtk_entry_get_text ((GtkEntry*) dform->username_entry); if (text[0] == 0 || dform->changed.user == FALSE) { temp = ug_uri_get_user (&upart); gtk_entry_set_text ((GtkEntry*) dform->username_entry, (temp) ? temp : ""); g_free (temp); } // complete password entry text = gtk_entry_get_text ((GtkEntry*) dform->password_entry); if (text[0] == 0 || dform->changed.password == FALSE) { temp = ug_uri_get_password (&upart); gtk_entry_set_text ((GtkEntry*) dform->password_entry, (temp) ? temp : ""); g_free (temp); } #endif // enable changed flags dform->changed.enable = TRUE; // status completed = TRUE; } #if 1 // check existing for file name else if (ug_uri_part_file (&upart, &text) > 0) { completed = TRUE; } #else // file extension else if (ug_uri_part_file_ext (&upart, &text) > 0) { // torrent or metalink file path if (*text == 'm' || *text == 'M' || *text == 't' || *text == 'T') completed = TRUE; } #endif else if (upart.path > 0 && upart.uri[upart.path] != 0) completed = TRUE; else if (gtk_widget_is_sensitive (dform->uri_entry) == FALSE) completed = TRUE; dform->completed = completed; } // ---------------------------------------------------------------------------- // signal handler static void on_spin_changed (GtkEditable* editable, UgtkDownloadForm* dform) { if (dform->changed.enable) { if (editable == GTK_EDITABLE (dform->spin_retry)) dform->changed.retry = TRUE; else if (editable == GTK_EDITABLE (dform->spin_delay)) dform->changed.delay = TRUE; } } static void on_entry_changed (GtkEditable* editable, UgtkDownloadForm* dform) { if (dform->changed.enable) { if (editable == GTK_EDITABLE (dform->file_entry)) dform->changed.file = TRUE; else if (editable == GTK_EDITABLE (dform->folder_entry)) dform->changed.folder = TRUE; else if (editable == GTK_EDITABLE (dform->username_entry)) dform->changed.user = TRUE; else if (editable == GTK_EDITABLE (dform->password_entry)) dform->changed.password = TRUE; } } static void on_uri_entry_changed (GtkEditable* editable, UgtkDownloadForm* dform) { if (dform->changed.enable) { dform->changed.uri = TRUE; ugtk_download_form_complete_entry (dform); } } static void on_http_entry_changed (GtkEditable* editable, UgtkDownloadForm* dform) { if (dform->changed.enable) { if (editable == GTK_EDITABLE (dform->referrer_entry)) dform->changed.referrer = TRUE; else if (editable == GTK_EDITABLE (dform->cookie_entry)) dform->changed.cookie = TRUE; else if (editable == GTK_EDITABLE (dform->post_entry)) dform->changed.post = TRUE; else if (editable == GTK_EDITABLE (dform->agent_entry)) dform->changed.agent = TRUE; } } static void on_select_folder_response (GtkDialog* chooser, gint response, UgtkDownloadForm* dform) { gchar* file; gchar* path; if (response == GTK_RESPONSE_OK ) { file = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (chooser)); path = g_filename_to_utf8 (file, -1, NULL, NULL, NULL); gtk_entry_set_text (GTK_ENTRY (dform->folder_entry), path); g_free (path); g_free (file); } gtk_widget_destroy (GTK_WIDGET (chooser)); if (dform->parent) gtk_widget_set_sensitive ((GtkWidget*) dform->parent, TRUE); } static void on_select_folder (GtkEntry* entry, GtkEntryIconPosition icon_pos, GdkEvent* event, UgtkDownloadForm* dform) { GtkWidget* chooser; gchar* path; gchar* title; // disable sensitive of parent window // enable sensitive in function on_file_chooser_response() if (dform->parent) gtk_widget_set_sensitive ((GtkWidget*) dform->parent, FALSE); title = g_strconcat (UGTK_APP_NAME " - ", _("Select Folder"), NULL); chooser = gtk_file_chooser_dialog_new (title, dform->parent, GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OK, GTK_RESPONSE_OK, NULL); g_free (title); gtk_window_set_transient_for ((GtkWindow*) chooser, dform->parent); gtk_window_set_destroy_with_parent ((GtkWindow*) chooser, TRUE); path = (gchar*) gtk_entry_get_text ((GtkEntry*) dform->folder_entry); if (*path) { path = g_filename_from_utf8 (path, -1, NULL, NULL, NULL); gtk_file_chooser_select_filename (GTK_FILE_CHOOSER (chooser), path); g_free (path); } g_signal_connect (chooser, "response", G_CALLBACK (on_select_folder_response), dform); if (gtk_window_get_modal (dform->parent)) gtk_dialog_run ((GtkDialog*) chooser); else { gtk_window_set_modal ((GtkWindow*) chooser, FALSE); gtk_widget_show (chooser); } } static void on_select_cookie_response (GtkDialog* chooser, gint response, UgtkDownloadForm* dform) { gchar* file; gchar* path; if (response == GTK_RESPONSE_OK ) { file = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (chooser)); path = g_filename_to_utf8 (file, -1, NULL, NULL, NULL); gtk_entry_set_text (GTK_ENTRY (dform->cookie_entry), path); g_free (path); g_free (file); } gtk_widget_destroy (GTK_WIDGET (chooser)); if (dform->parent) gtk_widget_set_sensitive ((GtkWidget*) dform->parent, TRUE); } static void on_select_cookie (GtkEntry* entry, GtkEntryIconPosition icon_pos, GdkEvent* event, UgtkDownloadForm* dform) { GtkWidget* chooser; gchar* path; gchar* title; // disable sensitive of parent window // enable sensitive in function on_file_chooser_response() if (dform->parent) gtk_widget_set_sensitive ((GtkWidget*) dform->parent, FALSE); title = g_strconcat (UGTK_APP_NAME " - ", _("Select Cookie File"), NULL); chooser = gtk_file_chooser_dialog_new (title, dform->parent, GTK_FILE_CHOOSER_ACTION_OPEN, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OK, GTK_RESPONSE_OK, NULL); g_free (title); gtk_window_set_transient_for ((GtkWindow*) chooser, dform->parent); gtk_window_set_destroy_with_parent ((GtkWindow*) chooser, TRUE); path = (gchar*) gtk_entry_get_text ((GtkEntry*) dform->cookie_entry); if (*path) { path = g_filename_from_utf8 (path, -1, NULL, NULL, NULL); gtk_file_chooser_select_filename (GTK_FILE_CHOOSER (chooser), path); g_free (path); } g_signal_connect (chooser, "response", G_CALLBACK (on_select_cookie_response), dform); if (gtk_window_get_modal (dform->parent)) gtk_dialog_run ((GtkDialog*) chooser); else { gtk_window_set_modal ((GtkWindow*) chooser, FALSE); gtk_widget_show (chooser); } } static void on_select_post_response (GtkDialog* chooser, gint response, UgtkDownloadForm* dform) { gchar* file; gchar* path; if (response == GTK_RESPONSE_OK ) { file = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (chooser)); path = g_filename_to_utf8 (file, -1, NULL, NULL, NULL); gtk_entry_set_text (GTK_ENTRY (dform->post_entry), path); g_free (path); g_free (file); } gtk_widget_destroy (GTK_WIDGET (chooser)); if (dform->parent) gtk_widget_set_sensitive ((GtkWidget*) dform->parent, TRUE); } static void on_select_post (GtkEntry* entry, GtkEntryIconPosition icon_pos, GdkEvent* event, UgtkDownloadForm* dform) { GtkWidget* chooser; gchar* path; gchar* title; // disable sensitive of parent window // enable sensitive in function on_file_chooser_response() if (dform->parent) gtk_widget_set_sensitive ((GtkWidget*) dform->parent, FALSE); title = g_strconcat (UGTK_APP_NAME " - ", _("Select Post File"), NULL); chooser = gtk_file_chooser_dialog_new (title, dform->parent, GTK_FILE_CHOOSER_ACTION_OPEN, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OK, GTK_RESPONSE_OK, NULL); g_free (title); gtk_window_set_transient_for ((GtkWindow*) chooser, dform->parent); gtk_window_set_destroy_with_parent ((GtkWindow*) chooser, TRUE); path = (gchar*) gtk_entry_get_text ((GtkEntry*) dform->post_entry); if (*path) { path = g_filename_from_utf8 (path, -1, NULL, NULL, NULL); gtk_file_chooser_select_filename (GTK_FILE_CHOOSER (chooser), path); g_free (path); } g_signal_connect (chooser, "response", G_CALLBACK (on_select_post_response), dform); if (gtk_window_get_modal (dform->parent)) gtk_dialog_run ((GtkDialog*) chooser); else { gtk_window_set_modal ((GtkWindow*) chooser, FALSE); gtk_widget_show (chooser); } } uget-2.2.0/ui-gtk/UgtkSequence.h0000644000175000000120000000666113224532612013353 00000000000000/* * * Copyright (C) 2005-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #ifndef UGTK_SEQUENCE_H #define UGTK_SEQUENCE_H #include #include #ifdef __cplusplus extern "C" { #endif typedef struct UgtkSequence UgtkSequence; typedef struct UgtkSeqRange UgtkSeqRange; typedef void (*UgtkSequenceNotify) (gpointer user_data, gboolean completed); enum UgtkSeqType { UGTK_SEQ_TYPE_NONE, UGTK_SEQ_TYPE_NUMBER, UGTK_SEQ_TYPE_CHARACTER }; // ----------------------------------------------------------------------------- // UgtkSeqRange struct UgtkSeqRange { GtkWidget* self; GtkWidget* type; // GtkComboBox - None, Number, and Character GtkWidget* label_to; // digit mode GtkWidget* spin_from; GtkWidget* spin_to; GtkWidget* spin_digits; GtkWidget* label_digits; // character mode GtkWidget* entry_from; GtkWidget* entry_to; GtkWidget* label_case; }; void ugtk_seq_range_init (UgtkSeqRange* range, UgtkSequence* seq, GtkSizeGroup* size_group); void ugtk_seq_range_set_type (UgtkSeqRange* range, enum UgtkSeqType type); enum UgtkSeqType ugtk_seq_range_get_type (UgtkSeqRange* range); // ----------------------------------------------------------------------------- // UgtkSequence struct UgtkSequence { GtkWidget* self; // GtkGrid GtkEntry* entry; // URI + wildcard character (*) UgtkSeqRange range[3]; // range x 3 UgetSequence sequence; // preview struct UgtkSequencePreview { GtkWidget* self; // GtkScrolledWindow GtkTreeView* view; GtkListStore* store; guint status; } preview; // callback struct { // UgtkNotify func1; UgtkSequenceNotify func; gpointer data; } notify; }; void ugtk_sequence_init (UgtkSequence* seq); void ugtk_sequence_show_preview (UgtkSequence* seq); int ugtk_sequence_get_list (UgtkSequence* seq, UgList* result); #ifdef __cplusplus } #endif #endif // End of UGTK_SEQUENCE_H uget-2.2.0/ui-gtk/UgtkNodeDialog.c0000644000175000000120000004756013224532612013606 00000000000000/* * * Copyright (C) 2005-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #include #include #include // UI static void ugtk_node_dialog_init_ui (UgtkNodeDialog* ndialog, gboolean has_category_form); static void ugtk_node_dialog_init_list_ui (UgtkNodeDialog* ndialog, UgetNode* root); // Callback static void on_cursor_changed (GtkTreeView* view, UgtkNodeDialog* ndialog); static void after_uri_entry_changed (GtkEditable *editable, UgtkNodeDialog* ndialog); static void on_response_new_category (GtkDialog *dialog, gint response_id, UgtkNodeDialog* ndialog); static void on_response_new_download (GtkDialog *dialog, gint response_id, UgtkNodeDialog* ndialog); static void on_response_edit_category (GtkDialog *dialog, gint response_id, UgtkNodeDialog* ndialog); static void on_response_edit_download (GtkDialog *dialog, gint response_id, UgtkNodeDialog* ndialog); // Callback for Main Window operate static void on_category_row_changed (GtkTreeModel* model, GtkTreePath* path, GtkTreeIter* iter, UgtkNodeDialog* ndialog); static void on_category_row_deleted (GtkTreeModel* model, GtkTreePath* path, UgtkNodeDialog* ndialog); static void on_category_row_inserted (GtkTreeModel* model, GtkTreePath* path, GtkTreeIter* iter, UgtkNodeDialog* ndialog); // ---------------------------------------------------------------------------- // UgtkNodeDialog void ugtk_node_dialog_init (UgtkNodeDialog* ndialog, const char* title, UgtkApp* app, gboolean has_category_form) { GtkWindow* window; int sensitive; int width, height, temp; ugtk_node_dialog_init_ui (ndialog, has_category_form); ndialog->app = app; // decide width if (app->setting.window.category) { gtk_widget_get_size_request (ndialog->notebook, &width, &height); temp = gtk_paned_get_position (ndialog->app->window.hpaned); temp = temp * 5 / 3; // (temp * 1.666) if (width < temp) gtk_widget_set_size_request (ndialog->notebook, temp, height); } window = (GtkWindow*) ndialog->self; gtk_window_set_transient_for (window, app->window.self); gtk_window_set_destroy_with_parent (window, TRUE); if (title) gtk_window_set_title (window, title); #if GTK_MAJOR_VERSION <= 3 && GTK_MINOR_VERSION < 14 gtk_window_set_has_resize_grip (window, FALSE); #endif // decide sensitive by plug-in matching order switch (app->setting.plugin_order) { default: case UGTK_PLUGIN_ORDER_ARIA2: case UGTK_PLUGIN_ORDER_ARIA2_CURL: sensitive = FALSE; break; case UGTK_PLUGIN_ORDER_CURL: case UGTK_PLUGIN_ORDER_CURL_ARIA2: sensitive = TRUE; break; } gtk_widget_set_sensitive ((GtkWidget*) ndialog->download.cookie_label, sensitive); gtk_widget_set_sensitive ((GtkWidget*) ndialog->download.cookie_entry, sensitive); gtk_widget_set_sensitive ((GtkWidget*) ndialog->download.post_label, sensitive); gtk_widget_set_sensitive ((GtkWidget*) ndialog->download.post_entry, sensitive); } UgtkNodeDialog* ugtk_node_dialog_new (const char* title, UgtkApp* app, gboolean has_category_form) { UgtkNodeDialog* ndialog; ndialog = g_malloc0 (sizeof (UgtkNodeDialog)); ugtk_node_dialog_init (ndialog, title, app, has_category_form); // OK & cancel buttons gtk_dialog_add_button (ndialog->self, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL); gtk_dialog_add_button (ndialog->self, GTK_STOCK_OK, GTK_RESPONSE_OK); gtk_dialog_set_default_response (ndialog->self, GTK_RESPONSE_OK); return ndialog; } void ugtk_node_dialog_free (UgtkNodeDialog* ndialog) { ugtk_node_dialog_set_category (ndialog, NULL); gtk_widget_destroy (GTK_WIDGET (ndialog->self)); g_free (ndialog); } void ugtk_node_dialog_run (UgtkNodeDialog* ndialog, UgtkNodeDialogMode mode, UgetNode* node) { if (node) { ndialog->node = node; uget_node_ref (node); } switch (mode) { case UGTK_NODE_DIALOG_NEW_DOWNLOAD: ugtk_node_dialog_apply_recent (ndialog, ndialog->app); g_signal_connect (ndialog->self, "response", G_CALLBACK (on_response_new_download), ndialog); break; case UGTK_NODE_DIALOG_NEW_CATEGORY: gtk_window_resize ((GtkWindow*) ndialog->self, 300, 380); g_signal_connect (ndialog->self, "response", G_CALLBACK (on_response_new_category), ndialog); break; case UGTK_NODE_DIALOG_EDIT_DOWNLOAD: g_signal_connect (ndialog->self, "response", G_CALLBACK (on_response_edit_download), ndialog); break; case UGTK_NODE_DIALOG_EDIT_CATEGORY: gtk_window_resize ((GtkWindow*) ndialog->self, 300, 380); g_signal_connect (ndialog->self, "response", G_CALLBACK (on_response_edit_category), ndialog); break; } ugtk_node_dialog_monitor_uri (ndialog); // gtk_dialog_run (ndialog->self); gtk_widget_show ((GtkWidget*) ndialog->self); // g_signal_connect (ndialog->button_back, "clicked", // G_CALLBACK (on_button_back), ndialog); // g_signal_connect (ndialog->button_forward, "clicked", // G_CALLBACK (on_button_forward), ndialog); } void ugtk_node_dialog_monitor_uri (UgtkNodeDialog* ndialog) { GtkEditable* editable; if (gtk_widget_get_sensitive (ndialog->download.uri_entry)) { gtk_dialog_set_response_sensitive (ndialog->self, GTK_RESPONSE_OK, ndialog->download.completed); editable = GTK_EDITABLE (ndialog->download.uri_entry); g_signal_connect_after (editable, "changed", G_CALLBACK (after_uri_entry_changed), ndialog); } } gboolean ugtk_node_dialog_confirm_existing (UgtkNodeDialog* ndialog, const char* uri) { GtkWidget* dialog; gboolean existing; int response; char* title; existing = uget_uri_hash_find (ndialog->app->uri_hash, uri); if (existing) { dialog = gtk_message_dialog_new ((GtkWindow*) ndialog->self, GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, _("URI had existed")); gtk_message_dialog_format_secondary_text ((GtkMessageDialog*) dialog, "%s", _("This URI had existed, are you sure to continue?")); // title title = g_strconcat ("uGet - ", _("URI had existed"), NULL); gtk_window_set_title ((GtkWindow*) dialog, title); g_free (title); // run and get response response = gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); if (response == GTK_RESPONSE_NO) return FALSE; } return TRUE; } void ugtk_node_dialog_store_recent (UgtkNodeDialog* ndialog, UgtkApp* app) { GtkTreePath* path; int nth; app->recent.saved = TRUE; gtk_tree_view_get_cursor (ndialog->node_view, &path, NULL); if (path != NULL) { nth = *gtk_tree_path_get_indices (path); app->recent.category_index = nth; gtk_tree_path_free (path); } ugtk_download_form_get (&ndialog->download, app->recent.infonode); } void ugtk_node_dialog_apply_recent (UgtkNodeDialog* ndialog, UgtkApp* app) { GtkTreePath* path; if (app->recent.saved && app->setting.ui.apply_recent) { path = gtk_tree_path_new_from_indices (app->recent.category_index, -1); gtk_tree_view_set_cursor (ndialog->node_view, path, NULL, FALSE); gtk_tree_path_free (path); ndialog->download.changed.uri = TRUE; ugtk_download_form_set (&ndialog->download, app->recent.infonode, TRUE); } } void ugtk_node_dialog_set_category (UgtkNodeDialog* ndialog, UgetNode* cnode) { GtkTreeModel* model; GtkTreePath* path; int nth; if (cnode == NULL) { if (ndialog->node_tree == NULL) return; model = GTK_TREE_MODEL (ndialog->app->traveler.category.model); for (nth = 0; nth < 3; nth++) g_signal_handler_disconnect (model, ndialog->handler_id[nth]); return; } nth = uget_node_child_position (cnode->parent, cnode); ugtk_node_dialog_init_list_ui (ndialog, cnode->parent); g_signal_connect (ndialog->node_view, "cursor-changed", G_CALLBACK (on_cursor_changed), ndialog); path = gtk_tree_path_new_from_indices (nth, -1); gtk_tree_view_set_cursor (ndialog->node_view, path, NULL, FALSE); gtk_tree_path_free (path); // signal model = GTK_TREE_MODEL (ndialog->app->traveler.category.model); ndialog->handler_id[0] = g_signal_connect (model, "row-changed", G_CALLBACK (on_category_row_changed), ndialog); ndialog->handler_id[1] = g_signal_connect (model, "row-deleted", G_CALLBACK (on_category_row_deleted), ndialog); ndialog->handler_id[2] = g_signal_connect (model, "row-inserted", G_CALLBACK (on_category_row_inserted), ndialog); } int ugtk_node_dialog_get_category (UgtkNodeDialog* ndialog, UgetNode** cnode) { GtkTreePath* path; int nth; if (ndialog->node_tree == NULL) { *cnode = NULL; return -1; } gtk_tree_view_get_cursor (ndialog->node_view, &path, NULL); nth = *gtk_tree_path_get_indices (path); gtk_tree_path_free (path); *cnode = uget_node_nth_child (ndialog->node_tree->root, nth); return nth; } void ugtk_node_dialog_set (UgtkNodeDialog* ndialog, UgetNode* node) { ugtk_proxy_form_set (&ndialog->proxy, node, FALSE); ugtk_download_form_set (&ndialog->download, node, FALSE); if (ndialog->category.self) ugtk_category_form_set (&ndialog->category, node); } void ugtk_node_dialog_get (UgtkNodeDialog* ndialog, UgetNode* node) { ugtk_proxy_form_get (&ndialog->proxy, node); ugtk_download_form_get (&ndialog->download, node); if (ndialog->category.self) ugtk_category_form_get (&ndialog->category, node); } // ---------------------------------------------------------------------------- // UI static void ugtk_node_dialog_init_ui (UgtkNodeDialog* ndialog, gboolean has_category_form) { GtkNotebook* notebook; GtkWidget* widget; GtkBox* box; ndialog->self = (GtkDialog*) gtk_dialog_new (); // content box = (GtkBox*) gtk_dialog_get_content_area (ndialog->self); widget = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); gtk_box_pack_start (box, widget, TRUE, TRUE, 0); ndialog->hbox = (GtkBox*) widget; widget = gtk_notebook_new (); gtk_box_pack_end (ndialog->hbox, widget, TRUE, TRUE, 1); ndialog->notebook = widget; notebook = (GtkNotebook*) widget; gtk_widget_show_all (GTK_WIDGET (box)); // Download form (Page 1, 2) ugtk_proxy_form_init (&ndialog->proxy); ugtk_download_form_init (&ndialog->download, &ndialog->proxy, (GtkWindow*) ndialog->self); if (has_category_form == FALSE) { // UGTK_NODE_DIALOG_DOWNLOAD gtk_notebook_append_page (notebook, ndialog->download.page1, gtk_label_new (_("General"))); gtk_notebook_append_page (notebook, ndialog->download.page2, gtk_label_new (_("Advanced"))); // set focus widget gtk_window_set_focus (GTK_WINDOW (ndialog->self), ndialog->download.uri_entry); } else { // UGTK_NODE_DIALOG_CATEGORY ugtk_category_form_init (&ndialog->category); gtk_notebook_append_page (notebook, ndialog->category.self, gtk_label_new (_("Category settings"))); gtk_notebook_append_page (notebook, ndialog->download.page1, gtk_label_new (_("Default for new download 1"))); gtk_notebook_append_page (notebook, ndialog->download.page2, gtk_label_new (_("Default 2"))); // hide field URI, mirrors, and rename ugtk_download_form_set_multiple (&ndialog->download, TRUE); // set focus widget gtk_window_set_focus (GTK_WINDOW (ndialog->self), ndialog->category.name_entry); } // gtk_widget_show (GTK_WIDGET (notebook)); } static void ugtk_node_dialog_init_list_ui (UgtkNodeDialog* ndialog, UgetNode* root) { GtkTreeModel* model; GtkWidget* scrolled; GtkBox* vbox; int width; // decide width if (ndialog->app->setting.window.category) width = gtk_paned_get_position (ndialog->app->window.hpaned); else width = 165; ndialog->node_tree = ugtk_node_tree_new (root, TRUE); ndialog->node_view = (GtkTreeView*) ugtk_node_view_new_for_category (); model = GTK_TREE_MODEL (ndialog->node_tree); gtk_tree_view_set_model (ndialog->node_view, model); ugtk_node_view_use_large_icon (ndialog->node_view, ndialog->app->setting.ui.large_icon, ndialog->app->setting.download_column.width.state); scrolled = gtk_scrolled_window_new (NULL, NULL); gtk_widget_set_size_request (scrolled, width, 200); gtk_widget_show (scrolled); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled), GTK_SHADOW_IN); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_container_add (GTK_CONTAINER (scrolled), GTK_WIDGET (ndialog->node_view)); // pack vbox vbox = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 2); gtk_box_pack_start (vbox, gtk_label_new (_("Category")), FALSE, FALSE, 0); gtk_box_pack_start (vbox, (GtkWidget*) scrolled, TRUE, TRUE, 0); gtk_box_pack_start (ndialog->hbox, (GtkWidget*) vbox, FALSE, FALSE, 1); gtk_widget_show_all ((GtkWidget*) vbox); } // ---------------------------------------------------------------------------- // Callback static void on_cursor_changed (GtkTreeView* view, UgtkNodeDialog* ndialog) { GtkTreeModel* model; GtkTreePath* path; GtkTreeIter iter; UgetNode* node; // apply settings model = gtk_tree_view_get_model (view); gtk_tree_view_get_cursor (view, &path, NULL); if (path == NULL) return; gtk_tree_model_get_iter (model, &iter, path); gtk_tree_path_free (path); node = iter.user_data; ugtk_proxy_form_set (&ndialog->proxy, node, TRUE); ugtk_download_form_set (&ndialog->download, node, TRUE); } static void after_uri_entry_changed (GtkEditable *editable, UgtkNodeDialog* ndialog) { gtk_dialog_set_response_sensitive (ndialog->self, GTK_RESPONSE_OK, ndialog->download.completed); } static void on_response_new_category (GtkDialog *dialog, gint response_id, UgtkNodeDialog* ndialog) { UgetNode* cnode; if (response_id == GTK_RESPONSE_OK) { cnode = uget_node_new (NULL); ugtk_node_dialog_get (ndialog, cnode); uget_app_add_category ((UgetApp*) ndialog->app, cnode, TRUE); ugtk_app_decide_category_sensitive (ndialog->app); ugtk_download_form_get_folders (&ndialog->download, &ndialog->app->setting); } if (ndialog->node) uget_node_unref (ndialog->node); ugtk_node_dialog_free (ndialog); } static void on_response_new_download (GtkDialog *dialog, gint response_id, UgtkNodeDialog* ndialog) { UgetNode* cnode; UgetNode* dnode; const char* uri; if (response_id == GTK_RESPONSE_OK) { ugtk_node_dialog_store_recent (ndialog, ndialog->app); dnode = uget_node_new (NULL); ugtk_node_dialog_get (ndialog, dnode); ugtk_node_dialog_get_category (ndialog, &cnode); uri = gtk_entry_get_text ((GtkEntry*) ndialog->download.uri_entry); if (ugtk_node_dialog_confirm_existing (ndialog, uri)) { uget_app_add_download ((UgetApp*) ndialog->app, dnode, cnode, FALSE); ugtk_download_form_get_folders (&ndialog->download, &ndialog->app->setting); } } if (ndialog->node) uget_node_unref (ndialog->node); ugtk_node_dialog_free (ndialog); } static void on_response_edit_category (GtkDialog *dialog, gint response_id, UgtkNodeDialog* ndialog) { UgtkApp* app; if (response_id == GTK_RESPONSE_OK && ndialog->node) { app = ndialog->app; ugtk_node_dialog_get (ndialog, ndialog->node); ugtk_app_category_changed (app, ndialog->node); uget_node_unref (ndialog->node); ugtk_download_form_get_folders (&ndialog->download, &app->setting); } ugtk_node_dialog_free (ndialog); } static void on_response_edit_download (GtkDialog *dialog, gint response_id, UgtkNodeDialog* ndialog) { UgtkApp* app; if (response_id == GTK_RESPONSE_OK && ndialog->node) { app = ndialog->app; uget_uri_hash_remove_download (app->uri_hash, ndialog->node); ugtk_node_dialog_get (ndialog, ndialog->node); uget_uri_hash_add_download (app->uri_hash, ndialog->node); ugtk_traveler_reserve_selection (&app->traveler); uget_app_reset_download_name ((UgetApp*) app, ndialog->node); ugtk_traveler_restore_selection (&app->traveler); uget_node_unref (ndialog->node); ugtk_download_form_get_folders (&ndialog->download, &app->setting); } ugtk_node_dialog_free (ndialog); } // ---------------------------------------------------------------------------- // Callback for Main Window operate static void on_category_row_changed (GtkTreeModel* model, GtkTreePath* path_mw, GtkTreeIter* iter_mw, UgtkNodeDialog* ndialog) { GtkTreePath* path; GtkTreeIter* iter; path = gtk_tree_path_copy (path_mw); iter = gtk_tree_iter_copy (iter_mw); iter->stamp = ndialog->node_tree->stamp; gtk_tree_path_prev (path); gtk_tree_model_row_changed (GTK_TREE_MODEL (ndialog->node_tree), path, iter); gtk_tree_path_free (path); gtk_tree_iter_free (iter); } static void on_category_row_deleted (GtkTreeModel* model, GtkTreePath* path_mw, UgtkNodeDialog* ndialog) { GtkTreePath* path; path = gtk_tree_path_copy (path_mw); gtk_tree_path_prev (path); gtk_tree_model_row_deleted (GTK_TREE_MODEL (ndialog->node_tree), path); gtk_tree_path_free (path); } static void on_category_row_inserted (GtkTreeModel* model, GtkTreePath* path_mw, GtkTreeIter* iter_mw, UgtkNodeDialog* ndialog) { GtkTreePath* path; GtkTreeIter* iter; path = gtk_tree_path_copy (path_mw); iter = gtk_tree_iter_copy (iter_mw); iter->stamp = ndialog->node_tree->stamp; gtk_tree_path_prev (path); gtk_tree_model_row_inserted (GTK_TREE_MODEL (ndialog->node_tree), path, iter); gtk_tree_path_free (path); gtk_tree_iter_free (iter); } uget-2.2.0/ui-gtk/UgtkProxyForm.c0000644000175000000120000004053713224532612013543 00000000000000/* * * Copyright (C) 2005-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #include #include #include #include static void ugtk_proxy_form_std_init (UgtkProxyForm* pform); // signal handler static void on_type_changed (GtkComboBox* widget, UgtkProxyForm* pform); static void on_entry_std_changed (GtkEditable* editable, UgtkProxyForm* pform); #ifdef HAVE_LIBPWMD static void ugtk_proxy_form_pwmd_init (struct UgtkProxyFormPwmd* pfp, UgtkProxyForm* pform); static void on_entry_pwmd_changed (GtkEditable* editable, UgtkProxyForm* pform); #endif void ugtk_proxy_form_init (UgtkProxyForm* pform) { GtkWidget* vbox; GtkWidget* hbox; GtkWidget* widget; pform->changed.enable = TRUE; pform->changed.type = FALSE; // proxy type label & combo box widget = gtk_label_new (_("Proxy:")); pform->type = gtk_combo_box_text_new (); gtk_combo_box_text_insert_text (GTK_COMBO_BOX_TEXT (pform->type), UGET_PROXY_NONE, _("Don't use")); gtk_combo_box_text_insert_text (GTK_COMBO_BOX_TEXT (pform->type), UGET_PROXY_DEFAULT, _("Default")); gtk_combo_box_text_insert_text (GTK_COMBO_BOX_TEXT (pform->type), UGET_PROXY_HTTP, "HTTP"); gtk_combo_box_text_insert_text (GTK_COMBO_BOX_TEXT (pform->type), UGET_PROXY_SOCKS4, "SOCKS v4"); gtk_combo_box_text_insert_text (GTK_COMBO_BOX_TEXT (pform->type), UGET_PROXY_SOCKS5, "SOCKS v5"); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); gtk_box_pack_start (GTK_BOX (hbox), widget, FALSE, FALSE, 1); gtk_box_pack_start (GTK_BOX (hbox), pform->type, FALSE, FALSE, 2); // gtk_box_pack_start (GTK_BOX (hbox), // gtk_separator_new (GTK_ORIENTATION_HORIZONTAL), TRUE, TRUE, 2); g_signal_connect (pform->type, "changed", G_CALLBACK (on_type_changed), pform); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); ugtk_proxy_form_std_init (pform); gtk_box_pack_end (GTK_BOX (vbox), pform->std, TRUE, TRUE, 0); #ifdef HAVE_LIBPWMD gtk_combo_box_text_insert_text (GTK_COMBO_BOX_TEXT (pform->type), UGET_PROXY_PWMD, "PWMD"); ugtk_proxy_form_pwmd_init (&pform->pwmd, pform); gtk_box_pack_end (GTK_BOX (vbox), pform->pwmd.self, TRUE, TRUE, 0); #endif // HAVE_LIBPWMD // gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 3); widget = gtk_frame_new (NULL); gtk_frame_set_label_widget (GTK_FRAME (widget), hbox); gtk_container_add (GTK_CONTAINER (widget), (GtkWidget*) vbox); gtk_container_set_border_width (GTK_CONTAINER (vbox), 2); pform->self = widget; gtk_widget_show_all (pform->self); } static void ugtk_proxy_form_std_init (UgtkProxyForm* pform) { GtkGrid* grid; GtkWidget* widget; GtkWidget* hbox; pform->changed.host = FALSE; pform->changed.port = FALSE; pform->changed.user = FALSE; pform->changed.password = FALSE; pform->std = gtk_grid_new (); grid = (GtkGrid*) pform->std; // host label & entry widget = gtk_label_new_with_mnemonic (_("Host:")); pform->host = gtk_entry_new (); gtk_entry_set_width_chars (GTK_ENTRY (pform->host), 8); gtk_entry_set_activates_default (GTK_ENTRY (pform->host), TRUE); gtk_label_set_mnemonic_widget (GTK_LABEL (widget), pform->host); g_object_set (widget, "margin-left", 3, "margin-right", 3, NULL); g_object_set (widget, "margin-top", 1, "margin-bottom", 1, NULL); g_object_set (pform->host, "margin", 1, "hexpand", TRUE, NULL); gtk_grid_attach (grid, widget, 0, 0, 1, 1); gtk_grid_attach (grid, pform->host, 1, 0, 1, 1); // port label & entry widget = gtk_label_new_with_mnemonic (_("Port:")); pform->port = gtk_spin_button_new_with_range (0.0, 65535.0, 1.0); gtk_entry_set_activates_default (GTK_ENTRY (pform->port), TRUE); // gtk_entry_set_width_chars (GTK_ENTRY (pform->port), 5); gtk_label_set_mnemonic_widget (GTK_LABEL (widget), pform->port); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); gtk_box_pack_start (GTK_BOX (hbox), pform->port, FALSE, FALSE, 0); g_object_set (widget, "margin-left", 3, "margin-right", 3, NULL); g_object_set (widget, "margin-top", 1, "margin-bottom", 1, NULL); g_object_set (hbox, "margin", 1, NULL); gtk_grid_attach (grid, widget, 0, 1, 1, 1); gtk_grid_attach (grid, hbox, 1, 1, 1, 1); // center separator widget = gtk_separator_new (GTK_ORIENTATION_VERTICAL); g_object_set (widget, "margin", 1, NULL); gtk_grid_attach (grid, widget, 2, 0, 1, 2); // user label & entry widget = gtk_label_new_with_mnemonic (_("User:")); pform->user = gtk_entry_new (); gtk_entry_set_width_chars (GTK_ENTRY (pform->user), 7); gtk_entry_set_activates_default (GTK_ENTRY (pform->user), TRUE); gtk_label_set_mnemonic_widget (GTK_LABEL (widget), pform->user); g_object_set (widget, "margin-left", 3, "margin-right", 3, NULL); g_object_set (widget, "margin-top", 1, "margin-bottom", 1, NULL); g_object_set (pform->user, "margin", 1, "hexpand", TRUE, NULL); gtk_grid_attach (grid, widget, 3, 0, 1, 1); gtk_grid_attach (grid, pform->user, 4, 0, 1, 1); // password label & entry widget = gtk_label_new_with_mnemonic (_("Password:")); pform->password = gtk_entry_new (); gtk_entry_set_visibility (GTK_ENTRY (pform->password), FALSE); gtk_entry_set_width_chars (GTK_ENTRY (pform->password), 7); gtk_entry_set_activates_default (GTK_ENTRY (pform->password), TRUE); gtk_label_set_mnemonic_widget (GTK_LABEL (widget), pform->password); g_object_set (widget, "margin-left", 3, "margin-right", 3, NULL); g_object_set (widget, "margin-top", 1, "margin-bottom", 1, NULL); g_object_set (pform->password, "margin", 1, "hexpand", TRUE, NULL); gtk_grid_attach (grid, widget, 3, 1, 1, 1); gtk_grid_attach (grid, pform->password, 4, 1, 1, 1); g_signal_connect (GTK_EDITABLE (pform->user), "changed", G_CALLBACK (on_entry_std_changed), pform); g_signal_connect (GTK_EDITABLE (pform->password), "changed", G_CALLBACK (on_entry_std_changed), pform); g_signal_connect (GTK_EDITABLE (pform->host), "changed", G_CALLBACK (on_entry_std_changed), pform); g_signal_connect (GTK_EDITABLE (pform->port), "changed", G_CALLBACK (on_entry_std_changed), pform); gtk_widget_show_all (pform->std); } void ugtk_proxy_form_get (UgtkProxyForm* pform, UgetNode* node) { UgetProxy* proxy; gint index; const gchar* text; index = gtk_combo_box_get_active ((GtkComboBox*) pform->type); proxy = ug_info_realloc (&node->info, UgetProxyInfo); proxy->type = index; // user text = gtk_entry_get_text ((GtkEntry*)pform->user); ug_free (proxy->user); proxy->user = (*text) ? ug_strdup (text) : NULL; // password text = gtk_entry_get_text ((GtkEntry*)pform->password); ug_free (proxy->password); proxy->password = (*text) ? ug_strdup (text) : NULL; // host text = gtk_entry_get_text ((GtkEntry*)pform->host); ug_free (proxy->host); proxy->host = (*text) ? ug_strdup (text) : NULL; proxy->port = gtk_spin_button_get_value_as_int ((GtkSpinButton*) pform->port); #ifdef HAVE_LIBPWMD ug_free (proxy->pwmd.socket); text = gtk_entry_get_text ((GtkEntry*)pform->pwmd.socket); proxy->pwmd.socket = (*text) ? ug_strdup (text) : NULL; ug_free (proxy->pwmd.socket_args); text = gtk_entry_get_text ((GtkEntry*)pform->pwmd.socket_args); proxy->pwmd.socket_args = (*text) ? ug_strdup (text) : NULL; ug_free (proxy->pwmd.file); text = gtk_entry_get_text ((GtkEntry*)pform->pwmd.file); proxy->pwmd.file = (*text) ? ug_strdup (text) : NULL; ug_free (proxy->pwmd.element); text = gtk_entry_get_text ((GtkEntry*)pform->pwmd.element); proxy->pwmd.element = (*text) ? ug_strdup (text) : NULL; #endif // HAVE_LIBPWMD } void ugtk_proxy_form_set (UgtkProxyForm* pform, UgetNode* node, gboolean keep_changed) { UgetProxy* proxy; proxy = ug_info_get (&node->info, UgetProxyInfo); // if no proxy data if (proxy == NULL) { pform->changed.enable = FALSE; // disable changed flags if (keep_changed == FALSE || pform->changed.type == FALSE) gtk_spin_button_set_value ((GtkSpinButton*) pform->port, 80); if (keep_changed == FALSE || pform->changed.port == FALSE) gtk_combo_box_set_active ((GtkComboBox*) pform->type, UGET_PROXY_NONE); pform->changed.enable = TRUE; // enable changed flags return; } // disable changed flags pform->changed.enable = FALSE; // set changed flags if (keep_changed == FALSE) { pform->changed.type = proxy->keeping.type; pform->changed.host = proxy->keeping.host; pform->changed.port = proxy->keeping.port; pform->changed.user = proxy->keeping.user; pform->changed.password = proxy->keeping.password; } // Type if (keep_changed == FALSE || pform->changed.type == FALSE) gtk_combo_box_set_active ((GtkComboBox*) pform->type, proxy->type); // User if (keep_changed == FALSE || pform->changed.user == FALSE) { gtk_entry_set_text ((GtkEntry*) pform->user, (proxy->user) ? proxy->user : ""); } // Password if (keep_changed == FALSE || pform->changed.password == FALSE) { gtk_entry_set_text ((GtkEntry*) pform->password, (proxy->password) ? proxy->password : ""); } // Host if (keep_changed == FALSE || pform->changed.host == FALSE) { gtk_entry_set_text ((GtkEntry*) pform->host, (proxy->host) ? proxy->host : ""); } // Port if (keep_changed == FALSE || pform->changed.port == FALSE) gtk_spin_button_set_value ((GtkSpinButton*) pform->port, proxy->port); #ifdef HAVE_LIBPWMD if (keep_changed == FALSE) { pform->pwmd.changed.socket = proxy->pwmd.keeping.socket; pform->pwmd.changed.socket_args = proxy->pwmd.keeping.socket_args; pform->pwmd.changed.file = proxy->pwmd.keeping.file; pform->pwmd.changed.element = proxy->pwmd.keeping.element; } if (keep_changed == FALSE || pform->pwmd.changed.socket == FALSE) { gtk_entry_set_text ((GtkEntry*) pform->pwmd.socket, (proxy->pwmd.socket) ? proxy->pwmd.socket: ""); } if (keep_changed == FALSE || pform->pwmd.changed.socket_args == FALSE) { gtk_entry_set_text ((GtkEntry*) pform->pwmd.socket_args, (proxy->pwmd.socket_args) ? proxy->pwmd.socket_args: ""); } if (keep_changed == FALSE || pform->pwmd.changed.file == FALSE) { gtk_entry_set_text ((GtkEntry*) pform->pwmd.file, (proxy->pwmd.file) ? proxy->pwmd.file: ""); } if (keep_changed == FALSE || pform->pwmd.changed.element == FALSE) { gtk_entry_set_text ((GtkEntry*) pform->pwmd.element, (proxy->pwmd.element) ? proxy->pwmd.element: ""); } #endif // HAVE_LIBPWMD // enable changed flags pform->changed.enable = TRUE; } //------------------------------------------------------------------- // signal static void on_type_changed (GtkComboBox* widget, UgtkProxyForm* pform) { gint index; gboolean sensitive; if (pform->changed.enable) pform->changed.type = TRUE; index = gtk_combo_box_get_active (widget); if (index == UGET_PROXY_NONE) sensitive = FALSE; else sensitive = TRUE; gtk_widget_set_sensitive (pform->std, sensitive); #ifdef HAVE_LIBPWMD gtk_widget_set_sensitive (pform->pwmd.self, sensitive); if (index == UGET_PROXY_PWMD) { gtk_widget_set_visible (pform->std, FALSE); gtk_widget_set_visible (pform->pwmd.self, TRUE); } else { gtk_widget_set_visible (pform->pwmd.self, FALSE); gtk_widget_set_visible (pform->std, TRUE); } #endif // HAVE_LIBPWMD } static void on_entry_std_changed (GtkEditable* editable, UgtkProxyForm* pform) { if (pform->changed.enable) { if (editable == GTK_EDITABLE (pform->host)) pform->changed.host = TRUE; else if (editable == GTK_EDITABLE (pform->port)) pform->changed.port = TRUE; else if (editable == GTK_EDITABLE (pform->user)) pform->changed.user = TRUE; else if (editable == GTK_EDITABLE (pform->password)) pform->changed.password = TRUE; } } // ---------------------------------------------------------------------------- // PWMD // #ifdef HAVE_LIBPWMD static void ugtk_proxy_form_pwmd_init (struct UgtkProxyFormPwmd* pfp, UgtkProxyForm* pform) { GtkGrid* grid; GtkWidget* widget; pfp->self = gtk_grid_new (); grid = (GtkGrid*) pfp->self; widget = gtk_label_new_with_mnemonic (_("Socket:")); pfp->socket = gtk_entry_new (); gtk_entry_set_width_chars (GTK_ENTRY (pfp->socket), 16); gtk_label_set_mnemonic_widget (GTK_LABEL (widget), pfp->socket); g_object_set (widget, "margin-left", 3, "margin-right", 3, NULL); g_object_set (widget, "margin-top", 1, "margin-bottom", 1, NULL); g_object_set (pfp->socket, "margin", 1, "hexpand", TRUE, NULL); gtk_grid_attach (grid, widget, 0, 0, 1, 1); gtk_grid_attach (grid, pfp->socket, 1, 0, 4, 1); widget = gtk_label_new_with_mnemonic (_("Socket args:")); pfp->socket_args = gtk_entry_new (); gtk_entry_set_width_chars (GTK_ENTRY (pfp->socket_args), 16); gtk_label_set_mnemonic_widget (GTK_LABEL (widget), pfp->socket_args); g_object_set (widget, "margin-left", 3, "margin-right", 3, NULL); g_object_set (widget, "margin-top", 1, "margin-bottom", 1, NULL); g_object_set (pfp->socket_args, "margin", 1, "hexpand", TRUE, NULL); gtk_grid_attach (grid, widget, 0, 1, 1, 1); gtk_grid_attach (grid, pfp->socket_args, 1, 1, 4, 1); widget = gtk_label_new_with_mnemonic (_("Element:")); pfp->element = gtk_entry_new (); gtk_entry_set_width_chars (GTK_ENTRY (pfp->element), 16); gtk_label_set_mnemonic_widget (GTK_LABEL (widget), pfp->element); g_object_set (widget, "margin-left", 3, "margin-right", 3, NULL); g_object_set (widget, "margin-top", 1, "margin-bottom", 1, NULL); g_object_set (pfp->element, "margin", 1, "hexpand", TRUE, NULL); gtk_grid_attach (grid, widget, 3, 2, 1, 1); gtk_grid_attach (grid, pfp->element, 4, 2, 1, 1); widget = gtk_separator_new (GTK_ORIENTATION_VERTICAL); g_object_set (widget, "margin", 1, NULL); gtk_grid_attach (grid, widget, 2, 2, 1, 2); widget = gtk_label_new_with_mnemonic (_("File:")); pfp->file = gtk_entry_new (); gtk_entry_set_width_chars (GTK_ENTRY (pfp->file), 16); gtk_label_set_mnemonic_widget (GTK_LABEL (widget), pfp->file); g_object_set (widget, "margin-left", 3, "margin-right", 3, NULL); g_object_set (widget, "margin-top", 1, "margin-bottom", 1, NULL); g_object_set (pfp->file, "margin", 1, "hexpand", TRUE, NULL); gtk_grid_attach (grid, widget, 0, 2, 1, 1); gtk_grid_attach (grid, pfp->file, 1, 2, 1, 1); g_signal_connect (GTK_EDITABLE (pform->pwmd.socket), "changed", G_CALLBACK (on_entry_pwmd_changed), pform); g_signal_connect (GTK_EDITABLE (pform->pwmd.socket_args), "changed", G_CALLBACK (on_entry_pwmd_changed), pform); g_signal_connect (GTK_EDITABLE (pform->pwmd.file), "changed", G_CALLBACK (on_entry_pwmd_changed), pform); g_signal_connect (GTK_EDITABLE (pform->pwmd.element), "changed", G_CALLBACK (on_entry_pwmd_changed), pform); gtk_widget_show_all ((GtkWidget*) grid); gtk_widget_hide ((GtkWidget*) grid); } static void on_entry_pwmd_changed (GtkEditable* editable, UgtkProxyForm* pform) { if (pform->changed.enable) { if (editable == GTK_EDITABLE (pform->pwmd.socket)) pform->pwmd.changed.socket = TRUE; else if (editable == GTK_EDITABLE (pform->pwmd.socket_args)) pform->pwmd.changed.socket_args = TRUE; else if (editable == GTK_EDITABLE (pform->pwmd.file)) pform->pwmd.changed.file = TRUE; else if (editable == GTK_EDITABLE (pform->pwmd.element)) pform->pwmd.changed.element = TRUE; } } #endif // HAVE_LIBPWMD uget-2.2.0/ui-gtk/UgtkNodeTree.h0000644000175000000120000000640213224532612013301 00000000000000/* * * Copyright (C) 2012-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ /* * This file base on GTK+ 2.0 Tree View Tutorial - custom-list.h */ #ifndef UGTK_NODE_TREE_H #define UGTK_NODE_TREE_H #include #include #ifdef __cplusplus extern "C" { #endif #define UGTK_TYPE_NODE_TREE (ugtk_node_tree_get_type ()) #define UGTK_NODE_TREE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UGTK_TYPE_NODE_TREE, UgtkNodeTree)) #define UGTK_NODE_TREE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UGTK_TYPE_NODE_TREE, UgtkNodeTreeClass)) #define UGTK_IS_NODE_TREE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UGTK_TYPE_NODE_TREE)) #define UGTK_IS_NODE_TREE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UGTK_TYPE_NODE_TREE)) #define UGTK_NODE_TREE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UGTK_TYPE_NODE_TREE, UgtkNodeTreeClass)) typedef struct UgtkNodeTree UgtkNodeTree; typedef struct UgtkNodeTreeClass UgtkNodeTreeClass; // ---------------------------------------------------------------------------- // UgtkNodeTree : GtkTreeModel for UgNode (UgetNode) parent and children nodes. struct UgtkNodeTree { GObject parent; // this MUST be the first member UgetNode* root; gint stamp; // Random integer to check whether an iter belongs to our model gboolean list_only; struct { UgetNode* root; gint len; } prefix; }; // ------------------------------------ struct UgtkNodeTreeClass { GObjectClass parent_class; }; UgtkNodeTree* ugtk_node_tree_new (UgetNode* root, gboolean list_only); GType ugtk_node_tree_get_type (void); void ugtk_node_tree_set_prefix (UgtkNodeTree* utree, UgetNode* prefix_root, gint prefix_len); #ifdef __cplusplus } #endif #endif // UGTK_NODE_TREE_H uget-2.2.0/ui-gtk/UgtkBanner.h0000644000175000000120000000472113224532612013003 00000000000000/* * * Copyright (C) 2005-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #ifndef UGTK_BANNER_H #define UGTK_BANNER_H #include #include #include #ifdef __cplusplus extern "C" { #endif typedef struct UgtkBanner UgtkBanner; // -------------------------------- // Banner struct UgtkBanner { GtkWidget* self; GtkTextView* text_view; GtkTextBuffer* buffer; GtkTextTag* tag_link; int show_builtin; uint8_t hovering_over_link; char* link; struct { UgetRss* self; UgetRssFeed* feed; UgetRssItem* item; } rss; } banner; void ugtk_banner_init (UgtkBanner* banner); void ugtk_banner_show (UgtkBanner* banner, const char* title, const char* url); int ugtk_banner_show_rss (UgtkBanner* banner, UgetRss* urss); void ugtk_banner_show_donation (UgtkBanner* banner); void ugtk_banner_show_survey (UgtkBanner* banner); #ifdef __cplusplus } #endif #endif // UGTK_BANNER_H uget-2.2.0/ui-gtk/UgtkBatchDialog.c0000644000175000000120000002507513224532612013737 00000000000000/* * * Copyright (C) 2005-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #include #include #include // Callback static void ugtk_batch_dialog_set_completed (UgtkBatchDialog* bdialog, gboolean completed); static void on_response (GtkDialog *dialog, gint response_id, UgtkBatchDialog* bdialog); // ---------------------------------------------------------------------------- // UgtkBatchDialog UgtkBatchDialog* ugtk_batch_dialog_new (const char* title, UgtkApp* app) { UgtkBatchDialog* bdialog; bdialog = g_malloc0 (sizeof (UgtkBatchDialog)); ugtk_node_dialog_init ((UgtkNodeDialog*) bdialog, title, app, FALSE); ugtk_download_form_set_multiple (&bdialog->download, TRUE); #if GTK_MAJOR_VERSION <= 3 && GTK_MINOR_VERSION < 14 gtk_window_set_has_resize_grip ((GtkWindow*)bdialog->self, FALSE); #endif gtk_window_resize ((GtkWindow*)bdialog->self, 500, 350); // back button gtk_dialog_add_button (bdialog->self, GTK_STOCK_GO_BACK, GTK_RESPONSE_REJECT); // forward button gtk_dialog_add_button (bdialog->self, GTK_STOCK_GO_FORWARD, GTK_RESPONSE_ACCEPT); // OK & cancel buttons gtk_dialog_add_button (bdialog->self, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL); gtk_dialog_add_button (bdialog->self, GTK_STOCK_OK, GTK_RESPONSE_OK); gtk_dialog_set_default_response (bdialog->self, GTK_RESPONSE_OK); // set button sensitive gtk_dialog_set_response_sensitive (bdialog->self, GTK_RESPONSE_OK, FALSE); gtk_dialog_set_response_sensitive (bdialog->self, GTK_RESPONSE_ACCEPT, FALSE); // response handler g_signal_connect (bdialog->self, "response", G_CALLBACK (on_response), bdialog); return bdialog; } void ugtk_batch_dialog_free (UgtkBatchDialog* bdialog) { // selector if (bdialog->selector.self) ugtk_selector_finalize (&bdialog->selector); // dialog ugtk_node_dialog_free ((UgtkNodeDialog*) bdialog); } void ugtk_batch_dialog_use_selector (UgtkBatchDialog* bdialog) { GtkRequisition requisition; gtk_dialog_set_response_sensitive (bdialog->self, GTK_RESPONSE_REJECT, FALSE); // add Page 1 ugtk_selector_init (&bdialog->selector, (GtkWindow*) bdialog->self); gtk_widget_get_preferred_size (bdialog->notebook, &requisition, NULL); gtk_widget_set_size_request (bdialog->selector.self, requisition.width, requisition.height); gtk_box_pack_end (bdialog->hbox, bdialog->selector.self, TRUE, TRUE, 0); // hide Page 2 gtk_widget_hide (bdialog->notebook); // set focus gtk_window_set_focus (GTK_WINDOW (bdialog->self), GTK_WIDGET (bdialog->selector.notebook)); // set notify function & data bdialog->selector.notify.func = (void*) ugtk_batch_dialog_set_completed; bdialog->selector.notify.data = bdialog; } void ugtk_batch_dialog_use_sequencer (UgtkBatchDialog* bdialog) { GtkRequisition requisition; gtk_dialog_set_response_sensitive (bdialog->self, GTK_RESPONSE_REJECT, FALSE); // add Page 1 ugtk_sequence_init (&bdialog->sequencer); gtk_widget_get_preferred_size (bdialog->notebook, &requisition, NULL); gtk_widget_set_size_request (bdialog->sequencer.self, requisition.width, requisition.height); gtk_box_pack_end (bdialog->hbox, bdialog->sequencer.self, TRUE, TRUE, 0); // hide Page 2 gtk_widget_hide (bdialog->notebook); // set focus gtk_window_set_focus (GTK_WINDOW (bdialog->self), GTK_WIDGET (bdialog->sequencer.entry)); // set notify function & data bdialog->sequencer.notify.func = (void*) ugtk_batch_dialog_set_completed; bdialog->sequencer.notify.data = bdialog; } void ugtk_batch_dialog_disable_batch (UgtkBatchDialog* bdialog) { GtkWidget* widget; ugtk_download_form_set_multiple (&bdialog->download, FALSE); ugtk_node_dialog_monitor_uri ((UgtkNodeDialog*) bdialog); // forward to next page. gtk_dialog_response (bdialog->self, GTK_RESPONSE_ACCEPT); // disable forward and back button gtk_dialog_set_response_sensitive (bdialog->self, GTK_RESPONSE_REJECT, FALSE); gtk_dialog_set_response_sensitive (bdialog->self, GTK_RESPONSE_ACCEPT, FALSE); // hide forward and back button widget = gtk_dialog_get_widget_for_response (bdialog->self, GTK_RESPONSE_REJECT); gtk_widget_set_visible (widget, FALSE); widget = gtk_dialog_get_widget_for_response (bdialog->self, GTK_RESPONSE_ACCEPT); gtk_widget_set_visible (widget, FALSE); } void ugtk_batch_dialog_run (UgtkBatchDialog* bdialog) { ugtk_node_dialog_apply_recent ((UgtkNodeDialog*) bdialog, bdialog->app); // emit notify and call ugtk_batch_dialog_set_completed() if (bdialog->selector.self) ugtk_selector_count_marked (&bdialog->selector); // gtk_dialog_run (ndialog->self); gtk_widget_show ((GtkWidget*) bdialog->self); } // ---------------------------------------------------------------------------- // Callback static void ugtk_batch_dialog_set_completed (UgtkBatchDialog* bdialog, gboolean completed) { gtk_dialog_set_response_sensitive (bdialog->self, GTK_RESPONSE_OK, completed); gtk_dialog_set_response_sensitive (bdialog->self, GTK_RESPONSE_ACCEPT, completed); } static void on_no_batch_response (UgtkBatchDialog* bdialog) { UgtkApp* app; UgetNode* dnode; UgetNode* cnode; const char* uri; app = bdialog->app; ugtk_batch_dialog_get_category (bdialog, &cnode); ugtk_download_form_get_folders (&bdialog->download, &app->setting); uri = gtk_entry_get_text ((GtkEntry*)bdialog->download.uri_entry); if (ugtk_node_dialog_confirm_existing((UgtkNodeDialog*) bdialog, uri)) { dnode = uget_node_new (NULL); ugtk_node_dialog_get ((UgtkNodeDialog*) bdialog, dnode); uget_app_add_download ((UgetApp*) app, dnode, cnode, FALSE); } } static void on_sequencer_response (UgtkBatchDialog* bdialog) { UgtkApp* app; UgetNode* dnode; UgetNode* cnode; UgetCommon* common; UgList result; UgLink* link; app = bdialog->app; ugtk_batch_dialog_get_category (bdialog, &cnode); ugtk_download_form_get_folders (&bdialog->download, &app->setting); // sequencer batch ug_list_init (&result); ugtk_sequence_get_list (&bdialog->sequencer, &result); for (link = result.head; link; link = link->next) { dnode = uget_node_new (NULL); common = ug_info_realloc (&dnode->info, UgetCommonInfo); ugtk_node_dialog_get ((UgtkNodeDialog*) bdialog, dnode); common->uri = ug_strdup (link->data); uget_app_add_download ((UgetApp*) app, dnode, cnode, FALSE); } ug_list_foreach_link (&result, (UgForeachFunc)ug_free, NULL); ug_list_clear (&result, FALSE); } static void on_selector_response (UgtkBatchDialog* bdialog) { UgtkApp* app; UgetNode* dnode; UgetNode* cnode; UgetCommon* common; GList* uri_list; GList* link; app = bdialog->app; ugtk_batch_dialog_get_category (bdialog, &cnode); ugtk_download_form_get_folders (&bdialog->download, &app->setting); // selector batch uri_list = ugtk_selector_get_marked_uris (&bdialog->selector); for (link = uri_list; link; link = link->next) { dnode = uget_node_new (NULL); common = ug_info_realloc (&dnode->info, UgetCommonInfo); ugtk_node_dialog_get ((UgtkNodeDialog*) bdialog, dnode); #if 0 common->uri = link->data; link->data = NULL; #else common->uri = ug_strdup (link->data); g_free (link->data); #endif uget_app_add_download ((UgetApp*) app, dnode, cnode, FALSE); } g_list_free (uri_list); } static void on_response (GtkDialog *dialog, gint response_id, UgtkBatchDialog* bdialog) { switch (response_id) { case GTK_RESPONSE_REJECT: // back button gtk_dialog_set_response_sensitive (bdialog->self, GTK_RESPONSE_REJECT, FALSE); gtk_dialog_set_response_sensitive (bdialog->self, GTK_RESPONSE_ACCEPT, TRUE); // switch page gtk_widget_hide (bdialog->notebook); if (bdialog->selector.self) gtk_widget_show (bdialog->selector.self); else if (bdialog->sequencer.self) gtk_widget_show (bdialog->sequencer.self); break; case GTK_RESPONSE_ACCEPT: // forward button gtk_dialog_set_response_sensitive (bdialog->self, GTK_RESPONSE_REJECT, TRUE); gtk_dialog_set_response_sensitive (bdialog->self, GTK_RESPONSE_ACCEPT, FALSE); // switch page gtk_widget_show (bdialog->notebook); if (bdialog->selector.self) gtk_widget_hide (bdialog->selector.self); else if (bdialog->sequencer.self) gtk_widget_hide (bdialog->sequencer.self); break; case GTK_RESPONSE_CANCEL: default: ugtk_batch_dialog_free (bdialog); break; case GTK_RESPONSE_OK: ugtk_node_dialog_store_recent ((UgtkNodeDialog*) bdialog, bdialog->app); if (gtk_widget_get_sensitive (bdialog->download.uri_entry)) on_no_batch_response (bdialog); if (bdialog->sequencer.self) on_sequencer_response (bdialog); else if (bdialog->selector.self) on_selector_response (bdialog); ugtk_batch_dialog_free (bdialog); break; } } uget-2.2.0/ui-gtk/UgtkSummary.h0000644000175000000120000000525213224532612013233 00000000000000/* * * Copyright (C) 2005-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #ifndef UGTK_SUMMARY_H #define UGTK_SUMMARY_H #include #include #ifdef __cplusplus extern "C" { #endif typedef struct UgtkSummary UgtkSummary; enum UGTK_SUMMARY_COLUMN { UGTK_SUMMARY_COLUMN_ICON, UGTK_SUMMARY_COLUMN_NAME, UGTK_SUMMARY_COLUMN_VALUE, UGTK_SUMMARY_N_COLUMN }; struct UgtkSummary { GtkWidget* self; // (GtkScrolledWindow) container for view GtkTreeView* view; GtkListStore* store; struct { GtkMenu* self; // (GtkMenu) pop-up menu GtkWidget* copy; // GtkMenuItem GtkWidget* copy_all; // GtkMenuItem } menu; struct { gboolean name:1; gboolean folder:1; gboolean category:1; gboolean uri:1; gboolean message:1; } visible; }; void ugtk_summary_init (UgtkSummary* summary, GtkAccelGroup* accel_group); void ugtk_summary_show (UgtkSummary* summary, UgetNode* node); // call g_free() to free returned string. gchar* ugtk_summary_get_text_selected (UgtkSummary* summary); gchar* ugtk_summary_get_text_all (UgtkSummary* summary); #ifdef __cplusplus } #endif #endif // End of UGTK_SUMMARY_H uget-2.2.0/ui-gtk/UgtkConfirmDialog.c0000644000175000000120000001603013224532612014302 00000000000000/* * * Copyright (C) 2005-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #include #include // response static void on_confirm_to_exit_response (GtkWidget* dialog, gint response, UgtkConfirmDialog* cdialog); static void on_confirm_to_delete_response (GtkWidget* dialog, gint response, UgtkConfirmDialog* cdialog); static void on_confirm_to_delete_category_response (GtkWidget* dialog, gint response, UgtkConfirmDialog* cdialog); UgtkConfirmDialog* ugtk_confirm_dialog_new (UgtkConfirmDialogMode mode, UgtkApp* app) { UgtkConfirmDialog* cdialog; GtkWidget* button; GtkBox* hbox; GtkBox* vbox; gchar* temp; const char* title; const char* label; cdialog = g_malloc (sizeof (UgtkConfirmDialog)); cdialog->app = app; // create confirmation dialog switch (mode) { case UGTK_CONFIRM_DIALOG_EXIT: title = _("Really Quit?"); label = _("Are you sure you want to quit?"); break; case UGTK_CONFIRM_DIALOG_DELETE: title = _("Really delete files?"); label = _("Are you sure you want to delete files?"); break; case UGTK_CONFIRM_DIALOG_DELETE_CATEGORY: title = _("Really delete category?"); label = _("Are you sure you want to delete category?"); break; default: title = NULL; label = NULL; break; } temp = g_strconcat (UGTK_APP_NAME " - ", title, NULL); cdialog->self = (GtkDialog*) gtk_dialog_new_with_buttons (temp, app->window.self, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_NO, GTK_RESPONSE_NO, GTK_STOCK_YES, GTK_RESPONSE_YES, NULL); g_free (temp); #if GTK_MAJOR_VERSION <= 3 && GTK_MINOR_VERSION < 14 gtk_window_set_has_resize_grip ((GtkWindow*) cdialog->self, FALSE); #endif gtk_container_set_border_width (GTK_CONTAINER (cdialog->self), 4); vbox = (GtkBox*) gtk_dialog_get_content_area (cdialog->self); // image and label hbox = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); gtk_box_pack_start (hbox, gtk_image_new_from_stock (GTK_STOCK_DIALOG_QUESTION, GTK_ICON_SIZE_DIALOG), FALSE, FALSE, 8); gtk_box_pack_start (hbox, gtk_label_new (label), FALSE, FALSE, 4); gtk_box_pack_start (vbox, (GtkWidget*) hbox, FALSE, FALSE, 6); // check button hbox = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); button = gtk_check_button_new_with_label (_("Don't ask me again")); gtk_box_pack_end (hbox, button, TRUE, TRUE, 20); gtk_box_pack_end (vbox, (GtkWidget*) hbox, FALSE, FALSE, 10); cdialog->confirmation = (GtkToggleButton*) button; // gtk_widget_show_all ((GtkWidget*) vbox); switch (mode) { case UGTK_CONFIRM_DIALOG_EXIT: app->dialogs.exit_confirmation = (GtkWidget*) cdialog->self; g_signal_connect (cdialog->self, "response", G_CALLBACK (on_confirm_to_exit_response), cdialog); break; case UGTK_CONFIRM_DIALOG_DELETE: app->dialogs.delete_confirmation = (GtkWidget*) cdialog->self; g_signal_connect (cdialog->self, "response", G_CALLBACK (on_confirm_to_delete_response), cdialog); break; case UGTK_CONFIRM_DIALOG_DELETE_CATEGORY: app->dialogs.delete_category_confirmation = (GtkWidget*) cdialog->self; gtk_widget_hide ((GtkWidget*) cdialog->confirmation); g_signal_connect (cdialog->self, "response", G_CALLBACK (on_confirm_to_delete_category_response), cdialog); break; default: g_signal_connect (cdialog->self, "response", G_CALLBACK (gtk_widget_destroy), NULL); break; } return cdialog; } void ugtk_confirm_dialog_free (UgtkConfirmDialog* cdialog) { gtk_widget_destroy ((GtkWidget*) cdialog->self); g_free (cdialog); } void ugtk_confirm_dialog_run (UgtkConfirmDialog* cdialog) { UgtkApp* app; app = cdialog->app; gtk_widget_set_sensitive ((GtkWidget*) app->window.self, FALSE); gtk_widget_show ((GtkWidget*) cdialog->self); } static void on_confirm_to_exit_response (GtkWidget* dialog, gint response, UgtkConfirmDialog* cdialog) { UgtkApp* app; app = cdialog->app; app->dialogs.exit_confirmation = NULL; if (response == GTK_RESPONSE_YES) { if (gtk_toggle_button_get_active (cdialog->confirmation) == FALSE) app->setting.ui.exit_confirmation = TRUE; else app->setting.ui.exit_confirmation = FALSE; ugtk_app_quit (app); } gtk_widget_set_sensitive ((GtkWidget*) app->window.self, TRUE); ugtk_confirm_dialog_free (cdialog); } static void on_confirm_to_delete_response (GtkWidget* dialog, gint response, UgtkConfirmDialog* cdialog) { UgtkApp* app; app = cdialog->app; app->dialogs.delete_confirmation = NULL; if (response == GTK_RESPONSE_YES) { if (gtk_toggle_button_get_active (cdialog->confirmation) == FALSE) app->setting.ui.delete_confirmation = TRUE; else app->setting.ui.delete_confirmation = FALSE; ugtk_app_delete_download (app, TRUE); } gtk_widget_set_sensitive ((GtkWidget*) app->window.self, TRUE); ugtk_confirm_dialog_free (cdialog); } static void on_confirm_to_delete_category_response (GtkWidget* dialog, gint response, UgtkConfirmDialog* cdialog) { UgtkApp* app; app = cdialog->app; app->dialogs.delete_category_confirmation = NULL; if (response == GTK_RESPONSE_YES) { // if (gtk_toggle_button_get_active (cdialog->confirmation) == FALSE) // app->setting.ui.delete_category_confirmation = TRUE; // else // app->setting.ui.delete_category_confirmation = FALSE; ugtk_app_delete_category (app); } gtk_widget_set_sensitive ((GtkWidget*) app->window.self, TRUE); ugtk_confirm_dialog_free (cdialog); } uget-2.2.0/ui-gtk/UgtkScheduleForm.h0000644000175000000120000000450613224532612014157 00000000000000/* * * Copyright (C) 2005-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #ifndef UGTK_SCHEDULE_FORM_H #define UGTK_SCHEDULE_FORM_H #include #include #ifdef __cplusplus extern "C" { #endif struct UgtkScheduleForm { GtkWidget* self; GtkWidget* enable; GtkWidget* drawing; guint drawing_offset; GtkWidget* caption; GtkLabel* time_tips; GtkSpinButton* spin_speed; int state[7][24]; // 1 week, 7 days, 24 hours UgtkScheduleState last_state; }; void ugtk_schedule_form_init (struct UgtkScheduleForm* sform); void ugtk_schedule_form_get (struct UgtkScheduleForm* sform, UgtkSetting* setting); void ugtk_schedule_form_set (struct UgtkScheduleForm* sform, UgtkSetting* setting); #ifdef __cplusplus } #endif #endif // End of UG_SCHEDULE_FORM_H uget-2.2.0/ui-gtk/UgtkTrayIcon.h0000644000175000000120000000635013224532612013326 00000000000000/* * * Copyright (C) 2005-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #ifndef UGTK_TRAY_ICON_H #define UGTK_TRAY_ICON_H #include #include #ifdef HAVE_APP_INDICATOR #include #endif #ifdef __cplusplus extern "C" { #endif typedef struct UgtkTrayIcon UgtkTrayIcon; typedef struct UgtkApp UgtkApp; // -------------------------------- // Tray Icon enum UgtkTrayIconState { UGTK_TRAY_ICON_STATE_NORMAL, UGTK_TRAY_ICON_STATE_RUNNING, UGTK_TRAY_ICON_STATE_ERROR, }; struct UgtkTrayIcon { #ifdef HAVE_APP_INDICATOR AppIndicator* indicator; AppIndicator* indicator_temp; #endif GtkStatusIcon* self; gboolean visible; gboolean error_occurred; guint state; // UgtkTrayIconState struct UgtkTrayIconMenu { GtkWidget* self; // (GtkMenu) pop-up menu GtkWidget* create_download; GtkWidget* create_clipboard; GtkWidget* create_torrent; GtkWidget* create_metalink; gboolean emission; GtkWidget* clipboard_monitor; GtkWidget* clipboard_quiet; GtkWidget* commandline_quiet; GtkWidget* skip_existing; GtkWidget* apply_recent; GtkWidget* settings; GtkWidget* about; GtkWidget* show_window; GtkWidget* offline_mode; GtkWidget* quit; } menu; }; void ugtk_tray_icon_init (UgtkTrayIcon* trayicon); void ugtk_tray_icon_set_info (UgtkTrayIcon* trayicon, guint n_active, gint64 down_speed, gint64 up_speed); void ugtk_tray_icon_set_visible (UgtkTrayIcon* trayicon, gboolean visible); #ifdef HAVE_APP_INDICATOR void ugtk_tray_icon_use_indicator (UgtkTrayIcon* trayicon, gboolean enable); #endif void ugtk_trayicon_init_callback (UgtkTrayIcon* trayicon, UgtkApp* app); #ifdef __cplusplus } #endif #endif // UGTK_TRAY_H uget-2.2.0/ui-gtk/UgtkSequence.c0000644000175000000120000003766313224532612013354 00000000000000/* * * Copyright (C) 2005-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #include #include #include // ---------------------------------------------------------------------------- // UgtkSeqRange static void on_type_changed (GtkComboBox* widget, UgtkSeqRange* range); static void on_show (GtkWidget *widget, UgtkSeqRange* range); void ugtk_seq_range_init (UgtkSeqRange* range, UgtkSequence* seq, GtkSizeGroup* size_group) { GtkBox* box; GtkAdjustment* adjustment; range->self = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 3); box = (GtkBox*) range->self; g_signal_connect (range->self, "show", G_CALLBACK (on_show), range); // Type range->type = gtk_combo_box_text_new (); gtk_combo_box_text_insert_text (GTK_COMBO_BOX_TEXT (range->type), UGTK_SEQ_TYPE_NONE, _("None")); gtk_combo_box_text_insert_text (GTK_COMBO_BOX_TEXT (range->type), UGTK_SEQ_TYPE_NUMBER, _("Num")); gtk_combo_box_text_insert_text (GTK_COMBO_BOX_TEXT (range->type), UGTK_SEQ_TYPE_CHARACTER, _("Char")); gtk_box_pack_start (box, range->type, FALSE, FALSE, 2); g_signal_connect (range->type, "changed", G_CALLBACK (on_type_changed), range); g_signal_connect_swapped (range->type, "changed", G_CALLBACK (ugtk_sequence_show_preview), seq); // SpinButton - From adjustment = (GtkAdjustment *) gtk_adjustment_new (0.0, 0.0, 99999.0, 1.0, 5.0, 0.0); range->spin_from = gtk_spin_button_new (adjustment, 1.0, 0); gtk_size_group_add_widget (size_group, range->spin_from); gtk_box_pack_start (box, range->spin_from, FALSE, FALSE, 2); g_signal_connect_swapped (range->spin_from, "value-changed", G_CALLBACK (ugtk_sequence_show_preview), seq); // Entry - From range->entry_from = gtk_entry_new (); gtk_entry_set_text (GTK_ENTRY (range->entry_from), "a"); gtk_entry_set_max_length (GTK_ENTRY (range->entry_from), 1); // gtk_entry_set_width_chars (GTK_ENTRY (range->entry_from), 2); gtk_size_group_add_widget (size_group, range->entry_from); gtk_box_pack_start (box, range->entry_from, FALSE, FALSE, 2); g_signal_connect_swapped (GTK_EDITABLE (range->entry_from), "changed", G_CALLBACK (ugtk_sequence_show_preview), seq); // Label - To range->label_to = gtk_label_new (_("To:")); // range->label_to = gtk_label_new_with_mnemonic (_("To:")); gtk_box_pack_start (box, range->label_to, FALSE, FALSE, 2); // gtk_label_set_mnemonic_widget (GTK_LABEL (widget), range->spin_to); // SpinButton - To adjustment = (GtkAdjustment *) gtk_adjustment_new (10.0, 1.0, 99999.0, 1.0, 5.0, 0.0); range->spin_to = gtk_spin_button_new (adjustment, 1.0, 0); gtk_box_pack_start (box, range->spin_to, FALSE, FALSE, 2); gtk_size_group_add_widget (size_group, range->spin_to); g_signal_connect_swapped (range->spin_to, "value-changed", G_CALLBACK (ugtk_sequence_show_preview), seq); // label - digits range->label_digits = gtk_label_new (_("digits:")); // range->label_digits = gtk_label_new_with_mnemonic (_("digits:")); gtk_box_pack_start (box, range->label_digits, FALSE, FALSE, 2); // gtk_label_set_mnemonic_widget (GTK_LABEL (range->label_digits), range->spin_digits); // SpinButton - digits adjustment = (GtkAdjustment *) gtk_adjustment_new (2.0, 1.0, 20.0, 1.0, 5.0, 0.0); range->spin_digits = gtk_spin_button_new (adjustment, 1.0, 0); gtk_box_pack_start (box, range->spin_digits, FALSE, FALSE, 2); g_signal_connect_swapped (range->spin_digits, "value-changed", G_CALLBACK (ugtk_sequence_show_preview), seq); // Entry - To range->entry_to = gtk_entry_new (); gtk_entry_set_text (GTK_ENTRY (range->entry_to), "z"); gtk_entry_set_max_length (GTK_ENTRY (range->entry_to), 1); // gtk_entry_set_width_chars (GTK_ENTRY (range->entry_to), 2); gtk_size_group_add_widget (size_group, range->entry_to); gtk_box_pack_start (box, range->entry_to, FALSE, FALSE, 2); g_signal_connect_swapped (GTK_EDITABLE (range->entry_to), "changed", G_CALLBACK(ugtk_sequence_show_preview), seq); // label - case-sensitive range->label_case = gtk_label_new (_("case-sensitive")); gtk_box_pack_start (box, range->label_case, FALSE, FALSE, 2); // gtk_widget_show_all (range->self); } void ugtk_seq_range_set_type (UgtkSeqRange* range, enum UgtkSeqType type) { gtk_combo_box_set_active ((GtkComboBox*) range->type, type); } enum UgtkSeqType ugtk_seq_range_get_type (UgtkSeqRange* range) { return gtk_combo_box_get_active ((GtkComboBox*) range->type); } // signal handler static void on_show (GtkWidget *widget, UgtkSeqRange* range) { ugtk_seq_range_set_type (range, UGTK_SEQ_TYPE_NONE); } // signal handler static void on_type_changed (GtkComboBox* widget, UgtkSeqRange* range) { gint type; type = gtk_combo_box_get_active (widget); switch (type) { case UGTK_SEQ_TYPE_NONE: gtk_widget_set_sensitive (range->label_to, FALSE); gtk_widget_set_sensitive (range->spin_from, FALSE); gtk_widget_set_sensitive (range->spin_to, FALSE); gtk_widget_set_sensitive (range->spin_digits, FALSE); gtk_widget_set_sensitive (range->label_digits, FALSE); gtk_widget_set_sensitive (range->entry_from, FALSE); gtk_widget_set_sensitive (range->entry_to, FALSE); gtk_widget_set_sensitive (range->label_case, FALSE); if (gtk_widget_get_visible (range->spin_from) == TRUE) { gtk_widget_set_visible (range->entry_from, FALSE); gtk_widget_set_visible (range->entry_to, FALSE); gtk_widget_set_visible (range->label_case, FALSE); } break; case UGTK_SEQ_TYPE_NUMBER: gtk_widget_set_sensitive (range->spin_from, TRUE); gtk_widget_set_sensitive (range->label_to, TRUE); gtk_widget_set_sensitive (range->spin_to, TRUE); gtk_widget_set_sensitive (range->spin_digits, TRUE); gtk_widget_set_sensitive (range->label_digits, TRUE); gtk_widget_set_visible (range->spin_from, TRUE); gtk_widget_set_visible (range->spin_to, TRUE); gtk_widget_set_visible (range->spin_digits, TRUE); gtk_widget_set_visible (range->label_digits, TRUE); gtk_widget_set_visible (range->entry_from, FALSE); gtk_widget_set_visible (range->entry_to, FALSE); gtk_widget_set_visible (range->label_case, FALSE); break; case UGTK_SEQ_TYPE_CHARACTER: gtk_widget_set_sensitive (range->entry_from, TRUE); gtk_widget_set_sensitive (range->label_to, TRUE); gtk_widget_set_sensitive (range->entry_to, TRUE); gtk_widget_set_sensitive (range->label_case, TRUE); gtk_widget_set_visible (range->spin_from, FALSE); gtk_widget_set_visible (range->spin_to, FALSE); gtk_widget_set_visible (range->spin_digits, FALSE); gtk_widget_set_visible (range->label_digits, FALSE); gtk_widget_set_visible (range->entry_from, TRUE); gtk_widget_set_visible (range->entry_to, TRUE); gtk_widget_set_visible (range->label_case, TRUE); break; } } // --------------------------------------------------------------------------- // UgtkSequence // static functions static void ugtk_sequence_add_range (UgtkSequence* seq, UgtkSeqRange* range); static void ugtk_sequence_preview_init (struct UgtkSequencePreview* preview); static void ugtk_sequence_preview_show (struct UgtkSequencePreview* preview, const gchar* message); // signal handlers static void on_realize (GtkWidget *widget, UgtkSequence* seq); static void on_destroy (GtkWidget *widget, UgtkSequence* seq); void ugtk_sequence_init (UgtkSequence* seq) { GtkGrid* grid; GtkWidget* label; GtkWidget* entry; GtkWidget* widget; GtkSizeGroup* size_group; // UgetSequence: call uget_sequence_final() in on_destroy() uget_sequence_init (&seq->sequence); // top widget seq->self = gtk_grid_new (); grid = (GtkGrid*) seq->self; gtk_grid_set_row_homogeneous (grid, FALSE); g_signal_connect (seq->self, "realize", G_CALLBACK (on_realize), seq); g_signal_connect (seq->self, "destroy", G_CALLBACK (on_destroy), seq); // URI entry entry = gtk_entry_new (); label = gtk_label_new_with_mnemonic (_("_URI:")); seq->entry = GTK_ENTRY (entry); gtk_label_set_mnemonic_widget(GTK_LABEL (label), entry); gtk_entry_set_activates_default (seq->entry, TRUE); g_object_set (label, "margin", 3, NULL); g_object_set (entry, "margin", 3, "hexpand", TRUE, NULL); gtk_grid_attach (grid, label, 0, 0, 1, 1); gtk_grid_attach (grid, entry, 1, 0, 1, 1); g_signal_connect_swapped (GTK_EDITABLE (entry), "changed", G_CALLBACK (ugtk_sequence_show_preview), seq); // e.g. label = gtk_label_new (_("e.g.")); g_object_set (label, "margin", 3, NULL); gtk_grid_attach (grid, label, 0, 1, 1, 1); label = gtk_label_new ("http://for.example/path/pre*.jpg"); g_object_set (label, "margin", 3, NULL); gtk_grid_attach (grid, label, 1, 1, 1, 1); // separator widget = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL); gtk_grid_attach (grid, widget, 0, 2, 2, 1); // ------------------------------------------------ // UgtkSeqRange size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); ugtk_seq_range_init (&seq->range[0], seq, size_group); ugtk_seq_range_init (&seq->range[1], seq, size_group); ugtk_seq_range_init (&seq->range[2], seq, size_group); g_object_set (seq->range[0].self, "margin", 3, NULL); g_object_set (seq->range[1].self, "margin", 3, NULL); g_object_set (seq->range[2].self, "margin", 3, NULL); gtk_grid_attach (grid, seq->range[0].self, 0, 3, 2, 1); gtk_grid_attach (grid, seq->range[1].self, 0, 4, 2, 1); gtk_grid_attach (grid, seq->range[2].self, 0, 5, 2, 1); g_object_unref (size_group); // ------------------------------------------------ // preview ugtk_sequence_preview_init (&seq->preview); g_object_set (seq->preview.self, "margin", 3, "expand", TRUE, NULL); gtk_grid_attach (grid, seq->preview.self, 0, 6, 2, 1); ugtk_sequence_show_preview (seq); gtk_widget_show_all (seq->self); } void ugtk_sequence_show_preview (UgtkSequence* seq) { GtkTreeIter iter; UgList result; UgLink* link; const char* string; uget_sequence_clear (&seq->sequence); ugtk_sequence_add_range (seq, &seq->range[0]); ugtk_sequence_add_range (seq, &seq->range[1]); ugtk_sequence_add_range (seq, &seq->range[2]); string = gtk_entry_get_text (seq->entry); if (ug_uri_init (NULL, string) == 0) { ugtk_sequence_preview_show (&seq->preview, _("URI is not valid.")); // notify if (seq->notify.func) seq->notify.func (seq->notify.data, FALSE); return; } if (strpbrk (string, "*") == NULL) { ugtk_sequence_preview_show (&seq->preview, _("No wildcard(*) character in URI entry.")); // notify if (seq->notify.func) seq->notify.func (seq->notify.data, FALSE); return; } if (uget_sequence_count (&seq->sequence, string) == 0) { ugtk_sequence_preview_show (&seq->preview, _("No character in 'From' or 'To' entry.")); // notify if (seq->notify.func) seq->notify.func (seq->notify.data, FALSE); return; } ug_list_init (&result); uget_sequence_get_preview (&seq->sequence, string, &result); gtk_list_store_clear (seq->preview.store); for (link = result.head; link; link = link->next) { gtk_list_store_append (seq->preview.store, &iter); gtk_list_store_set (seq->preview.store, &iter, 0, link->data, -1); } ug_list_foreach_link (&result, (UgForeachFunc)ug_free, NULL); ug_list_clear (&result, FALSE); // notify if (seq->notify.func) seq->notify.func (seq->notify.data, TRUE); return; } int ugtk_sequence_get_list (UgtkSequence* seq, UgList* result) { const char* string; string = gtk_entry_get_text (seq->entry); return uget_sequence_get_list (&seq->sequence, string, result); } // ---------------------------------------------------------------------------- // static functions // static void ugtk_sequence_add_range (UgtkSequence* seq, UgtkSeqRange* range) { uint32_t first, last; int type, digits; type = ugtk_seq_range_get_type (range); switch (type) { case UGTK_SEQ_TYPE_NUMBER: first = gtk_spin_button_get_value_as_int ((GtkSpinButton*) range->spin_from); last = gtk_spin_button_get_value_as_int ((GtkSpinButton*) range->spin_to); digits = gtk_spin_button_get_value_as_int ((GtkSpinButton*) range->spin_digits); break; case UGTK_SEQ_TYPE_CHARACTER: first = *gtk_entry_get_text (GTK_ENTRY (range->entry_from)); last = *gtk_entry_get_text (GTK_ENTRY (range->entry_to)); digits = 0; break; default: return; } uget_sequence_add (&seq->sequence, first, last, digits); } static void ugtk_sequence_preview_init (struct UgtkSequencePreview* preview) { GtkScrolledWindow* scrolled; GtkCellRenderer* renderer; GtkTreeViewColumn* column; GtkTreeSelection* selection; PangoContext* context; PangoLayout* layout; int height; preview->view = (GtkTreeView*) gtk_tree_view_new (); preview->store = gtk_list_store_new (1, G_TYPE_STRING); gtk_tree_view_set_model (preview->view, (GtkTreeModel*) preview->store); // gtk_tree_view_set_fixed_height_mode (preview->view, TRUE); gtk_widget_set_size_request ((GtkWidget*) preview->view, 140, 140); selection = gtk_tree_view_get_selection (preview->view); gtk_tree_selection_set_mode (selection, GTK_SELECTION_NONE); // It will free UgtkSequence.preview_store when UgtkSequence.preview_view destroy. g_object_unref (preview->store); renderer = gtk_cell_renderer_text_new (); column = gtk_tree_view_column_new_with_attributes ( _("Preview"), renderer, "text", 0, NULL); // gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_FIXED); gtk_tree_view_append_column (preview->view, column); // calc text height context = gtk_widget_get_pango_context ((GtkWidget*)preview->view); layout = pango_layout_new (context); pango_layout_set_text (layout, "Xy", -1); pango_layout_get_pixel_size (layout, NULL, &height); g_object_unref (layout); height *= 10; if (height < 140) height = 140; preview->self = gtk_scrolled_window_new (NULL, NULL); gtk_widget_set_size_request (preview->self, 140, height); scrolled = GTK_SCROLLED_WINDOW (preview->self); gtk_scrolled_window_set_shadow_type (scrolled, GTK_SHADOW_IN); gtk_scrolled_window_set_policy (scrolled, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_container_add (GTK_CONTAINER (scrolled), GTK_WIDGET (preview->view)); } static void ugtk_sequence_preview_show (struct UgtkSequencePreview* preview, const gchar* message) { GtkTreeIter iter; gtk_list_store_clear (preview->store); // skip first row gtk_list_store_append (preview->store, &iter); // show message in second row gtk_list_store_append (preview->store, &iter); gtk_list_store_set (preview->store, &iter, 0, message, -1); } // ---------------------------------------------------------------------------- // signal handler static void on_realize (GtkWidget *widget, UgtkSequence* seq) { ugtk_seq_range_set_type (&seq->range[0], UGTK_SEQ_TYPE_NUMBER); } static void on_destroy (GtkWidget *widget, UgtkSequence* seq) { uget_sequence_final (&seq->sequence); } uget-2.2.0/ui-gtk/UgtkSettingForm.h0000644000175000000120000001513713224532612014042 00000000000000/* * * Copyright (C) 2005-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #ifndef UGTK_SETTING_FORM_H #define UGTK_SETTING_FORM_H #include #include #ifdef __cplusplus extern "C" { #endif // ---------------------------------------------------------------------------- // UgtkClipboardForm struct UgtkClipboardForm { GtkWidget* self; GtkWidget* pattern; // GtkTextView GtkTextBuffer* buffer; GtkToggleButton* monitor; GtkToggleButton* quiet; // add download to Nth category GtkWidget* nth_label; GtkSpinButton* nth_spin; // Monitor media website address GtkToggleButton* website; }; void ugtk_clipboard_form_init (struct UgtkClipboardForm* cbform); void ugtk_clipboard_form_set (struct UgtkClipboardForm* cbform, UgtkSetting* setting); void ugtk_clipboard_form_get (struct UgtkClipboardForm* cbform, UgtkSetting* setting); // ---------------------------------------------------------------------------- // UgtkUserInterfaceForm struct UgtkUserInterfaceForm { GtkWidget* self; GtkToggleButton* confirm_exit; GtkToggleButton* confirm_delete; GtkToggleButton* show_trayicon; GtkToggleButton* start_in_tray; GtkToggleButton* close_to_tray; GtkToggleButton* start_in_offline_mode; GtkToggleButton* start_notification; GtkToggleButton* sound_notification; GtkToggleButton* apply_recent; GtkToggleButton* skip_existing; GtkToggleButton* large_icon; #ifdef HAVE_APP_INDICATOR GtkToggleButton* app_indicator; #endif }; void ugtk_user_interface_form_init (struct UgtkUserInterfaceForm* uiform); void ugtk_user_interface_form_set (struct UgtkUserInterfaceForm* uiform, UgtkSetting* setting); void ugtk_user_interface_form_get (struct UgtkUserInterfaceForm* uiform, UgtkSetting* setting); // ---------------------------------------------------------------------------- // UgtkBandwidthForm struct UgtkBandwidthForm { GtkWidget* self; GtkSpinButton* upload; GtkSpinButton* download; }; void ugtk_bandwidth_form_init (struct UgtkBandwidthForm* bwform); void ugtk_bandwidth_form_set (struct UgtkBandwidthForm* bwform, UgtkSetting* setting); void ugtk_bandwidth_form_get (struct UgtkBandwidthForm* bwform, UgtkSetting* setting); // ---------------------------------------------------------------------------- // UgtkCompletionForm struct UgtkCompletionForm { GtkWidget* self; GtkEntry* command; GtkEntry* on_error; }; void ugtk_completion_form_init (struct UgtkCompletionForm* csform); void ugtk_completion_form_set (struct UgtkCompletionForm* csform, UgtkSetting* setting); void ugtk_completion_form_get (struct UgtkCompletionForm* csform, UgtkSetting* setting); // ---------------------------------------------------------------------------- // UgtkAutoSaveForm struct UgtkAutoSaveForm { GtkWidget* self; // auto save and interval GtkToggleButton* enable; GtkWidget* interval_label; GtkSpinButton* interval_spin; GtkWidget* minutes_label; // minutes }; void ugtk_auto_save_form_init (struct UgtkAutoSaveForm* asform); void ugtk_auto_save_form_set (struct UgtkAutoSaveForm* asform, UgtkSetting* setting); void ugtk_auto_save_form_get (struct UgtkAutoSaveForm* asform, UgtkSetting* setting); // ---------------------------------------------------------------------------- // UgtkCommandlineForm struct UgtkCommandlineForm { GtkWidget* self; // --quiet GtkToggleButton* quiet; // --category-index GtkWidget* index_label; GtkSpinButton* index_spin; }; void ugtk_commandline_form_init (struct UgtkCommandlineForm* clform); void ugtk_commandline_form_set (struct UgtkCommandlineForm* clform, UgtkSetting* setting); void ugtk_commandline_form_get (struct UgtkCommandlineForm* clform, UgtkSetting* setting); // ---------------------------------------------------------------------------- // UgtkPluginForm struct UgtkPluginForm { GtkWidget* self; GtkComboBoxText* order; // Aria2 options GtkWidget* aria2_opts; GtkToggleButton* launch; GtkToggleButton* shutdown; GtkEntry* uri; GtkEntry* token; GtkWidget* local; // GtkFrame GtkEntry* path; GtkWidget* args; // GtkTextView GtkTextBuffer* args_buffer; // Speed Limits for Aria2 GtkSpinButton* upload; // KiB/s GtkSpinButton* download; // KiB/s }; void ugtk_plugin_form_init (struct UgtkPluginForm* psform); void ugtk_plugin_form_set (struct UgtkPluginForm* psform, UgtkSetting* setting); void ugtk_plugin_form_get (struct UgtkPluginForm* psform, UgtkSetting* setting); // ---------------------------------------------------------------------------- // UgtkMediaWebsiteForm struct UgtkMediaWebsiteForm { GtkWidget* self; GtkComboBoxText* match_mode; GtkComboBoxText* quality; GtkComboBoxText* type; }; void ugtk_media_website_form_init (struct UgtkMediaWebsiteForm* mwform); void ugtk_media_website_form_set (struct UgtkMediaWebsiteForm* mwform, UgtkSetting* setting); void ugtk_media_website_form_get (struct UgtkMediaWebsiteForm* mwform, UgtkSetting* setting); #ifdef __cplusplus } #endif #endif // End of UGTK_SETTING_FORM_H uget-2.2.0/ui-gtk/UgtkNodeView.h0000644000175000000120000000556613224532612013326 00000000000000/* * * Copyright (C) 2012-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #ifndef UGTK_NODE_VIEW_H #define UGTK_NODE_VIEW_H #include #ifdef __cplusplus extern "C" { #endif // GtkTreeViewColumn* column; // column = gtk_tree_view_get_column (tree_view, UGTK_NODE_COLUMN_NAME); // gtk_tree_view_column_set_visible (column, TRUE); typedef enum { UGTK_NODE_COLUMN_STATE = 0, UGTK_NODE_COLUMN_NAME = 1, // Category & Status only UGTK_NODE_COLUMN_QUANTITY = 2, // Download only UGTK_NODE_COLUMN_COMPLETE = 2, // complete size UGTK_NODE_COLUMN_TOTAL, // total size UGTK_NODE_COLUMN_PERCENT, UGTK_NODE_COLUMN_ELAPSED, // consuming time UGTK_NODE_COLUMN_LEFT, // remaining time UGTK_NODE_COLUMN_SPEED, UGTK_NODE_COLUMN_UPLOAD_SPEED, // torrent UGTK_NODE_COLUMN_UPLOADED, // torrent UGTK_NODE_COLUMN_RATIO, // torrent UGTK_NODE_COLUMN_RETRY, UGTK_NODE_COLUMN_CATEGORY, // category name UGTK_NODE_COLUMN_URI, UGTK_NODE_COLUMN_ADDED_ON, UGTK_NODE_COLUMN_COMPLETED_ON, UGTK_NODE_N_COLUMNS, } UgtkNodeColumn; // return GtkTreeView GtkWidget* ugtk_node_view_new_for_download (void); GtkWidget* ugtk_node_view_new_for_category (void); GtkWidget* ugtk_node_view_new_for_state (void); void ugtk_node_view_use_large_icon (GtkTreeView* view, gboolean is_large, int fixed_width); #ifdef __cplusplus } #endif #endif // UGTK_NODE_VIEW_H uget-2.2.0/ui-gtk/UgtkApp-main.c0000644000175000000120000002041213224532612013226 00000000000000/* * * Copyright (C) 2012-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ // ---------------------------------------------------------------------------- // Windows #if defined _WIN32 || defined _WIN64 // This is for ATTACH_PARENT_PROCESS #ifndef _WIN32_WINNT #define _WIN32_WINNT 0x501 // WinXP #endif #include #include #if defined _WINDOWS static void atexit_callback (void) { FreeConsole (); } static void win32_console_init (void) { typedef BOOL (CALLBACK* LPFNATTACHCONSOLE) (DWORD); LPFNATTACHCONSOLE AttachConsole; HMODULE hmod; // If stdout hasn't been redirected to a file, alloc a console // (_istty() doesn't work for stuff using the GUI subsystem) if (_fileno(stdout) == -1 || _fileno(stdout) == -2) { AttachConsole = NULL; #ifdef UNICODE if ((hmod = GetModuleHandle(L"kernel32.dll"))) #else if ((hmod = GetModuleHandle("kernel32.dll"))) #endif { AttachConsole = (LPFNATTACHCONSOLE) GetProcAddress(hmod, "AttachConsole"); } if ( (AttachConsole && AttachConsole (ATTACH_PARENT_PROCESS)) || AllocConsole() ) { freopen("CONOUT$", "w", stdout); freopen("CONOUT$", "w", stderr); atexit (atexit_callback); } } } int WINAPI WinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPSTR lpszArgument, int nFunsterStil) { int main (int argc, char** argv); // below main() return main (__argc, __argv); } #endif // _WINDOWS #else #include // sync() #endif // _WIN32 || _WIN64 // ---------------------------------------------------------------------------- #include // exit(), EXIT_SUCCESS, EXIT_FAILURE #include // signal(), SIGTERM #include #include #include // OpenSSL #ifdef USE_OPENSSL #include #include static UgMutex* lockarray; static void lock_callback (int mode, int type, char *file, int line) { (void)file; (void)line; if (mode & CRYPTO_LOCK) { ug_mutex_lock (&(lockarray[type])); } else { ug_mutex_unlock (&(lockarray[type])); } } static unsigned long thread_id (void) { unsigned long ret; ret = (unsigned long) ug_thread_self(); return(ret); } static void init_locks (void) { int i; lockarray = (UgMutex*) OPENSSL_malloc (CRYPTO_num_locks() * sizeof(UgMutex)); for (i=0; i #include GCRY_THREAD_OPTION_PTHREAD_IMPL; static void init_locks (void) { gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread); } #define kill_locks() #endif // USE_GNUTLS // libnotify #ifdef HAVE_LIBNOTIFY #include #endif // GStreamer #ifdef HAVE_GSTREAMER #include gboolean gst_inited = FALSE; #endif #include // ---------------------------------------------------------------------------- // SIGTERM UgtkApp* ugtk_app; gboolean ugtk_quitting = FALSE; static void sys_signal_handler (int sig) { // void ug_socket_server_close (UgSocketServer* server); switch (sig) { case SIGINT: // Ctrl-C case SIGTERM: // termination request case SIGABRT: // Abnormal termination (abort) // case SIGQUIT: // avoid crash when program re-enter signal handler. if (ugtk_quitting == FALSE) { ugtk_quitting = TRUE; // This will quit gtk_main() to main() ugtk_app_quit (ugtk_app); #if !(defined _WIN32 || defined _WIN64) sync(); #endif } break; // case SIGSEGV: // signal (SIGSEGV, NULL); // ug_socket_server_close (ugtk_app->rpc->server); // break; default: break; } } /* static void sys_set_sigaction () { struct sigaction action, old_action; action.sa_handler = sys_signal_handler; sigemptyset(&action.sa_mask); action.sa_flags = 0; //action.sa_flags |= SA_RESTART; sigaction(SIGINT, NULL, &old_action); if (old_action.sa_handler != SIG_IGN) { sigaction(SIGINT, &action, NULL); } } */ // ---------------------------------------------------------------------------- // main () int main (int argc, char** argv) { UgetRpc* rpc; // I18N bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); textdomain (GETTEXT_PACKAGE); // Command line if (ug_args_find_version (argc-1, argv+1)) { #if (defined _WIN32 || defined _WIN64) && defined _WINDOWS win32_console_init (); #endif g_print ("uGet " PACKAGE_VERSION " for GTK+" "\n"); return EXIT_SUCCESS; } if (ug_args_find_help (argc-1, argv+1)) { #if (defined _WIN32 || defined _WIN64) && defined _WINDOWS win32_console_init (); #endif ug_option_entry_print_help (uget_option_entry, argv[0], "[URL]", NULL); return EXIT_SUCCESS; } // JSON-RPC server rpc = uget_rpc_new (NULL); #ifdef USE_UNIX_DOMAIN_SOCKET rpc->backup_dir = ug_build_filename (ugtk_get_config_dir (), UGTK_APP_DIR, "RPC-socket", NULL); uget_rpc_use_unix_socket (rpc, rpc->backup_dir, -1); ug_free (rpc->backup_dir); #endif rpc->backup_dir = g_build_filename (ugtk_get_config_dir (), UGTK_APP_DIR, "attachment", NULL); ug_create_dir_all (rpc->backup_dir, -1); if (uget_rpc_start_server (rpc, TRUE)) uget_rpc_send_command (rpc, argc-1, argv+1); else { uget_rpc_send_command (rpc, argc-1, argv+1); uget_rpc_free (rpc); return EXIT_SUCCESS; } // GTK+ gtk_init (&argc, &argv); // SSL #if defined USE_GNUTLS || defined USE_OPENSSL init_locks (); #endif // libnotify #ifdef HAVE_LIBNOTIFY notify_init ("uGet"); #endif // GStreamer #ifdef HAVE_GSTREAMER gst_inited = gst_init_check (&argc, &argv, NULL); #endif ugtk_app = g_malloc0 (sizeof (UgtkApp)); ugtk_app_init (ugtk_app, rpc); // signal handler signal (SIGINT, sys_signal_handler); signal (SIGTERM, sys_signal_handler); signal (SIGABRT, sys_signal_handler); // signal (SIGSEGV, sys_signal_handler); // signal (SIGQUIT, sys_signal_handler); gtk_main (); // avoid crash when program re-enter signal handler. ugtk_quitting = TRUE; // clear/free other resource uget_app_clear_attachment ((UgetApp*) ugtk_app); ugtk_app_final (ugtk_app); g_free (ugtk_app); // sleep 2 second to wait thread and shutdown RPC g_usleep (1000000); uget_rpc_free (rpc); g_usleep (1000000); // libnotify #ifdef HAVE_LIBNOTIFY if (notify_is_initted ()) notify_uninit (); #endif // SSL #if defined USE_GNUTLS || defined USE_OPENSSL kill_locks (); #endif return EXIT_SUCCESS; } uget-2.2.0/ui-gtk/UgtkApp-timeout.c0000644000175000000120000005633013224532612014000 00000000000000/* * * Copyright (C) 2005-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #ifdef HAVE_CONFIG_H #include # if HAVE_LIBNOTIFY # include # endif # if HAVE_GSTREAMER # include # endif #endif #ifdef _MSC_VER #define _CRT_SECURE_NO_WARNINGS #endif // _MSC_VER #if defined _WIN32 || defined _WIN64 #ifndef _WIN32_IE #define _WIN32_IE 0x0600 #endif // _WIN32_IE #include #include #endif // _WIN32 || _WIN64 #include #include #include #include #include static void ugtk_app_notify_error (UgtkApp* app); static void ugtk_app_notify_starting (UgtkApp* app); static void ugtk_app_notify_completed (UgtkApp* app); // GSourceFunc #ifdef HAVE_RSS_NOTIFY static gboolean ugtk_app_timeout_rss (UgtkApp* app); #endif static gboolean ugtk_app_timeout_rpc (UgtkApp* app); static gboolean ugtk_app_timeout_queuing (UgtkApp* app); static gboolean ugtk_app_timeout_clipboard (UgtkApp* app); static gboolean ugtk_app_timeout_autosave (UgtkApp* app); void ugtk_app_init_timeout (UgtkApp* app) { // 0.5 seconds g_timeout_add_full (G_PRIORITY_DEFAULT_IDLE, 500, (GSourceFunc) ugtk_app_timeout_rpc, app, NULL); // 0.5 seconds g_timeout_add_full (G_PRIORITY_DEFAULT_IDLE, 500, (GSourceFunc) ugtk_app_timeout_queuing, app, NULL); // 2 seconds g_timeout_add_seconds_full (G_PRIORITY_DEFAULT_IDLE, 2, (GSourceFunc) ugtk_app_timeout_clipboard, app, NULL); #ifdef HAVE_RSS_NOTIFY // 3 seconds g_timeout_add_seconds_full (G_PRIORITY_DEFAULT_IDLE, 3, (GSourceFunc) ugtk_app_timeout_rss, app, NULL); #endif // HAVE_RSS_NOTIFY // 1 minutes g_timeout_add_seconds_full (G_PRIORITY_DEFAULT_IDLE, 60, (GSourceFunc) ugtk_app_timeout_autosave, app, NULL); } static gboolean ugtk_app_timeout_autosave (UgtkApp* app) { static int counts = 0; counts++; // "app->setting.auto_save.interval" may changed by user if (counts >= app->setting.auto_save.interval) { counts = 0; if (app->setting.auto_save.enable) ugtk_app_save (app); } // return FALSE if the source should be removed. return TRUE; } // ---------------------------------------------------------------------------- // Queuing // scheduler static gboolean ugtk_app_decide_schedule_state (UgtkApp* app) { struct tm* timem; time_t timet; guint weekdays, dayhours; gboolean changed; UgetNode* cnode; UgtkScheduleState state; if (app->setting.scheduler.enable == FALSE) { app->schedule_state = UGTK_SCHEDULE_NORMAL; return FALSE; } // get current time timet = time (NULL); timem = localtime (&timet); dayhours = timem->tm_hour; if (timem->tm_wday == 0) weekdays = 6; else weekdays = timem->tm_wday - 1; // get current schedule state state = app->setting.scheduler.state.at[weekdays*24 + dayhours]; if (app->schedule_state == state) changed = FALSE; else { app->schedule_state = state; changed = TRUE; // switch mode switch (state) { case UGTK_SCHEDULE_TURN_OFF: for (cnode = app->real.children; cnode; cnode = cnode->next) uget_app_stop_category ((UgetApp*)app, cnode); // Don't notify anything app->user_action = TRUE; break; case UGTK_SCHEDULE_LIMITED_SPEED: // ug_running_set_speed (&app->running, // app->setting.speed_limit.scheduler.download, 0); break; default: // no speed limit uget_task_set_speed (&app->task, 0, 0); break; } } if (changed) { // refresh other data & status gtk_widget_queue_draw ((GtkWidget*) app->traveler.download.view); gtk_widget_queue_draw ((GtkWidget*) app->traveler.category.view); gtk_widget_queue_draw ((GtkWidget*) app->traveler.state.view); } return changed; } static gboolean ugtk_app_timeout_queuing (UgtkApp* app) { static int n_counts = 0; static int n_active_last = 0; int n_active; int no_queuing = FALSE; gchar* string; ugtk_app_decide_schedule_state (app); if (app->setting.offline_mode || app->schedule_state == UGTK_SCHEDULE_TURN_OFF) { no_queuing = TRUE; } // if current status is "All" or "Active" if (app->traveler.state.cursor.pos == 0 || app->traveler.state.cursor.pos == 1) { ugtk_traveler_reserve_selection (&app->traveler); } n_active = uget_app_grow ((UgetApp*) app, no_queuing); if (n_active != n_active_last) { // start downloading if (n_active > 0 && n_active_last == 0) { // starting notification if (app->setting.ui.start_notification) ugtk_app_notify_starting (app); } // stop downloading else if (n_active == 0 && n_active_last > 0) { if (app->n_error > 0) { // error notification ugtk_app_notify_error (app); // This will show error icon at tray. app->trayicon.error_occurred = TRUE; } else if (app->user_action == FALSE) { // completed notification ugtk_app_notify_completed (app); // This will show normal icon at tray. app->trayicon.error_occurred = FALSE; } else { // This will show normal icon at tray. app->trayicon.error_occurred = FALSE; } // Completion Auto-Actions if (app->setting.completion.action > 0 && app->user_action == FALSE) { ugtk_app_save (app); switch (app->setting.completion.action) { case 1: // hibernate ug_hibernate (); break; case 2: // suspend ug_suspend (); break; case 3: // shutdown ug_shutdown (); break; case 4: // reboot ug_reboot (); break; case 5: // custom if (app->n_error > 0) { if (app->setting.completion.on_error) system (app->setting.completion.on_error); } else { if (app->setting.completion.command) system (app->setting.completion.command); } break; } } // reset counter app->n_error = 0; app->n_completed = 0; } // change window title if (n_active == 0) gtk_window_set_title (app->window.self, UGTK_APP_NAME); else { string = g_strdup_printf (UGTK_APP_NAME " - %u %s", n_active, _("tasks")); gtk_window_set_title (app->window.self, string); g_free (string); } } if (n_active > 0 || n_active != n_active_last || app->n_moved > 0) { // adjust speed limit every 1 seconds if (n_counts & 1) uget_task_adjust_speed (&app->task); // summary ugtk_summary_show (&app->summary, ugtk_traveler_get_cursor (&app->traveler)); // status bar ugtk_statusbar_set_speed (&app->statusbar, app->task.speed.download, app->task.speed.upload); // tray icon ugtk_tray_icon_set_info (&app->trayicon, n_active, app->task.speed.download, app->task.speed.upload); } if (app->n_moved > 0) { // refresh other data & status gtk_widget_queue_draw ((GtkWidget*) app->traveler.download.view); gtk_widget_queue_draw ((GtkWidget*) app->traveler.category.view); gtk_widget_queue_draw ((GtkWidget*) app->traveler.state.view); } // if current status is "All" or "Active" if (app->traveler.state.cursor.pos == 0 || app->traveler.state.cursor.pos == 1) { if (app->n_moved > 0) ugtk_traveler_restore_selection (&app->traveler); } app->user_action = FALSE; app->n_moved = 0; // reset counter n_active_last = n_active; n_counts++; return TRUE; } // ---------------------------------------------------------------------------- // Clipboard // static void on_keep_above_window_show (GtkWindow *window, gpointer user_data) { gtk_window_present (window); gtk_window_set_keep_above (window, FALSE); } static void ugtk_app_add_uris_quietly (UgtkApp* app, GList* list, UgetNode* infonode, int nth_category) { GList* link; UgUri uuri; UgetNode* cnode; UgetNode* dnode; UgetCommon* common; // filter existing if (app->setting.ui.skip_existing) { if (ugtk_app_filter_existing (app, list) == 0) return; } for (link = list; link; link = link->next) { // check existing if (link->data == NULL) continue; // select category cnode = NULL; if (nth_category != -1) cnode = uget_node_nth_child (&app->real, nth_category); if (cnode == NULL) { // match category by URI ug_uri_init (&uuri, link->data); cnode = uget_app_match_category ((UgetApp*) app, &uuri, NULL); } if (cnode == NULL && infonode) { // match category by filename common = ug_info_realloc (&infonode->info, UgetCommonInfo); if (common && common->file) { ug_uri_init (&uuri, common->file); cnode = uget_app_match_category ((UgetApp*) app, &uuri, NULL); } } if (cnode == NULL) { if (infonode == NULL) { cnode = uget_node_nth_child (&app->real, app->setting.clipboard.nth_category); } else { cnode = uget_node_nth_child (&app->real, app->setting.commandline.nth_category); } } if (cnode == NULL) cnode = uget_node_nth_child (&app->real, 0); // add download if (infonode == NULL) { // add and free URI uget_app_add_download_uri ((UgetApp*) app, link->data, cnode, TRUE); g_free (link->data); } else { dnode = uget_node_new (NULL); ug_info_assign (&dnode->info, &infonode->info, NULL); common = ug_info_realloc (&dnode->info, UgetCommonInfo); common->uri = link->data; uget_app_add_download ((UgetApp*) app, dnode, cnode, TRUE); } link->data = NULL; } } static void ugtk_app_add_uris_selected (UgtkApp* app, GList* list, UgetNode* infonode, int nth_category) { UgtkBatchDialog* bdialog; UgtkSelectorPage* page; UgetCommon* common; UgetNode* cnode; UgUri uuri; gchar* title; // filter existing if (app->setting.ui.skip_existing) { if (ugtk_app_filter_existing (app, list) == 0) return; } // choose title for clipboard or command-line if (infonode == NULL) title = g_strconcat (UGTK_APP_NAME " - ", _("New from Clipboard"), NULL); else title = g_strconcat (UGTK_APP_NAME " - ", _("New Download"), NULL); bdialog = ugtk_batch_dialog_new (title, app); g_free (title); // disable batch if only one uri in list. if (list->next == NULL) ugtk_batch_dialog_disable_batch (bdialog); // apply other setting if (infonode) { ugtk_download_form_set (&bdialog->download, infonode, FALSE); ugtk_proxy_form_set (&bdialog->proxy, infonode, FALSE); } // add URIs if (list->next == NULL) { gtk_entry_set_text (GTK_ENTRY (bdialog->download.uri_entry), list->data); bdialog->download.changed.uri = TRUE; } else { // After calling ugtk_selector_page_add_uris(), // all uris in list will be freed. ugtk_batch_dialog_use_selector (bdialog); ugtk_selector_hide_href (&bdialog->selector); if (infonode == NULL) page = ugtk_selector_add_page (&bdialog->selector, _("Clipboard")); else page = ugtk_selector_add_page (&bdialog->selector, _("Command line")); ugtk_selector_page_add_uris (page, list); } // set folder history and info ugtk_download_form_set_folders (&bdialog->download, &app->setting); // select category cnode = NULL; if (nth_category != -1) cnode = uget_node_nth_child (&app->real, nth_category); if (cnode == NULL && list->data) { // match category by URI ug_uri_init (&uuri, list->data); if (infonode == NULL) cnode = uget_app_match_category ((UgetApp*) app, &uuri, NULL); else { common = ug_info_realloc (&infonode->info, UgetCommonInfo); cnode = uget_app_match_category ((UgetApp*) app, &uuri, common->file); } } if (cnode == NULL) { if (infonode == NULL) { cnode = uget_node_nth_child (&app->real, app->setting.clipboard.nth_category); } else { cnode = uget_node_nth_child (&app->real, app->setting.commandline.nth_category); } } if (cnode == NULL) cnode = uget_node_nth_child (&app->real, 0); ugtk_batch_dialog_set_category (bdialog, cnode); // connect signal and set data in download dialog g_signal_connect_after (bdialog->self, "show", G_CALLBACK (on_keep_above_window_show), NULL); // Make sure dilaog will show on top first time. // uget_on_keep_above_window_show () will set keep_above = FALSE gtk_window_set_keep_above ((GtkWindow*) bdialog->self, TRUE); ugtk_batch_dialog_run (bdialog); } static void on_clipboard_text_received (GtkClipboard* clipboard, const gchar* text, gpointer user_data) { UgtkApp* app; GList* list; app = (UgtkApp*) user_data; list = ugtk_clipboard_get_matched (&app->clipboard, text); if (list) { if (app->setting.clipboard.quiet) ugtk_app_add_uris_quietly (app, list, NULL, -1); else ugtk_app_add_uris_selected (app, list, NULL, -1); g_list_free (list); // refresh gtk_widget_queue_draw ((GtkWidget*) app->traveler.category.view); gtk_widget_queue_draw ((GtkWidget*) app->traveler.state.view); } app->clipboard.processing = FALSE; } static gboolean ugtk_app_timeout_clipboard (UgtkApp* app) { if (app->setting.clipboard.monitor && app->clipboard.processing == FALSE) { // set FALSE in on_clipboard_text_received() app->clipboard.processing = TRUE; gtk_clipboard_request_text (app->clipboard.self, on_clipboard_text_received, app); } // return FALSE if the source should be removed. return TRUE; } // ---------------------------------------------------------------------------- // RPC static gboolean ugtk_app_timeout_rpc (UgtkApp* app) { UgetRpcReq* req; UgetRpcCmd* cmd; UgetNode* infonode; for (;;) { if (uget_rpc_has_request(app->rpc) == FALSE) return TRUE; req = uget_rpc_get_request (app->rpc); switch (req->method_id) { case UGET_RPC_PRESENT: // if (gtk_widget_get_visible ((GtkWidget*) app->window.self) == FALSE) // gtk_window_deiconify (app->window.self); gtk_window_present (app->window.self); // set position and size gtk_window_move (app->window.self, app->setting.window.x, app->setting.window.y); gtk_window_resize (app->window.self, app->setting.window.width, app->setting.window.height); break; case UGET_RPC_SEND_COMMAND: cmd = (UgetRpcCmd*) req; // control online/offline switch (cmd->value.ctrl.offline) { case 0: app->setting.offline_mode = FALSE; gtk_check_menu_item_set_active ( (GtkCheckMenuItem*) app->menubar.file.offline_mode, FALSE); break; case 1: app->setting.offline_mode = TRUE; gtk_check_menu_item_set_active ( (GtkCheckMenuItem*) app->menubar.file.offline_mode, TRUE); break; default: break; } // if user want to add downloads quietly. if (app->setting.commandline.quiet) cmd->value.quiet = TRUE; // URIs if (cmd->uris.size == 0) break; // add downloads infonode = uget_node_new (NULL); uget_option_value_to_info (&cmd->value, &infonode->info); if (cmd->value.quiet) { ugtk_app_add_uris_quietly (app, (GList*) cmd->uris.head, infonode, cmd->value.category_index); } else { ugtk_app_add_uris_selected (app, (GList*) cmd->uris.head, infonode, cmd->value.category_index); } uget_node_unref (infonode); break; default: break; } req->free (req); } return TRUE; } // ---------------------------------------------------------------------------- // RSS #ifdef HAVE_RSS_NOTIFY static gboolean ugtk_app_timeout_rss_update (UgtkApp* app) { uget_rss_update (app->rss_builtin, FALSE); // check RSS ready every 3 seconds g_timeout_add_seconds_full (G_PRIORITY_DEFAULT_IDLE, 3, (GSourceFunc) ugtk_app_timeout_rss, app, NULL); // return FALSE if the source should be removed. return FALSE; } static gboolean ugtk_app_timeout_rss (UgtkApp* app) { if (app->rss_builtin->updating == FALSE) { if (app->rss_builtin->n_updated > 0) { ugtk_banner_show_rss (&app->banner, app->rss_builtin); app->rss_builtin->n_updated = 0; } // update RSS every 30 minutes g_timeout_add_seconds_full (G_PRIORITY_DEFAULT_IDLE, 60 * 30, (GSourceFunc) ugtk_app_timeout_rss_update, app, NULL); // return FALSE if the source should be removed. return FALSE; } return TRUE; } #endif // HAVE_RSS_NOTIFY // ---------------------------------------------------------------------------- // sound // static void uget_play_sound (const gchar* sound_file); // GStreamer #ifdef HAVE_GSTREAMER static gboolean ugst_bus_func (GstBus* bus, GstMessage* msg, gpointer data) { GstElement* playbin = data; GError* error = NULL; switch (GST_MESSAGE_TYPE (msg)) { case GST_MESSAGE_WARNING: gst_message_parse_warning (msg, &error, NULL); // g_print ("uget-gtk: gstreamer: %s\n", error->message); g_error_free (error); break; case GST_MESSAGE_ERROR: gst_message_parse_error (msg, &error, NULL); // g_print ("uget-gtk: gstreamer: %s\n", error->message); g_error_free (error); // clean up case GST_MESSAGE_EOS: gst_element_set_state (playbin, GST_STATE_NULL); gst_object_unref (GST_OBJECT (playbin)); break; default: break; } return TRUE; } static void ugtk_play_sound (const gchar* sound_file) { GstElement* playbin = NULL; GstBus* bus = NULL; char* uri; gchar* file_os; extern gboolean gst_inited; // ui-gtk/UgtkApp-main.c if (gst_inited == FALSE) return; file_os = g_filename_from_utf8 (sound_file, -1, NULL, NULL, NULL); if (g_file_test (file_os, G_FILE_TEST_EXISTS) == FALSE) { g_free (file_os); return; } playbin = gst_element_factory_make ("playbin", "play"); if (playbin == NULL) { g_free (file_os); return; } uri = g_filename_to_uri (file_os, NULL, NULL); g_free (file_os); g_object_set (G_OBJECT (playbin), "uri", uri, NULL); bus = gst_pipeline_get_bus (GST_PIPELINE (playbin)); gst_bus_add_watch (bus, ugst_bus_func, playbin); gst_element_set_state (playbin, GST_STATE_PLAYING); gst_object_unref (bus); g_free (uri); } #elif defined (_WIN32) static void ugtk_play_sound (const gchar* sound_file) { gunichar2* file_wcs; if (g_file_test (sound_file, G_FILE_TEST_EXISTS) == FALSE) return; file_wcs = g_utf8_to_utf16 (sound_file, -1, NULL, NULL, NULL); PlaySoundW (file_wcs, NULL, SND_ASYNC | SND_FILENAME); g_free (file_wcs); } #else // --disable-gstreamer static void ugtk_play_sound (const gchar* sound_file) { } #endif // HAVE_GSTREAMER // ---------------------------------------------------------------------------- // notification // #if defined HAVE_LIBNOTIFY static void ugtk_app_notify (UgtkApp* app, const gchar* title, const gchar* body) { static NotifyNotification* notification = NULL; gchar* string; if (notify_is_initted () == FALSE) return; // set title and body string = g_strconcat (UGTK_APP_NAME " - ", title, NULL); if (notification == NULL) { #if defined (NOTIFY_VERSION_MINOR) && NOTIFY_VERSION_MAJOR >= 0 && NOTIFY_VERSION_MINOR >= 7 notification = notify_notification_new (string, body, UGTK_APP_ICON_NAME); #else notification = notify_notification_new (string, body, UGTK_APP_ICON_NAME, NULL); #endif notify_notification_set_timeout (notification, 7000); // milliseconds } else { notify_notification_update (notification, string, body, UGTK_APP_ICON_NAME); } g_free (string); notify_notification_show (notification, NULL); } #elif defined _WIN32 || defined _WIN64 static void ugtk_app_notify (UgtkApp* app, const gchar* title, const gchar* body) { static NOTIFYICONDATAW* pNotifyData = NULL; gchar* string; gunichar2* string_wcs; if (pNotifyData == NULL) { pNotifyData = g_malloc0 (sizeof (NOTIFYICONDATAW)); pNotifyData->cbSize = sizeof (NOTIFYICONDATAW); pNotifyData->uFlags = NIF_INFO; // Use a balloon ToolTip instead of a standard ToolTip. pNotifyData->uTimeout = 7000; // milliseconds, This member is deprecated as of Windows Vista. pNotifyData->dwInfoFlags = NIIF_INFO | NIIF_NOSOUND; // Add an information icon to balloon ToolTip. // gtkstatusicon.c // (create_tray_observer): WNDCLASS.lpszClassName = "gtkstatusicon-observer" pNotifyData->hWnd = FindWindowA ("gtkstatusicon-observer", NULL); } if (pNotifyData->hWnd == NULL) return; // gtkstatusicon.c // (gtk_status_icon_init): priv->nid.uID = GPOINTER_TO_UINT (status_icon); pNotifyData->uID = GPOINTER_TO_UINT (app->trayicon.self); // title string = g_strconcat (UGTK_APP_NAME " - ", title, NULL); string_wcs = g_utf8_to_utf16 (string, -1, NULL, NULL, NULL); wcsncpy (pNotifyData->szInfoTitle, string_wcs, 64 -1); // null-terminated g_free (string); g_free (string_wcs); // body string_wcs = g_utf8_to_utf16 (body, -1, NULL, NULL, NULL); wcsncpy (pNotifyData->szInfo, string_wcs, 256 -1); // null-terminated g_free (string_wcs); Shell_NotifyIconW (NIM_MODIFY, pNotifyData); } #else static void ugtk_app_notify (UgtkApp* app, const gchar* title, const gchar* info) { // do nothing } #endif // HAVE_LIBNOTIFY #define NOTIFICATION_ERROR_TITLE _("Error Occurred") #define NOTIFICATION_ERROR_STRING _("Error Occurred when downloading.") #define NOTIFICATION_STARTING_TITLE _("Download Starting") #define NOTIFICATION_STARTING_STRING _("Starting download queue.") #define NOTIFICATION_COMPLETED_TITLE _("Download Completed") #define NOTIFICATION_COMPLETED_STRING _("All queuing downloads have been completed.") static void ugtk_app_notify_error (UgtkApp* app) { gchar* path; ugtk_app_notify (app, NOTIFICATION_ERROR_TITLE, NOTIFICATION_ERROR_STRING); if (app->setting.ui.sound_notification) { path = g_build_filename (ugtk_get_data_dir (), "sounds", "uget", "notification.wav", NULL); ugtk_play_sound (path); g_free (path); } } static void ugtk_app_notify_completed (UgtkApp* app) { gchar* path; ugtk_app_notify (app, NOTIFICATION_COMPLETED_TITLE, NOTIFICATION_COMPLETED_STRING); if (app->setting.ui.sound_notification) { path = g_build_filename (ugtk_get_data_dir (), "sounds", "uget", "notification.wav", NULL); ugtk_play_sound (path); g_free (path); } } static void ugtk_app_notify_starting (UgtkApp* app) { // gchar* path; ugtk_app_notify (app, NOTIFICATION_STARTING_TITLE, NOTIFICATION_STARTING_STRING); // if (app->setting.ui.sound_notification) { // path = g_build_filename (ugtk_get_data_dir (), // "sounds", "uget", "notification.wav", NULL); // ugtk_play_sound (path); // g_free (path); // } } uget-2.2.0/ui-gtk/UgtkSettingForm.c0000644000175000000120000010702413224532612014032 00000000000000/* * * Copyright (C) 2005-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #include #include #include #include // ---------------------------------------------------------------------------- // UgtkClipboardForm // // void ugtk_clipboard_form_init (struct UgtkClipboardForm* cbform) { PangoContext* context; PangoLayout* layout; int text_height; GtkTextView* textview; GtkWidget* widget; GtkBox* vbox; GtkBox* hbox; GtkScrolledWindow* scroll; cbform->self = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); vbox = (GtkBox*) cbform->self; // Monitor button widget = gtk_check_button_new_with_mnemonic (_("_Enable clipboard monitor")); gtk_box_pack_start (vbox, widget, FALSE, FALSE, 1); cbform->monitor = (GtkToggleButton*) widget; // quiet mode widget = gtk_check_button_new_with_mnemonic (_("_Quiet mode")); gtk_box_pack_start (vbox, widget, FALSE, FALSE, 0); cbform->quiet = (GtkToggleButton*) widget; // Nth category hbox = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); gtk_box_pack_start (vbox, (GtkWidget*) hbox, FALSE, FALSE, 2); widget = gtk_label_new (_("Default category index")); gtk_box_pack_start (hbox, widget, FALSE, FALSE, 2); cbform->nth_label = widget; widget = gtk_spin_button_new_with_range (0.0, 1000.0, 1.0); gtk_entry_set_activates_default (GTK_ENTRY (widget), TRUE); gtk_box_pack_start (hbox, widget, FALSE, FALSE, 2); cbform->nth_spin = (GtkSpinButton*) widget; // hint hbox = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); gtk_box_pack_start (vbox, (GtkWidget*) hbox, FALSE, FALSE, 2); widget = gtk_label_new (" - "); gtk_box_pack_start (hbox, widget, FALSE, FALSE, 0); widget = gtk_label_new (_("Adding to Nth category if no matched category.")); gtk_box_pack_start (hbox, widget, FALSE, FALSE, 0); gtk_box_pack_start (vbox, gtk_label_new (""), FALSE, FALSE, 2); // media or storage website widget = gtk_check_button_new_with_mnemonic (_("_Monitor URL of website")); gtk_box_pack_start (vbox, widget, FALSE, FALSE, 1); cbform->website = (GtkToggleButton*) widget; gtk_box_pack_start (vbox, gtk_label_new (""), FALSE, FALSE, 2); // get text height --- begin --- context = gtk_widget_get_pango_context (widget); layout = pango_layout_new (context); pango_layout_set_text (layout, "joIN", -1); pango_layout_get_pixel_size (layout, NULL, &text_height); g_object_unref (layout); // get text height --- end --- hbox = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); gtk_box_pack_start (vbox, (GtkWidget*) hbox, FALSE, FALSE, 2); widget = gtk_label_new (_("Monitor clipboard for specified file types:")); gtk_box_pack_start (hbox, widget, FALSE, FALSE, 1); // Scrolled Window scroll = (GtkScrolledWindow*) gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (scroll, GTK_SHADOW_IN); gtk_widget_set_size_request (GTK_WIDGET (scroll), 100, text_height * 6); gtk_box_pack_start (vbox, GTK_WIDGET (scroll), FALSE, FALSE, 2); // file type pattern : TextView cbform->buffer = gtk_text_buffer_new (NULL); cbform->pattern = gtk_text_view_new_with_buffer (cbform->buffer); g_object_unref (cbform->buffer); textview = (GtkTextView*) cbform->pattern; gtk_text_view_set_wrap_mode (textview, GTK_WRAP_WORD_CHAR); gtk_container_add (GTK_CONTAINER (scroll), GTK_WIDGET (cbform->pattern)); // tips hbox = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); gtk_box_pack_start (vbox, (GtkWidget*) hbox, FALSE, FALSE, 1); gtk_box_pack_end (hbox, gtk_label_new (_("Separate the types with character '|'.")), FALSE, FALSE, 2); hbox = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); gtk_box_pack_start (vbox, (GtkWidget*) hbox, FALSE, FALSE, 1); gtk_box_pack_end (hbox, gtk_label_new (_("You can use regular expressions here.")), FALSE, FALSE, 2); } void ugtk_clipboard_form_set (struct UgtkClipboardForm* cbform, UgtkSetting* setting) { if (setting->clipboard.pattern) gtk_text_buffer_set_text (cbform->buffer, setting->clipboard.pattern, -1); gtk_toggle_button_set_active (cbform->monitor, setting->clipboard.monitor); gtk_toggle_button_set_active (cbform->quiet, setting->clipboard.quiet); gtk_toggle_button_set_active (cbform->website, setting->clipboard.website); gtk_spin_button_set_value (cbform->nth_spin, setting->clipboard.nth_category); gtk_toggle_button_toggled (cbform->monitor); gtk_toggle_button_toggled (cbform->quiet); // on_clipboard_quiet_mode_toggled ((GtkWidget*) cbform->quiet, cbform); } void ugtk_clipboard_form_get (struct UgtkClipboardForm* cbform, UgtkSetting* setting) { GtkTextIter iter1; GtkTextIter iter2; gtk_text_buffer_get_start_iter (cbform->buffer, &iter1); gtk_text_buffer_get_end_iter (cbform->buffer, &iter2); ug_free (setting->clipboard.pattern); setting->clipboard.pattern = gtk_text_buffer_get_text (cbform->buffer, &iter1, &iter2, FALSE); setting->clipboard.monitor = gtk_toggle_button_get_active (cbform->monitor); setting->clipboard.quiet = gtk_toggle_button_get_active (cbform->quiet); setting->clipboard.website = gtk_toggle_button_get_active (cbform->website); setting->clipboard.nth_category = gtk_spin_button_get_value_as_int (cbform->nth_spin); // remove line break ug_str_remove_crlf (setting->clipboard.pattern, setting->clipboard.pattern); } // ---------------------------------------------------------------------------- // UgtkUserInterfaceForm // void ugtk_user_interface_form_init (struct UgtkUserInterfaceForm* uiform) { GtkWidget* widget; GtkBox* vbox; uiform->self = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); // Confirmation vbox = (GtkBox*) uiform->self; widget = gtk_frame_new (_("Confirmation")); gtk_box_pack_start (vbox, widget, FALSE, FALSE, 1); vbox = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_add (GTK_CONTAINER (widget), (GtkWidget*) vbox); gtk_container_set_border_width (GTK_CONTAINER (vbox), 2); // Confirmation check buttons widget = gtk_check_button_new_with_label (_("Show confirmation dialog on exit")); uiform->confirm_exit = (GtkToggleButton*) widget; gtk_box_pack_start (vbox, widget, FALSE, FALSE, 1); widget = gtk_check_button_new_with_label (_("Confirm when deleting files")); uiform->confirm_delete = (GtkToggleButton*) widget; gtk_box_pack_start (vbox, widget, FALSE, FALSE, 1); // System Tray vbox = (GtkBox*) uiform->self; widget = gtk_frame_new (_("System Tray")); gtk_box_pack_start (vbox, widget, FALSE, FALSE, 1); vbox = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_add (GTK_CONTAINER (widget), (GtkWidget*) vbox); gtk_container_set_border_width (GTK_CONTAINER (vbox), 2); // System Tray check buttons widget = gtk_check_button_new_with_label (_("Always show tray icon")); uiform->show_trayicon = (GtkToggleButton*) widget; gtk_box_pack_start (vbox, widget, FALSE, FALSE, 1); widget = gtk_check_button_new_with_label (_("Minimize to tray on startup")); uiform->start_in_tray = (GtkToggleButton*) widget; gtk_box_pack_start (vbox, widget, FALSE, FALSE, 1); widget = gtk_check_button_new_with_label (_("Close to tray on window close")); uiform->close_to_tray = (GtkToggleButton*) widget; gtk_box_pack_start (vbox, widget, FALSE, FALSE, 1); #ifdef HAVE_APP_INDICATOR widget = gtk_check_button_new_with_label (_("Use Ubuntu's App Indicator")); uiform->app_indicator = (GtkToggleButton*) widget; gtk_box_pack_start (vbox, widget, FALSE, FALSE, 1); #endif // Others vbox = (GtkBox*) uiform->self; widget = gtk_check_button_new_with_label (_("Enable offline mode on startup")); uiform->start_in_offline_mode = (GtkToggleButton*) widget; gtk_box_pack_start (vbox, widget, FALSE, FALSE, 1); widget = gtk_check_button_new_with_label (_("Download starting notification")); uiform->start_notification = (GtkToggleButton*) widget; gtk_box_pack_start (vbox, widget, FALSE, FALSE, 1); widget = gtk_check_button_new_with_label (_("Sound when download is finished")); uiform->sound_notification = (GtkToggleButton*) widget; gtk_box_pack_start (vbox, widget, FALSE, FALSE, 1); widget = gtk_check_button_new_with_label (_("Apply recent download settings")); uiform->apply_recent = (GtkToggleButton*) widget; gtk_box_pack_start (vbox, widget, FALSE, FALSE, 1); // widget = gtk_check_button_new_with_label (_("Skip existing URI from clipboard and command-line")); // uiform->skip_existing = (GtkToggleButton*) widget; // gtk_box_pack_start (vbox, widget, FALSE, FALSE, 1); widget = gtk_check_button_new_with_label (_("Display large icon")); uiform->large_icon = (GtkToggleButton*) widget; gtk_box_pack_start (vbox, widget, FALSE, FALSE, 1); } void ugtk_user_interface_form_set (struct UgtkUserInterfaceForm* uiform, UgtkSetting* setting) { gtk_toggle_button_set_active (uiform->close_to_tray, setting->ui.close_to_tray); gtk_toggle_button_set_active (uiform->confirm_exit, setting->ui.exit_confirmation); gtk_toggle_button_set_active (uiform->confirm_delete, setting->ui.delete_confirmation); gtk_toggle_button_set_active (uiform->show_trayicon, setting->ui.show_trayicon); gtk_toggle_button_set_active (uiform->start_in_tray, setting->ui.start_in_tray); gtk_toggle_button_set_active (uiform->start_in_offline_mode, setting->ui.start_in_offline_mode); gtk_toggle_button_set_active (uiform->start_notification, setting->ui.start_notification); gtk_toggle_button_set_active (uiform->sound_notification, setting->ui.sound_notification); gtk_toggle_button_set_active (uiform->apply_recent, setting->ui.apply_recent); // gtk_toggle_button_set_active (uiform->skip_existing, // setting->ui.skip_existing); gtk_toggle_button_set_active (uiform->large_icon, setting->ui.large_icon); #ifdef HAVE_APP_INDICATOR gtk_toggle_button_set_active (uiform->app_indicator, setting->ui.app_indicator); #endif } void ugtk_user_interface_form_get (struct UgtkUserInterfaceForm* uiform, UgtkSetting* setting) { setting->ui.close_to_tray = gtk_toggle_button_get_active (uiform->close_to_tray); setting->ui.exit_confirmation = gtk_toggle_button_get_active (uiform->confirm_exit); setting->ui.delete_confirmation = gtk_toggle_button_get_active (uiform->confirm_delete); setting->ui.show_trayicon = gtk_toggle_button_get_active (uiform->show_trayicon); setting->ui.start_in_tray = gtk_toggle_button_get_active (uiform->start_in_tray); setting->ui.start_in_offline_mode = gtk_toggle_button_get_active (uiform->start_in_offline_mode); setting->ui.start_notification = gtk_toggle_button_get_active (uiform->start_notification); setting->ui.sound_notification = gtk_toggle_button_get_active (uiform->sound_notification); setting->ui.apply_recent = gtk_toggle_button_get_active (uiform->apply_recent); // setting->ui.skip_existing = gtk_toggle_button_get_active (uiform->skip_existing); setting->ui.large_icon = gtk_toggle_button_get_active (uiform->large_icon); #ifdef HAVE_APP_INDICATOR setting->ui.app_indicator = gtk_toggle_button_get_active (uiform->app_indicator); #endif } // ---------------------------------------------------------------------------- // UgtkBandwidthForm // void ugtk_bandwidth_form_init (struct UgtkBandwidthForm* bwform) { GtkWidget* widget; GtkBox* box; GtkBox* vbox; GtkBox* hbox; box = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); bwform->self = (GtkWidget*) box; widget = gtk_label_new (_("These will affect all plug-ins.")); gtk_box_pack_start (box, widget, FALSE, FALSE, 2); widget = gtk_label_new (""); gtk_box_pack_start (box, widget, FALSE, FALSE, 2); // Global speed limit widget = gtk_frame_new (_("Global speed limit")); vbox = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_add (GTK_CONTAINER (widget), (GtkWidget*) vbox); gtk_container_set_border_width (GTK_CONTAINER (vbox), 2); gtk_box_pack_start (box, widget, FALSE, FALSE, 2); // Max upload speed hbox = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); gtk_box_pack_start (vbox, (GtkWidget*) hbox, FALSE, FALSE, 2); widget = gtk_label_new (_("Max upload speed")); gtk_box_pack_start (hbox, widget, FALSE, FALSE, 2); widget = gtk_label_new (_("KiB/s")); gtk_box_pack_end (hbox, widget, FALSE, FALSE, 2); widget = gtk_spin_button_new_with_range (0.0, 4000000000.0, 5.0); gtk_entry_set_width_chars (GTK_ENTRY (widget), 15); gtk_entry_set_activates_default (GTK_ENTRY (widget), TRUE); gtk_box_pack_end (hbox, widget, FALSE, FALSE, 2); bwform->upload = (GtkSpinButton*) widget; // Max download speed hbox = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); gtk_box_pack_start (vbox, (GtkWidget*) hbox, FALSE, FALSE, 2); widget = gtk_label_new (_("Max download speed")); gtk_box_pack_start (hbox, widget, FALSE, FALSE, 2); widget = gtk_label_new (_("KiB/s")); gtk_box_pack_end (hbox, widget, FALSE, FALSE, 2); widget = gtk_spin_button_new_with_range (0.0, 4000000000.0, 5.0); gtk_entry_set_width_chars (GTK_ENTRY (widget), 15); gtk_entry_set_activates_default (GTK_ENTRY (widget), TRUE); gtk_box_pack_end (hbox, widget, FALSE, FALSE, 2); bwform->download = (GtkSpinButton*) widget; } void ugtk_bandwidth_form_set (struct UgtkBandwidthForm* bwform, UgtkSetting* setting) { gtk_spin_button_set_value (bwform->upload, setting->bandwidth.normal.upload); gtk_spin_button_set_value (bwform->download, setting->bandwidth.normal.download); } void ugtk_bandwidth_form_get (struct UgtkBandwidthForm* bwform, UgtkSetting* setting) { setting->bandwidth.normal.upload = (guint) gtk_spin_button_get_value (bwform->upload); setting->bandwidth.normal.download = (guint) gtk_spin_button_get_value (bwform->download); } // ---------------------------------------------------------------------------- // UgtkCompletionForm // void ugtk_completion_form_init (struct UgtkCompletionForm* csform) { GtkWidget* widget; GtkWidget* entry; GtkBox* vbox; GtkBox* hbox; widget = gtk_frame_new (_("Completion Auto-Actions")); vbox = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_add (GTK_CONTAINER (widget), (GtkWidget*) vbox); gtk_container_set_border_width (GTK_CONTAINER (vbox), 2); csform->self = widget; hbox = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); gtk_box_pack_start (vbox, (GtkWidget*) hbox, FALSE, FALSE, 1); widget = gtk_label_new (_("Custom command:")); gtk_box_pack_start (hbox, widget, FALSE, FALSE, 0); entry = gtk_entry_new (); gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE); gtk_box_pack_start (vbox, entry, TRUE, TRUE, 2); csform->command = (GtkEntry*) entry; gtk_box_pack_start (vbox, gtk_label_new (""), FALSE, FALSE, 2); hbox = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); gtk_box_pack_start (vbox, (GtkWidget*) hbox, FALSE, FALSE, 1); widget = gtk_label_new (_("Custom command if error occurred:")); gtk_box_pack_start (hbox, widget, FALSE, FALSE, 0); entry = gtk_entry_new (); gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE); gtk_box_pack_start (vbox, entry, TRUE, TRUE, 2); csform->on_error = (GtkEntry*) entry; } void ugtk_completion_form_set (struct UgtkCompletionForm* csform, UgtkSetting* setting) { if (setting->completion.command) gtk_entry_set_text (csform->command, setting->completion.command); if (setting->completion.on_error) gtk_entry_set_text (csform->command, setting->completion.on_error); } void ugtk_completion_form_get (struct UgtkCompletionForm* csform, UgtkSetting* setting) { const char* string; ug_free (setting->completion.command); string = gtk_entry_get_text (csform->command); setting->completion.command = (string[0]) ? ug_strdup (string) : NULL; ug_free (setting->completion.on_error); string = gtk_entry_get_text (csform->on_error); setting->completion.on_error = (string[0]) ? ug_strdup (string) : NULL; } // ---------------------------------------------------------------------------- // UgtkAutoSaveForm // static void on_auto_save_toggled (GtkWidget* widget, struct UgtkAutoSaveForm* asform) { gboolean sensitive; sensitive = gtk_toggle_button_get_active (asform->enable); gtk_widget_set_sensitive (asform->interval_label, sensitive); gtk_widget_set_sensitive ((GtkWidget*) asform->interval_spin, sensitive); gtk_widget_set_sensitive (asform->minutes_label, sensitive); } void ugtk_auto_save_form_init (struct UgtkAutoSaveForm* asform) { GtkBox* hbox; GtkWidget* widget; asform->self = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); hbox = (GtkBox*) asform->self; widget = gtk_check_button_new_with_mnemonic (_("_Autosave")); gtk_box_pack_start (hbox, widget, FALSE, FALSE, 0); g_signal_connect (widget, "toggled", G_CALLBACK (on_auto_save_toggled), asform); asform->enable = (GtkToggleButton*) widget; // space widget = gtk_label_new (""); gtk_box_pack_start (hbox, widget, FALSE, FALSE, 30); // auto save interval label widget = gtk_label_new_with_mnemonic (_("_Interval:")); gtk_box_pack_start (hbox, widget, FALSE, FALSE, 2); asform->interval_label = widget; gtk_label_set_mnemonic_widget (GTK_LABEL (asform->interval_label), (GtkWidget*) asform->interval_spin); // auto save interval spin widget = gtk_spin_button_new_with_range (1.0, 120.0, 1.0); gtk_entry_set_activates_default (GTK_ENTRY (widget), TRUE); gtk_box_pack_start (hbox, widget, FALSE, FALSE, 2); asform->interval_spin = (GtkSpinButton*) widget; // auto save interval unit label widget = gtk_label_new_with_mnemonic (_("minutes")); gtk_box_pack_start (hbox, widget, FALSE, FALSE, 2); asform->minutes_label = widget; } void ugtk_auto_save_form_set (struct UgtkAutoSaveForm* asform, UgtkSetting* setting) { gtk_toggle_button_set_active (asform->enable, setting->auto_save.enable); gtk_spin_button_set_value (asform->interval_spin, (gdouble) setting->auto_save.interval); gtk_toggle_button_toggled (asform->enable); // on_auto_save_toggled ((GtkWidget*) asform->enable, asform); } void ugtk_auto_save_form_get (struct UgtkAutoSaveForm* asform, UgtkSetting* setting) { setting->auto_save.enable = gtk_toggle_button_get_active (asform->enable); setting->auto_save.interval = gtk_spin_button_get_value_as_int (asform->interval_spin); } // ---------------------------------------------------------------------------- // UgtkCommandlineForm // void ugtk_commandline_form_init (struct UgtkCommandlineForm* clform) { GtkWidget* widget; GtkBox* vbox; GtkBox* hbox; // Commandline Settings widget = gtk_frame_new (_("Commandline Settings")); clform->self = widget; vbox = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_add (GTK_CONTAINER (widget), (GtkWidget*) vbox); gtk_container_set_border_width (GTK_CONTAINER (vbox), 2); // --quiet widget = gtk_check_button_new_with_mnemonic (_("Use '--quiet' by default")); gtk_box_pack_start (vbox, widget, FALSE, FALSE, 1); clform->quiet = (GtkToggleButton*) widget; // --category-index hbox = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); gtk_box_pack_start (vbox, (GtkWidget*) hbox, FALSE, FALSE, 2); widget = gtk_label_new (_("Default category index")); gtk_box_pack_start (hbox, widget, FALSE, FALSE, 2); clform->index_label = widget; widget = gtk_spin_button_new_with_range (0.0, 1000.0, 1.0); gtk_entry_set_activates_default (GTK_ENTRY (widget), TRUE); gtk_box_pack_start (hbox, widget, FALSE, FALSE, 2); clform->index_spin = (GtkSpinButton*) widget; // hint hbox = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); gtk_box_pack_start (vbox, (GtkWidget*) hbox, FALSE, FALSE, 2); widget = gtk_label_new (" - "); gtk_box_pack_start (hbox, widget, FALSE, FALSE, 0); widget = gtk_label_new (_("Adding to Nth category if no matched category.")); gtk_box_pack_start (hbox, widget, FALSE, FALSE, 0); } void ugtk_commandline_form_set (struct UgtkCommandlineForm* clform, UgtkSetting* setting) { gtk_toggle_button_set_active (clform->quiet, setting->commandline.quiet); gtk_spin_button_set_value (clform->index_spin, setting->commandline.nth_category); } void ugtk_commandline_form_get (struct UgtkCommandlineForm* clform, UgtkSetting* setting) { setting->commandline.quiet = gtk_toggle_button_get_active (clform->quiet); setting->commandline.nth_category = gtk_spin_button_get_value_as_int (clform->index_spin); } // ---------------------------------------------------------------------------- // UgtkPluginForm // static void on_plugin_launch_toggled (GtkWidget* widget, struct UgtkPluginForm* psform) { gboolean sensitive; sensitive = gtk_toggle_button_get_active (psform->launch); gtk_widget_set_sensitive ((GtkWidget*) psform->local, sensitive); } static void on_order_changed (GtkComboBox* widget, struct UgtkPluginForm* psform) { int index; index = gtk_combo_box_get_active (widget); if (index >= UGTK_PLUGIN_ORDER_ARIA2) gtk_widget_set_sensitive (psform->aria2_opts, TRUE); else gtk_widget_set_sensitive (psform->aria2_opts, FALSE); } void ugtk_plugin_form_init (struct UgtkPluginForm* psform) { PangoContext* context; PangoLayout* layout; int text_height; GtkBox* vbox; GtkBox* hbox; GtkBox* box; GtkWidget* widget; GtkScrolledWindow* scroll; psform->self = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); vbox = (GtkBox*) psform->self; hbox = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); gtk_box_pack_start (vbox, (GtkWidget*) hbox, FALSE, TRUE, 2); widget = gtk_label_new (_("Plug-in matching order:")); gtk_box_pack_start (hbox, widget, FALSE, FALSE, 0); widget = gtk_combo_box_text_new (); psform->order = (GtkComboBoxText*) widget; gtk_combo_box_text_insert_text (psform->order, UGTK_PLUGIN_ORDER_CURL, "curl"); gtk_combo_box_text_insert_text (psform->order, UGTK_PLUGIN_ORDER_ARIA2, "aria2"); gtk_combo_box_text_insert_text (psform->order, UGTK_PLUGIN_ORDER_CURL_ARIA2, "curl + aria2"); gtk_combo_box_text_insert_text (psform->order, UGTK_PLUGIN_ORDER_ARIA2_CURL, "aria2 + curl"); g_signal_connect (psform->order, "changed", G_CALLBACK (on_order_changed), psform); gtk_box_pack_start (hbox, widget, FALSE, FALSE, 4); widget = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_box_pack_start (vbox, widget, TRUE, TRUE, 2); psform->aria2_opts = widget; vbox = (GtkBox*) widget; hbox = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); gtk_box_pack_start (vbox, (GtkWidget*) hbox, FALSE, TRUE, 4); widget = gtk_label_new (_("Aria2 plug-in options")); gtk_box_pack_start (hbox, widget, FALSE, FALSE, 0); gtk_box_pack_start (hbox, gtk_separator_new (GTK_ORIENTATION_HORIZONTAL), TRUE, TRUE, 4); // URI entry hbox = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); gtk_box_pack_start (vbox, (GtkWidget*) hbox, FALSE, TRUE, 2); widget = gtk_label_new (_("URI")); gtk_box_pack_start (hbox, widget, FALSE, FALSE, 2); widget = gtk_entry_new (); gtk_entry_set_activates_default (GTK_ENTRY (widget), TRUE); gtk_box_pack_start (hbox, widget, TRUE, TRUE, 4); psform->uri = (GtkEntry*) widget; // Token entry hbox = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); gtk_box_pack_start (vbox, (GtkWidget*) hbox, FALSE, TRUE, 2); widget = gtk_label_new (_("RPC authorization secret token")); gtk_box_pack_start (hbox, widget, FALSE, FALSE, 2); widget = gtk_entry_new (); gtk_entry_set_activates_default (GTK_ENTRY (widget), TRUE); gtk_box_pack_start (hbox, widget, TRUE, TRUE, 4); psform->token = (GtkEntry*) widget; // ------------------------------------------------------------------------ // Speed Limits widget = gtk_frame_new (_("Global speed limit for aria2 only")); gtk_box_pack_start (vbox, widget, FALSE, FALSE, 4); box = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_add (GTK_CONTAINER (widget), (GtkWidget*) box); gtk_container_set_border_width (GTK_CONTAINER (box), 2); // Max upload speed hbox = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); gtk_box_pack_start (box, (GtkWidget*) hbox, FALSE, FALSE, 2); widget = gtk_label_new (_("Max upload speed")); gtk_box_pack_start (hbox, widget, FALSE, FALSE, 2); widget = gtk_label_new (_("KiB/s")); gtk_box_pack_end (hbox, widget, FALSE, FALSE, 2); widget = gtk_spin_button_new_with_range (0.0, 4000000000.0, 5.0); gtk_entry_set_width_chars (GTK_ENTRY (widget), 15); gtk_entry_set_activates_default (GTK_ENTRY (widget), TRUE); gtk_box_pack_end (hbox, widget, FALSE, FALSE, 2); psform->upload = (GtkSpinButton*) widget; // Max download speed hbox = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); gtk_box_pack_start (box, (GtkWidget*) hbox, FALSE, FALSE, 2); widget = gtk_label_new (_("Max download speed")); gtk_box_pack_start (hbox, widget, FALSE, FALSE, 2); widget = gtk_label_new (_("KiB/s")); gtk_box_pack_end (hbox, widget, FALSE, FALSE, 2); widget = gtk_spin_button_new_with_range (0.0, 4000000000.0, 5.0); gtk_entry_set_width_chars (GTK_ENTRY (widget), 15); gtk_entry_set_activates_default (GTK_ENTRY (widget), TRUE); gtk_box_pack_end (hbox, widget, FALSE, FALSE, 2); psform->download = (GtkSpinButton*) widget; // ------------------------------------------------------------------------ // aria2 works on local device // launch widget = gtk_check_button_new_with_mnemonic (_("_Launch aria2 on startup")); gtk_box_pack_start (vbox, widget, FALSE, FALSE, 2); g_signal_connect (widget, "toggled", G_CALLBACK (on_plugin_launch_toggled), psform); psform->launch = (GtkToggleButton*) widget; // shutdown widget = gtk_check_button_new_with_mnemonic (_("_Shutdown aria2 on exit")); gtk_box_pack_start (vbox, widget, FALSE, FALSE, 2); psform->shutdown = (GtkToggleButton*) widget; // ------------------------------------------------------------------------ // Local options widget = gtk_frame_new (_("Launch aria2 on local device")); gtk_box_pack_start (vbox, widget, FALSE, FALSE, 4); psform->local = widget; box = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_add (GTK_CONTAINER (widget), (GtkWidget*) box); gtk_container_set_border_width (GTK_CONTAINER (box), 2); // Path hbox = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); gtk_box_pack_start (box, (GtkWidget*) hbox, FALSE, TRUE, 4); widget = gtk_label_new (_("Path")); gtk_box_pack_start (hbox, widget, FALSE, FALSE, 2); widget = gtk_entry_new (); gtk_entry_set_activates_default (GTK_ENTRY (widget), TRUE); gtk_box_pack_start (hbox, widget, TRUE, TRUE, 2); psform->path = (GtkEntry*) widget; // gtk_box_pack_start (box, gtk_label_new (""), FALSE, FALSE, 0); // Arguments // get text height --- begin --- context = gtk_widget_get_pango_context (widget); layout = pango_layout_new (context); pango_layout_set_text (layout, "joIN", -1); pango_layout_get_pixel_size (layout, NULL, &text_height); g_object_unref (layout); // get text height --- end --- hbox = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); gtk_box_pack_start (box, (GtkWidget*) hbox, FALSE, TRUE, 2); widget = gtk_label_new (_("Arguments")); gtk_box_pack_start (hbox, widget, FALSE, FALSE, 2); widget = gtk_label_new (" - "); gtk_box_pack_start (hbox, widget, FALSE, FALSE, 0); // Arguments - hint widget = gtk_label_new (_("You must restart uGet after modifying it.")); gtk_box_pack_start (hbox, widget, FALSE, FALSE, 0); // Arguments - Scrolled Window scroll = (GtkScrolledWindow*) gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (scroll, GTK_SHADOW_IN); gtk_widget_set_size_request (GTK_WIDGET (scroll), 100, text_height * 3); gtk_box_pack_start (box, GTK_WIDGET (scroll), FALSE, TRUE, 2); // Arguments - text view psform->args_buffer = gtk_text_buffer_new (NULL); psform->args = gtk_text_view_new_with_buffer (psform->args_buffer); g_object_unref (psform->args_buffer); gtk_text_view_set_wrap_mode ((GtkTextView*) psform->args, GTK_WRAP_CHAR); gtk_container_add (GTK_CONTAINER (scroll), GTK_WIDGET (psform->args)); // ------------------------------------------------------------------------ on_plugin_launch_toggled ((GtkWidget*) psform->launch, psform); gtk_widget_show (psform->self); } void ugtk_plugin_form_set (struct UgtkPluginForm* psform, UgtkSetting* setting) { gtk_combo_box_set_active ((GtkComboBox*) psform->order, setting->plugin_order); gtk_toggle_button_set_active (psform->launch, setting->aria2.launch); gtk_toggle_button_set_active (psform->shutdown, setting->aria2.shutdown); if (setting->aria2.uri) gtk_entry_set_text (psform->uri, setting->aria2.uri); if (setting->aria2.token) gtk_entry_set_text (psform->token, setting->aria2.token); if (setting->aria2.path) gtk_entry_set_text (psform->path, setting->aria2.path); // if (setting->aria2.args) // gtk_entry_set_text (psform->args, setting->aria2.args); if (setting->aria2.args) gtk_text_buffer_set_text (psform->args_buffer, setting->aria2.args, -1); gtk_spin_button_set_value (psform->upload, setting->aria2.limit.upload); gtk_spin_button_set_value (psform->download, setting->aria2.limit.download); } void ugtk_plugin_form_get (struct UgtkPluginForm* psform, UgtkSetting* setting) { GtkTextIter iter1; GtkTextIter iter2; const char* token; setting->plugin_order = gtk_combo_box_get_active ((GtkComboBox*) psform->order); setting->aria2.launch = gtk_toggle_button_get_active (psform->launch); setting->aria2.shutdown = gtk_toggle_button_get_active (psform->shutdown); ug_free (setting->aria2.uri); ug_free (setting->aria2.token); ug_free (setting->aria2.path); ug_free (setting->aria2.args); setting->aria2.uri = ug_strdup (gtk_entry_get_text (psform->uri)); token = gtk_entry_get_text (psform->token); if (token[0] == 0) setting->aria2.token = NULL; else setting->aria2.token = ug_strdup (token); setting->aria2.path = ug_strdup (gtk_entry_get_text (psform->path)); // setting->aria2.args = ug_strdup (gtk_entry_get_text (psform->args)); gtk_text_buffer_get_start_iter (psform->args_buffer, &iter1); gtk_text_buffer_get_end_iter (psform->args_buffer, &iter2); setting->aria2.args = gtk_text_buffer_get_text (psform->args_buffer, &iter1, &iter2, FALSE); ug_str_remove_crlf (setting->aria2.args, setting->aria2.args); setting->aria2.limit.upload = (guint) gtk_spin_button_get_value (psform->upload); setting->aria2.limit.download = (guint) gtk_spin_button_get_value (psform->download); } // ---------------------------------------------------------------------------- // UgtkMediaWebsiteForm // static void on_match_mode_changed (GtkComboBox* widget, struct UgtkMediaWebsiteForm* mwform) { gboolean sensitive; int index; index = gtk_combo_box_get_active (widget); if (index == UGET_MEDIA_MATCH_0) sensitive = FALSE; else sensitive = TRUE; gtk_widget_set_sensitive ((GtkWidget*) mwform->quality, sensitive); gtk_widget_set_sensitive ((GtkWidget*) mwform->type, sensitive); } void ugtk_media_website_form_init (struct UgtkMediaWebsiteForm* mwform) { GtkBox* vbox; GtkBox* hbox; GtkWidget* widget; GtkGrid* grid; mwform->self = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); vbox = (GtkBox*) mwform->self; hbox = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); gtk_box_pack_start (vbox, (GtkWidget*) hbox, FALSE, TRUE, 2); widget = gtk_label_new (_("Media matching mode:")); gtk_box_pack_start (hbox, widget, FALSE, FALSE, 0); widget = gtk_combo_box_text_new (); mwform->match_mode = (GtkComboBoxText*) widget; gtk_combo_box_text_insert_text (mwform->match_mode, UGET_MEDIA_MATCH_0, _("Don't match")); gtk_combo_box_text_insert_text (mwform->match_mode, UGET_MEDIA_MATCH_1, _("Match 1 condition")); gtk_combo_box_text_insert_text (mwform->match_mode, UGET_MEDIA_MATCH_2, _("Match 2 condition")); gtk_combo_box_text_insert_text (mwform->match_mode, UGET_MEDIA_MATCH_NEAR, _("Near quality")); g_signal_connect (mwform->match_mode, "changed", G_CALLBACK (on_match_mode_changed), mwform); gtk_box_pack_start (hbox, widget, FALSE, FALSE, 4); hbox = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); gtk_box_pack_start (vbox, (GtkWidget*) hbox, FALSE, TRUE, 4); widget = gtk_label_new (_("Match conditions")); gtk_box_pack_start (hbox, widget, FALSE, FALSE, 0); gtk_box_pack_start (hbox, gtk_separator_new (GTK_ORIENTATION_HORIZONTAL), TRUE, TRUE, 4); // conditions grid = (GtkGrid*) gtk_grid_new (); gtk_box_pack_start (vbox, (GtkWidget*) grid, FALSE, FALSE, 0); // Quality widget = gtk_label_new (_("Quality:")); g_object_set (widget, "margin-left", 3, "margin-right", 3, NULL); g_object_set (widget, "margin-top", 2, "margin-bottom", 2, NULL); gtk_grid_attach (grid, widget, 0, 0, 1, 1); widget = gtk_combo_box_text_new (); mwform->quality = (GtkComboBoxText*) widget; gtk_combo_box_text_insert_text (mwform->quality, UGET_MEDIA_QUALITY_240P, "240p"); gtk_combo_box_text_insert_text (mwform->quality, UGET_MEDIA_QUALITY_360P, "360p"); gtk_combo_box_text_insert_text (mwform->quality, UGET_MEDIA_QUALITY_480P, "480p"); gtk_combo_box_text_insert_text (mwform->quality, UGET_MEDIA_QUALITY_720P, "720p"); gtk_combo_box_text_insert_text (mwform->quality, UGET_MEDIA_QUALITY_1080P, "1080p"); g_object_set (widget, "margin-left", 3, "margin-right", 3, NULL); g_object_set (widget, "margin-top", 2, "margin-bottom", 2, NULL); gtk_grid_attach (grid, widget, 1, 0, 1, 1); // Type widget = gtk_label_new (_("Type:")); g_object_set (widget, "margin-left", 3, "margin-right", 3, NULL); g_object_set (widget, "margin-top", 2, "margin-bottom", 2, NULL); gtk_grid_attach (grid, widget, 0, 1, 1, 1); widget = gtk_combo_box_text_new (); mwform->type = (GtkComboBoxText*) widget; gtk_combo_box_text_insert_text (mwform->type, UGET_MEDIA_TYPE_MP4, "mp4"); gtk_combo_box_text_insert_text (mwform->type, UGET_MEDIA_TYPE_WEBM, "webm"); gtk_combo_box_text_insert_text (mwform->type, UGET_MEDIA_TYPE_3GPP, "3gpp"); gtk_combo_box_text_insert_text (mwform->type, UGET_MEDIA_TYPE_FLV, "flv"); g_object_set (widget, "margin-left", 3, "margin-right", 3, NULL); g_object_set (widget, "margin-top", 2, "margin-bottom", 2, NULL); gtk_grid_attach (grid, widget, 1, 1, 1, 1); gtk_widget_show (mwform->self); } void ugtk_media_website_form_set (struct UgtkMediaWebsiteForm* mwform, UgtkSetting* setting) { gtk_combo_box_set_active ((GtkComboBox*) mwform->match_mode, setting->media.match_mode); gtk_combo_box_set_active ((GtkComboBox*) mwform->quality, setting->media.quality); gtk_combo_box_set_active ((GtkComboBox*) mwform->type, setting->media.type); } void ugtk_media_website_form_get (struct UgtkMediaWebsiteForm* mwform, UgtkSetting* setting) { setting->media.match_mode = gtk_combo_box_get_active ((GtkComboBox*) mwform->match_mode); setting->media.quality = gtk_combo_box_get_active ((GtkComboBox*) mwform->quality); setting->media.type = gtk_combo_box_get_active ((GtkComboBox*) mwform->type); } uget-2.2.0/ui-gtk/UgtkSetting.c0000644000175000000120000006156013224532612013212 00000000000000/* * * Copyright (C) 2012-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #include #include #include #include #include #include #define UGTK_APP_CLIPBOARD_PATTERN "BIN|ZIP|GZ|7Z|XZ|Z|TAR|TGZ|BZ2|" \ "LZH|A[0-9]?|RAR|R[0-9][0-9]|ISO|" \ "RPM|DEB|EXE|MSI|APK|" \ "3GP|AAC|FLAC|M4A|M4P|MP3|OGG|WAV|WMA|" \ "MP4|MKV|WEBM|OGV|AVI|MOV|WMV|FLV|F4V|MPG|MPEG|RMVB" #define UGTK_ARIA2_PATH "aria2c" #define UGTK_ARIA2_ARGS "--enable-rpc=true -D " \ "--disable-ipv6 " \ "--check-certificate=false" #define UGTK_ARIA2_URI "http://localhost:6800/jsonrpc" // ---------------------------------------------------------------------------- // WindowSetting static const UgEntry UgtkWindowSettingEntry[] = { {"Toolbar", offsetof (struct UgtkWindowSetting, toolbar), UG_ENTRY_BOOL, NULL, NULL}, {"Statusbar", offsetof (struct UgtkWindowSetting, statusbar), UG_ENTRY_BOOL, NULL, NULL}, {"Category", offsetof (struct UgtkWindowSetting, category), UG_ENTRY_BOOL, NULL, NULL}, {"Summary", offsetof (struct UgtkWindowSetting, summary), UG_ENTRY_BOOL, NULL, NULL}, {"Banner", offsetof (struct UgtkWindowSetting, banner), UG_ENTRY_BOOL, NULL, NULL}, {"x", offsetof (struct UgtkWindowSetting, x), UG_ENTRY_INT, NULL, NULL}, {"y", offsetof (struct UgtkWindowSetting, y), UG_ENTRY_INT, NULL, NULL}, {"width", offsetof (struct UgtkWindowSetting, width), UG_ENTRY_INT, NULL, NULL}, {"height", offsetof (struct UgtkWindowSetting, height), UG_ENTRY_INT, NULL, NULL}, {"maximized", offsetof (struct UgtkWindowSetting, maximized), UG_ENTRY_BOOL, NULL, NULL}, {"NthCategory", offsetof (struct UgtkWindowSetting, nth_category), UG_ENTRY_INT, NULL, NULL}, {"NthStatus", offsetof (struct UgtkWindowSetting, nth_state), UG_ENTRY_INT, NULL, NULL}, {"PanedPositionH", offsetof (struct UgtkWindowSetting, paned_position_h), UG_ENTRY_INT, NULL, NULL}, {"PanedPositionV", offsetof (struct UgtkWindowSetting, paned_position_v), UG_ENTRY_INT, NULL, NULL}, {NULL}, // null-terminated }; // ---------------------------------------------------------------------------- // SummarySetting static const UgEntry UgtkSummarySettingEntry[] = { {"name", offsetof (struct UgtkSummarySetting, name), UG_ENTRY_BOOL, NULL, NULL}, {"folder", offsetof (struct UgtkSummarySetting, folder), UG_ENTRY_BOOL, NULL, NULL}, {"category", offsetof (struct UgtkSummarySetting, category), UG_ENTRY_BOOL, NULL, NULL}, {"uri", offsetof (struct UgtkSummarySetting, uri), UG_ENTRY_BOOL, NULL, NULL}, {"message", offsetof (struct UgtkSummarySetting, message), UG_ENTRY_BOOL, NULL, NULL}, {NULL} // null-terminated }; // ---------------------------------------------------------------------------- // DownloadColumnSetting static const UgEntry UgtkDownloadColumnWidthEntry[] = { {"state", offsetof (struct UgtkDownloadColumnWidth, state), UG_ENTRY_INT, NULL, NULL}, {"name", offsetof (struct UgtkDownloadColumnWidth, name), UG_ENTRY_INT, NULL, NULL}, {"complete", offsetof (struct UgtkDownloadColumnWidth, complete), UG_ENTRY_INT, NULL, NULL}, {"total", offsetof (struct UgtkDownloadColumnWidth, total), UG_ENTRY_INT, NULL, NULL}, {"percent", offsetof (struct UgtkDownloadColumnWidth, percent), UG_ENTRY_INT, NULL, NULL}, {"elapsed", offsetof (struct UgtkDownloadColumnWidth, elapsed), UG_ENTRY_INT, NULL, NULL}, {"left", offsetof (struct UgtkDownloadColumnWidth, left), UG_ENTRY_INT, NULL, NULL}, {"speed", offsetof (struct UgtkDownloadColumnWidth, speed), UG_ENTRY_INT, NULL, NULL}, {"UploadSpeed", offsetof (struct UgtkDownloadColumnWidth, upload_speed), UG_ENTRY_INT, NULL, NULL}, {"uploaded", offsetof (struct UgtkDownloadColumnWidth, uploaded), UG_ENTRY_INT, NULL, NULL}, {"ratio", offsetof (struct UgtkDownloadColumnWidth, ratio), UG_ENTRY_INT, NULL, NULL}, {"retry", offsetof (struct UgtkDownloadColumnWidth, retry), UG_ENTRY_INT, NULL, NULL}, {"category", offsetof (struct UgtkDownloadColumnWidth, category), UG_ENTRY_INT, NULL, NULL}, {"uri", offsetof (struct UgtkDownloadColumnWidth, uri), UG_ENTRY_INT, NULL, NULL}, {"AddedOn", offsetof (struct UgtkDownloadColumnWidth, added_on), UG_ENTRY_INT, NULL, NULL}, {"CompletedOn", offsetof (struct UgtkDownloadColumnWidth, completed_on), UG_ENTRY_INT, NULL, NULL}, {NULL} // null-terminated }; static const UgEntry UgtkDownloadColumnSettingEntry[] = { {"complete", offsetof (struct UgtkDownloadColumnSetting, complete), UG_ENTRY_BOOL, NULL, NULL}, {"total", offsetof (struct UgtkDownloadColumnSetting, total), UG_ENTRY_BOOL, NULL, NULL}, {"percent", offsetof (struct UgtkDownloadColumnSetting, percent), UG_ENTRY_BOOL, NULL, NULL}, {"elapsed", offsetof (struct UgtkDownloadColumnSetting, elapsed), UG_ENTRY_BOOL, NULL, NULL}, {"left", offsetof (struct UgtkDownloadColumnSetting, left), UG_ENTRY_BOOL, NULL, NULL}, {"speed", offsetof (struct UgtkDownloadColumnSetting, speed), UG_ENTRY_BOOL, NULL, NULL}, {"UploadSpeed", offsetof (struct UgtkDownloadColumnSetting, upload_speed), UG_ENTRY_BOOL, NULL, NULL}, {"uploaded", offsetof (struct UgtkDownloadColumnSetting, uploaded), UG_ENTRY_BOOL, NULL, NULL}, {"ratio", offsetof (struct UgtkDownloadColumnSetting, ratio), UG_ENTRY_BOOL, NULL, NULL}, {"retry", offsetof (struct UgtkDownloadColumnSetting, retry), UG_ENTRY_BOOL, NULL, NULL}, {"category", offsetof (struct UgtkDownloadColumnSetting, category), UG_ENTRY_BOOL, NULL, NULL}, {"uri", offsetof (struct UgtkDownloadColumnSetting, uri), UG_ENTRY_BOOL, NULL, NULL}, {"AddedOn", offsetof (struct UgtkDownloadColumnSetting, added_on), UG_ENTRY_BOOL, NULL, NULL}, {"CompletedOn", offsetof (struct UgtkDownloadColumnSetting, completed_on), UG_ENTRY_BOOL, NULL, NULL}, {"SortType", offsetof (struct UgtkDownloadColumnSetting, sort.type), UG_ENTRY_INT, NULL, NULL}, {"SortNth", offsetof (struct UgtkDownloadColumnSetting, sort.nth), UG_ENTRY_INT, NULL, NULL}, {"Width", offsetof (struct UgtkDownloadColumnSetting, width), UG_ENTRY_OBJECT, (void*) UgtkDownloadColumnWidthEntry, NULL}, // deprecated {"completed", offsetof (struct UgtkDownloadColumnSetting, complete), UG_ENTRY_BOOL, NULL, NULL}, {NULL} // null-terminated }; // ---------------------------------------------------------------------------- // UserInterfaceSetting static const UgEntry UgtkUserInterfaceSettingEntry[] = { {"ExitConfirmation", offsetof (struct UgtkUserInterfaceSetting, exit_confirmation), UG_ENTRY_BOOL, NULL, NULL}, {"DeleteConfirmation", offsetof (struct UgtkUserInterfaceSetting, delete_confirmation), UG_ENTRY_BOOL, NULL, NULL}, {"ShowTrayIcon", offsetof (struct UgtkUserInterfaceSetting, show_trayicon), UG_ENTRY_BOOL, NULL, NULL}, {"StartInTray", offsetof (struct UgtkUserInterfaceSetting, start_in_tray), UG_ENTRY_BOOL, NULL, NULL}, {"CloseToTray", offsetof (struct UgtkUserInterfaceSetting, close_to_tray), UG_ENTRY_BOOL, NULL, NULL}, {"StartInOfflineMode", offsetof (struct UgtkUserInterfaceSetting, start_in_offline_mode), UG_ENTRY_BOOL, NULL, NULL}, {"StartNotification", offsetof (struct UgtkUserInterfaceSetting, start_notification), UG_ENTRY_BOOL, NULL, NULL}, {"SoundNotification", offsetof (struct UgtkUserInterfaceSetting, sound_notification), UG_ENTRY_BOOL, NULL, NULL}, {"ApplyRecently", offsetof (struct UgtkUserInterfaceSetting, apply_recent), UG_ENTRY_BOOL, NULL, NULL}, {"ApplyRecent", offsetof (struct UgtkUserInterfaceSetting, apply_recent), UG_ENTRY_BOOL, NULL, NULL}, {"SkipExisting", offsetof (struct UgtkUserInterfaceSetting, skip_existing), UG_ENTRY_BOOL, NULL, NULL}, {"LargeIcon", offsetof (struct UgtkUserInterfaceSetting, large_icon), UG_ENTRY_BOOL, NULL, NULL}, #ifdef HAVE_APP_INDICATOR {"AppIndicator", offsetof (struct UgtkUserInterfaceSetting, app_indicator), UG_ENTRY_BOOL, NULL, NULL}, #endif {NULL}, // null-terminated }; // ---------------------------------------------------------------------------- // ClipboardSetting static const UgEntry UgtkClipboardSettingEntry[] = { {"pattern", offsetof (struct UgtkClipboardSetting, pattern), UG_ENTRY_STRING, NULL, NULL}, {"monitor", offsetof (struct UgtkClipboardSetting, monitor), UG_ENTRY_BOOL, NULL, NULL}, {"quiet", offsetof (struct UgtkClipboardSetting, quiet), UG_ENTRY_BOOL, NULL, NULL}, {"NthCategory", offsetof (struct UgtkClipboardSetting, nth_category), UG_ENTRY_INT, NULL, NULL}, {"Website", offsetof (struct UgtkClipboardSetting, website), UG_ENTRY_BOOL, NULL, NULL}, // remove this in future verison {"MediaWebsite", offsetof (struct UgtkClipboardSetting, website), UG_ENTRY_BOOL, NULL, NULL}, {NULL}, // null-terminated }; // ---------------------------------------------------------------------------- // BandwidthSetting static const UgEntry UgtkBandwidthSettingEntry[] = { {"NormalUpload", offsetof (struct UgtkBandwidthSetting, normal.upload), UG_ENTRY_INT, NULL, NULL}, {"NormalDownload", offsetof (struct UgtkBandwidthSetting, normal.download), UG_ENTRY_INT, NULL, NULL}, {"SchedulerUpload", offsetof (struct UgtkBandwidthSetting, scheduler.upload), UG_ENTRY_INT, NULL, NULL}, {"SchedulerDownload", offsetof (struct UgtkBandwidthSetting, scheduler.download), UG_ENTRY_INT, NULL, NULL}, {NULL}, // null-terminated }; // ---------------------------------------------------------------------------- // SchedulerSetting static const UgEntry UgtkSchedulerSettingEntry[] = { {"enable", offsetof (struct UgtkSchedulerSetting, enable), UG_ENTRY_BOOL, NULL, NULL}, {"state", offsetof (struct UgtkSchedulerSetting, state), UG_ENTRY_ARRAY, ug_json_parse_array_int, ug_json_write_array_int}, {NULL}, // null-terminated }; // ---------------------------------------------------------------------------- // CommandlineSetting static const UgEntry UgtkCommandlineSettingEntry[] = { {"quiet", offsetof (struct UgtkCommandlineSetting, quiet), UG_ENTRY_BOOL, NULL, NULL}, {"NthCategory", offsetof (struct UgtkCommandlineSetting, nth_category), UG_ENTRY_INT, NULL, NULL}, {NULL}, // null-terminated }; // ---------------------------------------------------------------------------- // PluginAria2Setting static const UgEntry UgtkPluginAria2SettingEntry[] = { {"launch", offsetof (struct UgtkPluginAria2Setting, launch), UG_ENTRY_BOOL, NULL, NULL}, {"shutdown", offsetof (struct UgtkPluginAria2Setting, shutdown), UG_ENTRY_BOOL, NULL, NULL}, {"token", offsetof (struct UgtkPluginAria2Setting, token), UG_ENTRY_STRING, NULL, NULL}, {"path", offsetof (struct UgtkPluginAria2Setting, path), UG_ENTRY_STRING, NULL, NULL}, {"arguments", offsetof (struct UgtkPluginAria2Setting, args), UG_ENTRY_STRING, NULL, NULL}, {"uri", offsetof (struct UgtkPluginAria2Setting, uri), UG_ENTRY_STRING, NULL, NULL}, {"MaxUploadSpeed", offsetof (struct UgtkPluginAria2Setting, limit.upload), UG_ENTRY_INT, NULL, NULL}, {"MaxDownloadSpeed", offsetof (struct UgtkPluginAria2Setting, limit.download), UG_ENTRY_INT, NULL, NULL}, {NULL}, // null-terminated }; // ---------------------------------------------------------------------------- // PluginMediaSetting static const UgEntry UgtkPluginMediaSettingEntry[] = { {"match_mode", offsetof (struct UgtkPluginMediaSetting, match_mode), UG_ENTRY_INT, NULL, NULL}, {"quality", offsetof (struct UgtkPluginMediaSetting, quality), UG_ENTRY_INT, NULL, NULL}, {"type", offsetof (struct UgtkPluginMediaSetting, type), UG_ENTRY_INT, NULL, NULL}, {NULL}, // null-terminated }; // ---------------------------------------------------------------------------- // UgtkCompletionSetting static const UgEntry UgtkCompletionSettingEntry[] = { {"remember", offsetof (struct UgtkCompletionSetting, remember), UG_ENTRY_BOOL, NULL, NULL}, {"action", offsetof (struct UgtkCompletionSetting, action), UG_ENTRY_INT, NULL, NULL}, {"command", offsetof (struct UgtkCompletionSetting, command), UG_ENTRY_STRING, NULL, NULL}, {"OnError", offsetof (struct UgtkCompletionSetting, on_error), UG_ENTRY_STRING, NULL, NULL}, {NULL}, // null-terminated }; // ---------------------------------------------------------------------------- // UgtkSetting static const UgEntry UgtkSettingEntry[] = { {"Window", offsetof (UgtkSetting, window), UG_ENTRY_OBJECT, (void*) UgtkWindowSettingEntry, NULL}, {"Summary", offsetof (UgtkSetting, summary), UG_ENTRY_OBJECT, (void*) UgtkSummarySettingEntry, NULL}, {"DownloadColumn", offsetof (UgtkSetting, download_column), UG_ENTRY_OBJECT, (void*) UgtkDownloadColumnSettingEntry, NULL}, {"UserInterface", offsetof (UgtkSetting, ui), UG_ENTRY_OBJECT, (void*) UgtkUserInterfaceSettingEntry, NULL}, {"Clipboard", offsetof (UgtkSetting, clipboard), UG_ENTRY_OBJECT, (void*) UgtkClipboardSettingEntry, NULL}, {"Bandwidth", offsetof (UgtkSetting, bandwidth), UG_ENTRY_OBJECT, (void*) UgtkBandwidthSettingEntry, NULL}, {"Commandline", offsetof (UgtkSetting, commandline), UG_ENTRY_OBJECT, (void*) UgtkCommandlineSettingEntry, NULL}, {"PluginOrder", offsetof (UgtkSetting, plugin_order), UG_ENTRY_INT, NULL, NULL}, {"PluginAria2", offsetof (UgtkSetting, aria2), UG_ENTRY_OBJECT, (void*) UgtkPluginAria2SettingEntry, NULL}, {"PluginMedia", offsetof (UgtkSetting, media), UG_ENTRY_OBJECT, (void*) UgtkPluginMediaSettingEntry, NULL}, {"Completion", offsetof (UgtkSetting, completion), UG_ENTRY_OBJECT, (void*) UgtkCompletionSettingEntry, NULL}, {"FolderHistory", offsetof (UgtkSetting, folder_history), UG_ENTRY_ARRAY, ug_json_parse_list_string, ug_json_write_list_string}, {"AutoSave", offsetof (UgtkSetting, auto_save.enable), UG_ENTRY_INT, NULL, NULL}, {"AutoSaveInterval",offsetof (UgtkSetting, auto_save.interval), UG_ENTRY_INT, NULL, NULL}, // {"OfflineMode", offsetof (UgtkSetting, offline_mode), // UG_ENTRY_BOOL, NULL, NULL}, {"Scheduler", offsetof (UgtkSetting, scheduler), UG_ENTRY_OBJECT, (void*) UgtkSchedulerSettingEntry, NULL}, {NULL}, // null-terminated }; // ---------------------------------------------------------------------------- // "UgSetting" functions // void ugtk_setting_init (UgtkSetting* setting) { // "SchedulerSetting" ug_array_init (&setting->scheduler.state, sizeof (int), 7*24); memset (setting->scheduler.state.at, UGTK_SCHEDULE_NORMAL, 7*24); // default settings for media (or storage) website setting->clipboard.website = TRUE; setting->media.match_mode = UGET_MEDIA_MATCH_NEAR; setting->media.quality = UGET_MEDIA_QUALITY_360P; setting->media.type = UGET_MEDIA_TYPE_MP4; } void ugtk_setting_reset (UgtkSetting* setting) { unsigned int weekdays, dayhours; // "WindowSetting" setting->window.toolbar = TRUE; setting->window.statusbar = TRUE; setting->window.category = TRUE; setting->window.summary = TRUE; setting->window.banner = TRUE; setting->window.x = 0; setting->window.y = 0; setting->window.width = 0; setting->window.height = 0; setting->window.maximized = FALSE; setting->window.paned_position_h = -1; setting->window.paned_position_v = -1; // "SummarySetting" setting->summary.name = TRUE; setting->summary.folder = TRUE; setting->summary.category = FALSE; setting->summary.uri = FALSE; setting->summary.message = TRUE; // "DownloadColumnSetting" setting->download_column.complete = TRUE; setting->download_column.total = TRUE; setting->download_column.percent = TRUE; setting->download_column.elapsed = TRUE; setting->download_column.left = TRUE; setting->download_column.speed = TRUE; setting->download_column.upload_speed = TRUE; setting->download_column.uploaded = FALSE; setting->download_column.ratio = TRUE; setting->download_column.retry = TRUE; setting->download_column.category = FALSE; setting->download_column.uri = FALSE; setting->download_column.added_on = TRUE; setting->download_column.completed_on = FALSE; // default sorted column setting->download_column.sort.type = GTK_SORT_DESCENDING; setting->download_column.sort.nth = UGTK_NODE_COLUMN_STATE; // "DownloadColumnWidth" memset (&setting->download_column.width, 0, sizeof (setting->download_column.width)); // "UserInterfaceSetting" setting->ui.exit_confirmation = TRUE; setting->ui.delete_confirmation = TRUE; setting->ui.show_trayicon = TRUE; setting->ui.start_in_tray = FALSE; setting->ui.close_to_tray = TRUE; setting->ui.start_in_offline_mode = FALSE; setting->ui.start_notification = TRUE; setting->ui.sound_notification = TRUE; setting->ui.apply_recent = TRUE; setting->ui.skip_existing = FALSE; setting->ui.large_icon = FALSE; #ifdef HAVE_APP_INDICATOR setting->ui.app_indicator = TRUE; #endif // "ClipboardSetting" ug_free (setting->clipboard.pattern); setting->clipboard.pattern = ug_strdup (UGTK_APP_CLIPBOARD_PATTERN); setting->clipboard.monitor = TRUE; setting->clipboard.quiet = FALSE; setting->clipboard.nth_category = 0; setting->clipboard.website = TRUE; // "BandwidthSetting" setting->bandwidth.normal.upload = 0; setting->bandwidth.normal.download = 0; setting->bandwidth.scheduler.upload = 0; setting->bandwidth.scheduler.download = 0; // "SchedulerSetting" setting->scheduler.enable = FALSE; ug_array_init (&setting->scheduler.state, sizeof (int), 7*24); setting->scheduler.state.length = 7 * 24; for (weekdays = 0; weekdays < 7; weekdays++) { for (dayhours = 0; dayhours < 24; dayhours++) { setting->scheduler.state.at[weekdays*24 + dayhours] = UGTK_SCHEDULE_NORMAL; } } // "CommandlineSetting" setting->commandline.quiet = FALSE; setting->commandline.nth_category = 0; // "PluginSetting" setting->plugin_order = UGTK_PLUGIN_ORDER_CURL; // aria2 plug-in settings setting->aria2.limit.download = 0; setting->aria2.limit.upload = 0; setting->aria2.launch = TRUE; setting->aria2.shutdown = TRUE; setting->aria2.path = ug_strdup (UGTK_ARIA2_PATH); setting->aria2.args = ug_strdup (UGTK_ARIA2_ARGS); setting->aria2.uri = ug_strdup (UGTK_ARIA2_URI); // media plug-in settings setting->media.match_mode = UGET_MEDIA_MATCH_NEAR; setting->media.quality = UGET_MEDIA_QUALITY_360P; setting->media.type = UGET_MEDIA_TYPE_MP4; // Others setting->completion.remember = TRUE; setting->completion.action = 0; setting->completion.command = NULL; setting->completion.on_error = NULL; setting->auto_save.enable = TRUE; setting->auto_save.interval = 3; setting->offline_mode = FALSE; } // ---------------------------------------------------------------------------- // save/load settings int ugtk_setting_save (UgtkSetting* setting, const char* file) { int action; char* path; UgJsonFile* jfile; path = g_strconcat (file, ".temp", NULL); jfile = ug_json_file_new (4096); if (ug_json_file_begin_write (jfile, path, UG_JSON_FORMAT_ALL) == FALSE) { ug_json_file_free (jfile); g_free (path); return FALSE; } // save completion.action action = setting->completion.action; if (setting->completion.remember == FALSE) setting->completion.action = 0; ug_json_write_object_head (&jfile->json); ug_json_write_entry (&jfile->json, setting, UgtkSettingEntry); ug_json_write_object_tail (&jfile->json); // restore completion.action if (setting->completion.remember == FALSE) setting->completion.action = action; ug_json_file_end_write (jfile); ug_json_file_free (jfile); ug_remove (file); ug_rename (path, file); g_free (path); return TRUE; } int ugtk_setting_load (UgtkSetting* setting, const char* path) { int file_ok; char* path_temp; UgJsonFile* jfile; path_temp = g_strconcat (path, ".temp", NULL); jfile = ug_json_file_new (4096); file_ok = ug_json_file_begin_parse (jfile, path); if (file_ok) ug_remove (path_temp); else if (ug_rename (path_temp, path) != -1) file_ok = ug_json_file_begin_parse (jfile, path); g_free (path_temp); if (file_ok == FALSE) { ug_json_file_free (jfile); return FALSE; } ug_json_push (&jfile->json, ug_json_parse_entry, setting, (void*) UgtkSettingEntry); ug_json_push (&jfile->json, ug_json_parse_object, NULL, NULL); ug_json_file_end_parse (jfile); ug_json_file_free (jfile); // check & fix settings ugtk_setting_fix_data (setting); return TRUE; } void ugtk_setting_add_folder (UgtkSetting* setting, const char* folder) { UgList* list; UgLink* link; if (folder == NULL || folder[0] == 0) return; list = &setting->folder_history; for (link = list->head; link; link = link->next) { if (strcmp (folder, link->data) == 0) { ug_list_remove (list, link); ug_list_prepend (list, link); return; } } if (list->size >= 8) { link = list->tail; ug_list_remove (list, link); ug_free (link->data); ug_link_free (link); } link = ug_link_new (); link->data = ug_strdup (folder); ug_list_prepend (list, link); } void ugtk_setting_fix_data (UgtkSetting* setting) { unsigned int index; // "DownloadColumnSetting" // default sorted column if (setting->download_column.sort.type != GTK_SORT_ASCENDING && setting->download_column.sort.type != GTK_SORT_DESCENDING) { setting->download_column.sort.type = GTK_SORT_DESCENDING; } if (setting->download_column.sort.nth < 0 || setting->download_column.sort.nth >= UGTK_NODE_N_COLUMNS) { setting->download_column.sort.nth = UGTK_NODE_COLUMN_ADDED_ON; } // "ClipboardSetting" if (setting->clipboard.pattern == NULL || setting->clipboard.pattern[0] == 0) { ug_free (setting->clipboard.pattern); setting->clipboard.pattern = ug_strdup (UGTK_APP_CLIPBOARD_PATTERN); } // "SchedulerSetting" for (index = 0; index < 7*24; index++) { if (setting->scheduler.state.at[index] < 0 || setting->scheduler.state.at[index] >= UGTK_SCHEDULE_N_STATE) { setting->scheduler.state.at[index] = UGTK_SCHEDULE_NORMAL; } } // "PluginSetting" if (setting->plugin_order < 0 || setting->plugin_order >= UGTK_PLUGIN_N_ORDER) { setting->plugin_order = UGTK_PLUGIN_ORDER_CURL; } // aria2 plug-in settings if (setting->aria2.path == NULL || setting->aria2.path[0] == 0) { ug_free (setting->aria2.path); setting->aria2.path = ug_strdup (UGTK_ARIA2_PATH); } if (setting->aria2.args == NULL || setting->aria2.args[0] == 0) { ug_free (setting->aria2.args); setting->aria2.args = ug_strdup (UGTK_ARIA2_ARGS); } if (setting->aria2.uri == NULL || setting->aria2.uri[0] == 0) { ug_free (setting->aria2.uri); setting->aria2.uri = ug_strdup (UGTK_ARIA2_URI); } // media plug-in settings if (setting->media.match_mode < 0 || setting->media.match_mode > UGET_MEDIA_N_MATCH_MODE) setting->media.match_mode = UGET_MEDIA_MATCH_NEAR; if (setting->media.quality < 0 || setting->media.quality > UGET_MEDIA_N_QUALITY) setting->media.quality = UGET_MEDIA_QUALITY_360P; if (setting->media.type < 0 || setting->media.type > UGET_MEDIA_N_TYPE) setting->media.type = UGET_MEDIA_TYPE_MP4; } uget-2.2.0/ui-gtk/UgtkScheduleForm.c0000644000175000000120000003603513224532612014154 00000000000000/* * * Copyright (C) 2005-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #include #include #include #define COLOR_DISABLE_R 0.5 #define COLOR_DISABLE_G 0.5 #define COLOR_DISABLE_B 0.5 static const gdouble colors[UGTK_SCHEDULE_N_STATE][3] = { {1.0, 1.0, 1.0}, // UGTK_SCHEDULE_TURN_OFF {1.0, 0.752, 0.752}, // UGTK_SCHEDULE_UPLOAD_ONLY - reserve {0.552, 0.807, 0.552}, // UGTK_SCHEDULE_LIMITED_SPEED // {0.0, 0.658, 0.0}, // UGTK_SCHEDULE_NORMAL {0.0, 0.758, 0.0}, // UGTK_SCHEDULE_NORMAL }; static const gchar* week_days[7] = { N_("Mon"), N_("Tue"), N_("Wed"), N_("Thu"), N_("Fri"), N_("Sat"), N_("Sun"), }; // UgtkGrid static struct { int width; int height; int width_and_line; int height_and_line; int width_all; int height_all; } UgtkGrid; static void ugtk_grid_global_init (int width, int height); static GtkWidget* ugtk_grid_new (const gdouble* rgb_array); static gboolean ugtk_grid_draw (GtkWidget* widget, cairo_t* cr, const gdouble* rgb_array); // signal handler static void on_enable_toggled (GtkToggleButton* togglebutton, struct UgtkScheduleForm* sform); static gboolean on_draw_callback (GtkWidget* widget, cairo_t* cr, struct UgtkScheduleForm* sform); static gboolean on_button_press_event (GtkWidget* widget, GdkEventMotion* event, struct UgtkScheduleForm* sform); static gboolean on_motion_notify_event (GtkWidget* widget, GdkEventMotion* event, struct UgtkScheduleForm* sform); static gboolean on_leave_notify_event (GtkWidget* menu, GdkEventCrossing* event, struct UgtkScheduleForm* sform); void ugtk_schedule_form_init (struct UgtkScheduleForm* sform) { PangoContext* context; PangoLayout* layout; GtkWidget* widget; GtkGrid* caption; GtkBox* hbox; GtkBox* vbox; int text_width, text_height; sform->self = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); vbox = (GtkBox*) sform->self; // Enable Scheduler hbox = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); gtk_box_pack_start (vbox, (GtkWidget*)hbox, FALSE, FALSE, 2); widget = gtk_check_button_new_with_mnemonic (_("_Enable Scheduler")); gtk_box_pack_start (hbox, widget, FALSE, FALSE, 2); gtk_box_pack_start (hbox, gtk_separator_new (GTK_ORIENTATION_HORIZONTAL), TRUE, TRUE, 2); g_signal_connect (widget, "toggled", G_CALLBACK (on_enable_toggled), sform); sform->enable = widget; // initialize UgtkGrid context = gtk_widget_get_pango_context (widget); layout = pango_layout_new (context); pango_layout_set_text (layout, gettext (week_days[0]), -1); pango_layout_get_pixel_size (layout, &text_width, &text_height); g_object_unref (layout); ugtk_grid_global_init (text_height, text_height + 2); // drawing area widget = gtk_drawing_area_new (); gtk_box_pack_start (vbox, widget, FALSE, FALSE, 2); // gtk_widget_set_has_window (widget, FALSE); gtk_widget_set_size_request (widget, UgtkGrid.width_all + text_width + 32, UgtkGrid.height_all); gtk_widget_add_events (widget, GDK_BUTTON_PRESS_MASK | GDK_POINTER_MOTION_MASK | GDK_LEAVE_NOTIFY_MASK); g_signal_connect (widget, "draw", G_CALLBACK (on_draw_callback), sform); g_signal_connect (widget, "button-press-event", G_CALLBACK (on_button_press_event), sform); g_signal_connect (widget, "motion-notify-event", G_CALLBACK (on_motion_notify_event), sform); g_signal_connect (widget, "leave-notify-event", G_CALLBACK (on_leave_notify_event), sform); sform->drawing = widget; // grid for tips, SpinButton sform->caption = gtk_grid_new (); gtk_box_pack_start (vbox, sform->caption, FALSE, FALSE, 2); // gtk_container_set_border_width (GTK_CONTAINER (sform->caption), 10); caption = (GtkGrid*) sform->caption; // time tips widget = gtk_label_new (""); gtk_misc_set_alignment (GTK_MISC (widget), (gfloat)0.4, (gfloat)0.5); // left, center g_object_set (widget, "margin", 2, NULL); gtk_grid_attach (caption, widget, 0, 0, 5, 1); sform->time_tips = GTK_LABEL (widget); // Turn off widget = ugtk_grid_new (colors[UGTK_SCHEDULE_TURN_OFF]); g_object_set (widget, "margin", 3, NULL); gtk_grid_attach (caption, widget, 0, 1, 1, 1); // Turn off - label widget = gtk_label_new (_("Turn off")); gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.5); // left, center g_object_set (widget, "margin", 2, NULL); gtk_grid_attach (caption, widget, 1, 1, 1, 1); // Turn off - help label widget = gtk_label_new (_("- stop all task")); gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.5); // left, center g_object_set (widget, "margin", 2, NULL); gtk_grid_attach (caption, widget, 2, 1, 2, 1); // Normal widget = ugtk_grid_new (colors[UGTK_SCHEDULE_NORMAL]); g_object_set (widget, "margin", 3, NULL); gtk_grid_attach (caption, widget, 0, 2, 1, 1); // Normal - label widget = gtk_label_new (_("Normal")); gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.5); // left, center g_object_set (widget, "margin", 2, NULL); gtk_grid_attach (caption, widget, 1, 2, 1, 1); // Normal - help label widget = gtk_label_new (_("- run task normally")); gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.5); // left, center g_object_set (widget, "margin", 2, NULL); gtk_grid_attach (caption, widget, 2, 2, 2, 1); /* // Speed limit widget = ugtk_grid_new (colors[UGTK_SCHEDULE_LIMITED_SPEED]); g_object_set (widget, "margin", 3, NULL); gtk_grid_attach (caption, widget, 0, 3, 1, 1); // Speed limit - label widget = gtk_label_new (_("Limited speed")); gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.5); // left, center g_object_set (widget, "margin", 2, NULL); gtk_grid_attach (caption, widget, 1, 3, 1, 1); // Speed limit - SpinButton widget = gtk_spin_button_new_with_range (5, 99999999, 1); g_object_set (widget, "margin", 2, NULL); gtk_grid_attach (caption, widget, 2, 3, 1, 1); sform->spin_speed = (GtkSpinButton*) widget; // Speed limit - KiB/s label widget = gtk_label_new (_("KiB/s")); gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.5); // left, center g_object_set (widget, "margin", 2, NULL); gtk_grid_attach (caption, widget, 3, 3, 1, 1); */ // change sensitive state gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (sform->enable), FALSE); gtk_toggle_button_toggled (GTK_TOGGLE_BUTTON (sform->enable)); gtk_widget_show_all (sform->self); } void ugtk_schedule_form_get (struct UgtkScheduleForm* sform, UgtkSetting* setting) { // gint value; memcpy (setting->scheduler.state.at, sform->state, sizeof (sform->state)); setting->scheduler.enable = gtk_toggle_button_get_active ( GTK_TOGGLE_BUTTON (sform->enable)); // value = gtk_spin_button_get_value_as_int (sform->spin_speed); // setting->scheduler.speed_limit = value * 1024; } void ugtk_schedule_form_set (struct UgtkScheduleForm* sform, UgtkSetting* setting) { // gint value; memcpy (sform->state, setting->scheduler.state.at, sizeof (sform->state)); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (sform->enable), setting->scheduler.enable); gtk_toggle_button_toggled (GTK_TOGGLE_BUTTON (sform->enable)); // value = setting->scheduler.speed_limit / 1024; // gtk_spin_button_set_value (sform->spin_speed, value); } // ---------------------------------------------------------------------------- // signal handler // static void on_enable_toggled (GtkToggleButton* togglebutton, struct UgtkScheduleForm* sform) { gboolean active; active = gtk_toggle_button_get_active (togglebutton); gtk_widget_set_sensitive (sform->drawing, active); gtk_widget_set_sensitive (sform->caption, active); } static gboolean on_draw_callback (GtkWidget* widget, cairo_t* cr, struct UgtkScheduleForm* sform) { gboolean sensitive; gint y, x; gdouble cy, cx, ox; PangoContext* context; PangoLayout* layout; PangoFontDescription* desc; cairo_set_line_width (cr, 1); sensitive = gtk_widget_get_sensitive (widget); // setup Pango context = gtk_widget_get_pango_context (widget); desc = pango_context_get_font_description (context); layout = pango_cairo_create_layout (cr); pango_layout_set_font_description (layout, desc); // week days // ox = x offset for (ox = 0, cy = 0.5, y = 0; y < 7; y++, cy+=UgtkGrid.height_and_line) { cairo_move_to (cr, 1, cy); pango_layout_set_text (layout, gettext (week_days[y]), -1); pango_cairo_update_layout (cr, layout); pango_cairo_show_layout (cr, layout); // pango_layout_get_size (layout, &x, NULL); // x /= PANGO_SCALE; pango_layout_get_pixel_size (layout, &x, NULL); if (x + 4 > ox) ox = x + 4; } g_object_unref (layout); if (sform->drawing_offset == 0) sform->drawing_offset = ox; // draw grid columns for (cx = 0.5; cx <= UgtkGrid.width_all; cx += UgtkGrid.width_and_line) { cairo_move_to (cr, ox + cx, 0 + 0.5); cairo_line_to (cr, ox + cx, UgtkGrid.height_all - 1.0 + 0.5); } // draw grid rows for (cy = 0.5; cy <= UgtkGrid.height_all; cy += UgtkGrid.height_and_line) { cairo_move_to (cr, ox + 0.5, cy); cairo_line_to (cr, ox + UgtkGrid.width_all - 1.0 + 0.5, cy); } cairo_stroke (cr); // fill grid if (sensitive == FALSE) { cairo_set_source_rgb (cr, COLOR_DISABLE_R, COLOR_DISABLE_G, COLOR_DISABLE_B); } for (cy = 1.5, y = 0; y < 7; y++, cy+=UgtkGrid.height_and_line) { for (cx = 1.5+ox, x = 0; x < 24; x++, cx+=UgtkGrid.width_and_line) { if (sensitive) { cairo_set_source_rgb (cr, colors [sform->state[y][x]][0], colors [sform->state[y][x]][1], colors [sform->state[y][x]][2]); } cairo_rectangle (cr, cx, cy, UgtkGrid.width - 0.5, UgtkGrid.height - 0.5); cairo_fill (cr); } } return FALSE; } static gboolean on_button_press_event (GtkWidget *widget, GdkEventMotion *event, struct UgtkScheduleForm* sform) { gint x, y; cairo_t* cr; UgtkScheduleState state; x = (event->x - sform->drawing_offset) / UgtkGrid.width_and_line; y = event->y / UgtkGrid.height_and_line; if (x < 0 || y < 0 || x >= 24 || y >= 7) return FALSE; state = (sform->state[y][x] == UGTK_SCHEDULE_TURN_OFF) ? UGTK_SCHEDULE_NORMAL : UGTK_SCHEDULE_TURN_OFF; // state = sform->state[y][x] + 1; // if (state == UGTK_SCHEDULE_UPLOAD_ONLY) // state++; // if (state > UGTK_SCHEDULE_NORMAL) // state = UGTK_SCHEDULE_TURN_OFF; sform->state[y][x] = state; sform->last_state = state; // cairo cr = gdk_cairo_create (gtk_widget_get_window (widget)); cairo_set_source_rgb (cr, colors [state][0], colors [state][1], colors [state][2]); cairo_rectangle (cr, (gdouble)x * UgtkGrid.width_and_line + 1.0 + 0.5 + sform->drawing_offset, (gdouble)y * UgtkGrid.height_and_line + 1.0 + 0.5, UgtkGrid.width - 0.5, UgtkGrid.height - 0.5); cairo_fill (cr); cairo_destroy (cr); return TRUE; } static gboolean on_motion_notify_event (GtkWidget *widget, GdkEventMotion *event, struct UgtkScheduleForm* sform) { gint x, y; gchar* string; cairo_t* cr; GdkWindow* gdkwin; GdkModifierType mod; UgtkScheduleState state; gdkwin = gtk_widget_get_window (widget); gdk_window_get_device_position (gdkwin, event->device, &x, &y, &mod); x -= sform->drawing_offset; x /= UgtkGrid.width_and_line; y /= UgtkGrid.height_and_line; if (x < 0 || y < 0 || x >= 24 || y >= 7) { // clear time_tips gtk_label_set_text (sform->time_tips, ""); return FALSE; } // update time_tips string = g_strdup_printf ("%s, %.2d:00 - %.2d:59", gettext (week_days[y]), x, x); gtk_label_set_text (sform->time_tips, string); g_free (string); // if no button press if ((mod & GDK_BUTTON1_MASK) == 0) return FALSE; state = sform->last_state; sform->state[y][x] = state; // cairo cr = gdk_cairo_create (gdkwin); cairo_rectangle (cr, sform->drawing_offset, 0, UgtkGrid.width_all, UgtkGrid.height_all); cairo_clip (cr); cairo_set_source_rgb (cr, colors [state][0], colors [state][1], colors [state][2]); cairo_rectangle (cr, (gdouble)x * UgtkGrid.width_and_line + 1.0 + 0.5 + sform->drawing_offset, (gdouble)y * UgtkGrid.height_and_line + 1.0 + 0.5, UgtkGrid.width - 0.5, UgtkGrid.height - 0.5); cairo_fill (cr); cairo_destroy (cr); return TRUE; } static gboolean on_leave_notify_event (GtkWidget* menu, GdkEventCrossing* event, struct UgtkScheduleForm* sform) { gtk_label_set_text (sform->time_tips, ""); return TRUE; } // ---------------------------------------------------------------------------- // UgtkGrid // static void ugtk_grid_global_init (int width, int height) { UgtkGrid.width = width; UgtkGrid.height = height; UgtkGrid.width_and_line = UgtkGrid.width + 1; UgtkGrid.height_and_line = UgtkGrid.height + 1; UgtkGrid.width_all = UgtkGrid.width_and_line * 24 + 1; UgtkGrid.height_all = UgtkGrid.height_and_line * 7 + 1; } static GtkWidget* ugtk_grid_new (const gdouble* rgb_array) { GtkWidget* widget; widget = gtk_drawing_area_new (); gtk_widget_set_size_request (widget, UgtkGrid.width + 2, UgtkGrid.height + 2); gtk_widget_add_events (widget, GDK_POINTER_MOTION_MASK); g_signal_connect (widget, "draw", G_CALLBACK (ugtk_grid_draw), (gpointer) rgb_array); return widget; } static gboolean ugtk_grid_draw (GtkWidget* widget, cairo_t* cr, const gdouble* rgb_array) { GtkAllocation allocation; gdouble x, y, width, height; gtk_widget_get_allocation (widget, &allocation); x = 0.5; y = 0.5; width = (gdouble) (allocation.width - 1); height = (gdouble) (allocation.height - 1); cairo_set_line_width (cr, 1); cairo_rectangle (cr, x, y, width, height); cairo_stroke (cr); if (gtk_widget_get_sensitive (widget)) { cairo_set_source_rgb (cr, rgb_array [0], rgb_array [1], rgb_array [2]); } else { cairo_set_source_rgb (cr, COLOR_DISABLE_R, COLOR_DISABLE_G, COLOR_DISABLE_B); } cairo_rectangle (cr, x + 1.0, y + 1.0, width - 2.0, height - 2.0); cairo_fill (cr); return FALSE; } uget-2.2.0/ui-gtk/UgtkConfirmDialog.h0000644000175000000120000000433113224532612014310 00000000000000/* * * Copyright (C) 2005-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #ifndef UGTK_CONFIRM_DIALOG_H #define UGTK_CONFIRM_DIALOG_H #include #include #ifdef __cplusplus extern "C" { #endif typedef enum { UGTK_CONFIRM_DIALOG_EXIT, UGTK_CONFIRM_DIALOG_DELETE, UGTK_CONFIRM_DIALOG_DELETE_CATEGORY, } UgtkConfirmDialogMode; typedef struct UgtkConfirmDialog UgtkConfirmDialog; struct UgtkConfirmDialog { GtkDialog* self; UgtkApp* app; GtkToggleButton* confirmation; }; UgtkConfirmDialog* ugtk_confirm_dialog_new (UgtkConfirmDialogMode mode, UgtkApp* app); void ugtk_confirm_dialog_run (UgtkConfirmDialog* cdialog); #ifdef __cplusplus } #endif #endif // UGTK_CONFIRM_DIALOG_H uget-2.2.0/ui-gtk/Makefile.in0000644000175000000120000024052113224532747012650 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 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@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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 = : bin_PROGRAMS = uget-gtk$(EXEEXT) subdir = ui-gtk ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am_uget_gtk_OBJECTS = uget_gtk-UgtkUtil.$(OBJEXT) \ uget_gtk-UgtkConfig.$(OBJEXT) uget_gtk-UgtkSetting.$(OBJEXT) \ uget_gtk-UgtkNodeList.$(OBJEXT) \ uget_gtk-UgtkNodeTree.$(OBJEXT) \ uget_gtk-UgtkNodeView.$(OBJEXT) \ uget_gtk-UgtkTraveler.$(OBJEXT) uget_gtk-UgtkSummary.$(OBJEXT) \ uget_gtk-UgtkTrayIcon.$(OBJEXT) uget_gtk-UgtkBanner.$(OBJEXT) \ uget_gtk-UgtkSequence.$(OBJEXT) \ uget_gtk-UgtkSelector.$(OBJEXT) \ uget_gtk-UgtkProxyForm.$(OBJEXT) \ uget_gtk-UgtkDownloadForm.$(OBJEXT) \ uget_gtk-UgtkCategoryForm.$(OBJEXT) \ uget_gtk-UgtkNodeDialog.$(OBJEXT) \ uget_gtk-UgtkBatchDialog.$(OBJEXT) \ uget_gtk-UgtkScheduleForm.$(OBJEXT) \ uget_gtk-UgtkSettingForm.$(OBJEXT) \ uget_gtk-UgtkSettingDialog.$(OBJEXT) \ uget_gtk-UgtkConfirmDialog.$(OBJEXT) \ uget_gtk-UgtkAboutDialog.$(OBJEXT) \ uget_gtk-UgtkMenubar.$(OBJEXT) \ uget_gtk-UgtkMenubar-ui.$(OBJEXT) uget_gtk-UgtkApp.$(OBJEXT) \ uget_gtk-UgtkApp-ui.$(OBJEXT) \ uget_gtk-UgtkApp-callback.$(OBJEXT) \ uget_gtk-UgtkApp-timeout.$(OBJEXT) \ uget_gtk-UgtkApp-main.$(OBJEXT) uget_gtk_OBJECTS = $(am_uget_gtk_OBJECTS) uget_gtk_DEPENDENCIES = $(top_builddir)/uget/libuget.a \ $(top_builddir)/uglib/libuglib.a uget_gtk_LINK = $(CCLD) $(uget_gtk_CFLAGS) $(CFLAGS) \ $(uget_gtk_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(uget_gtk_SOURCES) DIST_SOURCES = $(uget_gtk_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ APP_INDICATOR_CFLAGS = @APP_INDICATOR_CFLAGS@ APP_INDICATOR_LIBS = @APP_INDICATOR_LIBS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_CONFIG = @CURL_CONFIG@ CURL_LIBS = @CURL_LIBS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GETCONF = @GETCONF@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GSTREAMER_CFLAGS = @GSTREAMER_CFLAGS@ GSTREAMER_LIBS = @GSTREAMER_LIBS@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LDFLAGS = @LDFLAGS@ LFS_CFLAGS = @LFS_CFLAGS@ LFS_LDFLAGS = @LFS_LDFLAGS@ LIBCRYPTO_CFLAGS = @LIBCRYPTO_CFLAGS@ LIBCRYPTO_LIBS = @LIBCRYPTO_LIBS@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBNOTIFY_CFLAGS = @LIBNOTIFY_CFLAGS@ LIBNOTIFY_LIBS = @LIBNOTIFY_LIBS@ LIBOBJS = @LIBOBJS@ LIBPWMD_CFLAGS = @LIBPWMD_CFLAGS@ LIBPWMD_LIBS = @LIBPWMD_LIBS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ OBJEXT = @OBJEXT@ 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@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ 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@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ 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@ uget_gtk_CPPFLAGS = \ -DUG_DATADIR='"$(datadir)"' \ -I$(top_srcdir)/ui-gtk \ -I$(top_srcdir)/uget \ -I$(top_srcdir)/uglib uget_gtk_CFLAGS = \ @PTHREAD_CFLAGS@ \ @LFS_CFLAGS@ \ @CURL_CFLAGS@ \ @LIBGCRYPT_CFLAGS@ \ @LIBCRYPTO_CFLAGS@ \ @GTK_CFLAGS@ \ @LIBNOTIFY_CFLAGS@ \ @APP_INDICATOR_CFLAGS@ \ @GSTREAMER_CFLAGS@ \ @LIBPWMD_CFLAGS@ uget_gtk_LDFLAGS = @LFS_LDFLAGS@ uget_gtk_LDADD = \ $(top_builddir)/uget/libuget.a \ $(top_builddir)/uglib/libuglib.a \ @PTHREAD_LIBS@ \ @CURL_LIBS@ \ @LIBGCRYPT_LIBS@ \ @LIBCRYPTO_LIBS@ \ @GTK_LIBS@ \ @LIBNOTIFY_LIBS@ \ @APP_INDICATOR_LIBS@ \ @GSTREAMER_LIBS@ \ @LIBPWMD_LIBS@ uget_gtk_SOURCES = \ UgtkUtil.c UgtkConfig.c UgtkSetting.c \ UgtkNodeList.c UgtkNodeTree.c UgtkNodeView.c \ UgtkTraveler.c UgtkSummary.c \ UgtkTrayIcon.c UgtkBanner.c \ UgtkSequence.c UgtkSelector.c \ UgtkProxyForm.c UgtkDownloadForm.c UgtkCategoryForm.c \ UgtkNodeDialog.c UgtkBatchDialog.c \ UgtkScheduleForm.c UgtkSettingForm.c UgtkSettingDialog.c \ UgtkConfirmDialog.c UgtkAboutDialog.c \ UgtkMenubar.c UgtkMenubar-ui.c \ UgtkApp.c UgtkApp-ui.c UgtkApp-callback.c \ UgtkApp-timeout.c UgtkApp-main.c noinst_HEADERS = \ UgtkUtil.h UgtkConfig.h UgtkSetting.h \ UgtkNodeList.h UgtkNodeTree.h UgtkNodeView.h \ UgtkTraveler.h UgtkSummary.h \ UgtkTrayIcon.h UgtkBanner.h \ UgtkSequence.h UgtkSelector.h \ UgtkProxyForm.h UgtkDownloadForm.h UgtkCategoryForm.h \ UgtkNodeDialog.h UgtkBatchDialog.h \ UgtkScheduleForm.h UgtkSettingForm.h UgtkSettingDialog.h \ UgtkConfirmDialog.h UgtkAboutDialog.h \ UgtkMenubar.h \ UgtkApp.h all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj $(srcdir)/Makefile.in: $(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) --gnu ui-gtk/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu ui-gtk/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ 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; \ else { print "f", $$3 "/" $$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_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) uget-gtk$(EXEEXT): $(uget_gtk_OBJECTS) $(uget_gtk_DEPENDENCIES) $(EXTRA_uget_gtk_DEPENDENCIES) @rm -f uget-gtk$(EXEEXT) $(AM_V_CCLD)$(uget_gtk_LINK) $(uget_gtk_OBJECTS) $(uget_gtk_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uget_gtk-UgtkAboutDialog.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uget_gtk-UgtkApp-callback.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uget_gtk-UgtkApp-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uget_gtk-UgtkApp-timeout.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uget_gtk-UgtkApp-ui.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uget_gtk-UgtkApp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uget_gtk-UgtkBanner.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uget_gtk-UgtkBatchDialog.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uget_gtk-UgtkCategoryForm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uget_gtk-UgtkConfig.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uget_gtk-UgtkConfirmDialog.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uget_gtk-UgtkDownloadForm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uget_gtk-UgtkMenubar-ui.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uget_gtk-UgtkMenubar.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uget_gtk-UgtkNodeDialog.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uget_gtk-UgtkNodeList.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uget_gtk-UgtkNodeTree.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uget_gtk-UgtkNodeView.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uget_gtk-UgtkProxyForm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uget_gtk-UgtkScheduleForm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uget_gtk-UgtkSelector.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uget_gtk-UgtkSequence.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uget_gtk-UgtkSetting.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uget_gtk-UgtkSettingDialog.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uget_gtk-UgtkSettingForm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uget_gtk-UgtkSummary.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uget_gtk-UgtkTraveler.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uget_gtk-UgtkTrayIcon.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uget_gtk-UgtkUtil.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` uget_gtk-UgtkUtil.o: UgtkUtil.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkUtil.o -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkUtil.Tpo -c -o uget_gtk-UgtkUtil.o `test -f 'UgtkUtil.c' || echo '$(srcdir)/'`UgtkUtil.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkUtil.Tpo $(DEPDIR)/uget_gtk-UgtkUtil.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkUtil.c' object='uget_gtk-UgtkUtil.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkUtil.o `test -f 'UgtkUtil.c' || echo '$(srcdir)/'`UgtkUtil.c uget_gtk-UgtkUtil.obj: UgtkUtil.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkUtil.obj -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkUtil.Tpo -c -o uget_gtk-UgtkUtil.obj `if test -f 'UgtkUtil.c'; then $(CYGPATH_W) 'UgtkUtil.c'; else $(CYGPATH_W) '$(srcdir)/UgtkUtil.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkUtil.Tpo $(DEPDIR)/uget_gtk-UgtkUtil.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkUtil.c' object='uget_gtk-UgtkUtil.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkUtil.obj `if test -f 'UgtkUtil.c'; then $(CYGPATH_W) 'UgtkUtil.c'; else $(CYGPATH_W) '$(srcdir)/UgtkUtil.c'; fi` uget_gtk-UgtkConfig.o: UgtkConfig.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkConfig.o -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkConfig.Tpo -c -o uget_gtk-UgtkConfig.o `test -f 'UgtkConfig.c' || echo '$(srcdir)/'`UgtkConfig.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkConfig.Tpo $(DEPDIR)/uget_gtk-UgtkConfig.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkConfig.c' object='uget_gtk-UgtkConfig.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkConfig.o `test -f 'UgtkConfig.c' || echo '$(srcdir)/'`UgtkConfig.c uget_gtk-UgtkConfig.obj: UgtkConfig.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkConfig.obj -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkConfig.Tpo -c -o uget_gtk-UgtkConfig.obj `if test -f 'UgtkConfig.c'; then $(CYGPATH_W) 'UgtkConfig.c'; else $(CYGPATH_W) '$(srcdir)/UgtkConfig.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkConfig.Tpo $(DEPDIR)/uget_gtk-UgtkConfig.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkConfig.c' object='uget_gtk-UgtkConfig.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkConfig.obj `if test -f 'UgtkConfig.c'; then $(CYGPATH_W) 'UgtkConfig.c'; else $(CYGPATH_W) '$(srcdir)/UgtkConfig.c'; fi` uget_gtk-UgtkSetting.o: UgtkSetting.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkSetting.o -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkSetting.Tpo -c -o uget_gtk-UgtkSetting.o `test -f 'UgtkSetting.c' || echo '$(srcdir)/'`UgtkSetting.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkSetting.Tpo $(DEPDIR)/uget_gtk-UgtkSetting.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkSetting.c' object='uget_gtk-UgtkSetting.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkSetting.o `test -f 'UgtkSetting.c' || echo '$(srcdir)/'`UgtkSetting.c uget_gtk-UgtkSetting.obj: UgtkSetting.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkSetting.obj -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkSetting.Tpo -c -o uget_gtk-UgtkSetting.obj `if test -f 'UgtkSetting.c'; then $(CYGPATH_W) 'UgtkSetting.c'; else $(CYGPATH_W) '$(srcdir)/UgtkSetting.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkSetting.Tpo $(DEPDIR)/uget_gtk-UgtkSetting.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkSetting.c' object='uget_gtk-UgtkSetting.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkSetting.obj `if test -f 'UgtkSetting.c'; then $(CYGPATH_W) 'UgtkSetting.c'; else $(CYGPATH_W) '$(srcdir)/UgtkSetting.c'; fi` uget_gtk-UgtkNodeList.o: UgtkNodeList.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkNodeList.o -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkNodeList.Tpo -c -o uget_gtk-UgtkNodeList.o `test -f 'UgtkNodeList.c' || echo '$(srcdir)/'`UgtkNodeList.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkNodeList.Tpo $(DEPDIR)/uget_gtk-UgtkNodeList.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkNodeList.c' object='uget_gtk-UgtkNodeList.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkNodeList.o `test -f 'UgtkNodeList.c' || echo '$(srcdir)/'`UgtkNodeList.c uget_gtk-UgtkNodeList.obj: UgtkNodeList.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkNodeList.obj -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkNodeList.Tpo -c -o uget_gtk-UgtkNodeList.obj `if test -f 'UgtkNodeList.c'; then $(CYGPATH_W) 'UgtkNodeList.c'; else $(CYGPATH_W) '$(srcdir)/UgtkNodeList.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkNodeList.Tpo $(DEPDIR)/uget_gtk-UgtkNodeList.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkNodeList.c' object='uget_gtk-UgtkNodeList.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkNodeList.obj `if test -f 'UgtkNodeList.c'; then $(CYGPATH_W) 'UgtkNodeList.c'; else $(CYGPATH_W) '$(srcdir)/UgtkNodeList.c'; fi` uget_gtk-UgtkNodeTree.o: UgtkNodeTree.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkNodeTree.o -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkNodeTree.Tpo -c -o uget_gtk-UgtkNodeTree.o `test -f 'UgtkNodeTree.c' || echo '$(srcdir)/'`UgtkNodeTree.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkNodeTree.Tpo $(DEPDIR)/uget_gtk-UgtkNodeTree.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkNodeTree.c' object='uget_gtk-UgtkNodeTree.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkNodeTree.o `test -f 'UgtkNodeTree.c' || echo '$(srcdir)/'`UgtkNodeTree.c uget_gtk-UgtkNodeTree.obj: UgtkNodeTree.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkNodeTree.obj -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkNodeTree.Tpo -c -o uget_gtk-UgtkNodeTree.obj `if test -f 'UgtkNodeTree.c'; then $(CYGPATH_W) 'UgtkNodeTree.c'; else $(CYGPATH_W) '$(srcdir)/UgtkNodeTree.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkNodeTree.Tpo $(DEPDIR)/uget_gtk-UgtkNodeTree.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkNodeTree.c' object='uget_gtk-UgtkNodeTree.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkNodeTree.obj `if test -f 'UgtkNodeTree.c'; then $(CYGPATH_W) 'UgtkNodeTree.c'; else $(CYGPATH_W) '$(srcdir)/UgtkNodeTree.c'; fi` uget_gtk-UgtkNodeView.o: UgtkNodeView.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkNodeView.o -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkNodeView.Tpo -c -o uget_gtk-UgtkNodeView.o `test -f 'UgtkNodeView.c' || echo '$(srcdir)/'`UgtkNodeView.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkNodeView.Tpo $(DEPDIR)/uget_gtk-UgtkNodeView.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkNodeView.c' object='uget_gtk-UgtkNodeView.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkNodeView.o `test -f 'UgtkNodeView.c' || echo '$(srcdir)/'`UgtkNodeView.c uget_gtk-UgtkNodeView.obj: UgtkNodeView.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkNodeView.obj -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkNodeView.Tpo -c -o uget_gtk-UgtkNodeView.obj `if test -f 'UgtkNodeView.c'; then $(CYGPATH_W) 'UgtkNodeView.c'; else $(CYGPATH_W) '$(srcdir)/UgtkNodeView.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkNodeView.Tpo $(DEPDIR)/uget_gtk-UgtkNodeView.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkNodeView.c' object='uget_gtk-UgtkNodeView.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkNodeView.obj `if test -f 'UgtkNodeView.c'; then $(CYGPATH_W) 'UgtkNodeView.c'; else $(CYGPATH_W) '$(srcdir)/UgtkNodeView.c'; fi` uget_gtk-UgtkTraveler.o: UgtkTraveler.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkTraveler.o -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkTraveler.Tpo -c -o uget_gtk-UgtkTraveler.o `test -f 'UgtkTraveler.c' || echo '$(srcdir)/'`UgtkTraveler.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkTraveler.Tpo $(DEPDIR)/uget_gtk-UgtkTraveler.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkTraveler.c' object='uget_gtk-UgtkTraveler.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkTraveler.o `test -f 'UgtkTraveler.c' || echo '$(srcdir)/'`UgtkTraveler.c uget_gtk-UgtkTraveler.obj: UgtkTraveler.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkTraveler.obj -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkTraveler.Tpo -c -o uget_gtk-UgtkTraveler.obj `if test -f 'UgtkTraveler.c'; then $(CYGPATH_W) 'UgtkTraveler.c'; else $(CYGPATH_W) '$(srcdir)/UgtkTraveler.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkTraveler.Tpo $(DEPDIR)/uget_gtk-UgtkTraveler.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkTraveler.c' object='uget_gtk-UgtkTraveler.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkTraveler.obj `if test -f 'UgtkTraveler.c'; then $(CYGPATH_W) 'UgtkTraveler.c'; else $(CYGPATH_W) '$(srcdir)/UgtkTraveler.c'; fi` uget_gtk-UgtkSummary.o: UgtkSummary.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkSummary.o -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkSummary.Tpo -c -o uget_gtk-UgtkSummary.o `test -f 'UgtkSummary.c' || echo '$(srcdir)/'`UgtkSummary.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkSummary.Tpo $(DEPDIR)/uget_gtk-UgtkSummary.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkSummary.c' object='uget_gtk-UgtkSummary.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkSummary.o `test -f 'UgtkSummary.c' || echo '$(srcdir)/'`UgtkSummary.c uget_gtk-UgtkSummary.obj: UgtkSummary.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkSummary.obj -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkSummary.Tpo -c -o uget_gtk-UgtkSummary.obj `if test -f 'UgtkSummary.c'; then $(CYGPATH_W) 'UgtkSummary.c'; else $(CYGPATH_W) '$(srcdir)/UgtkSummary.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkSummary.Tpo $(DEPDIR)/uget_gtk-UgtkSummary.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkSummary.c' object='uget_gtk-UgtkSummary.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkSummary.obj `if test -f 'UgtkSummary.c'; then $(CYGPATH_W) 'UgtkSummary.c'; else $(CYGPATH_W) '$(srcdir)/UgtkSummary.c'; fi` uget_gtk-UgtkTrayIcon.o: UgtkTrayIcon.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkTrayIcon.o -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkTrayIcon.Tpo -c -o uget_gtk-UgtkTrayIcon.o `test -f 'UgtkTrayIcon.c' || echo '$(srcdir)/'`UgtkTrayIcon.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkTrayIcon.Tpo $(DEPDIR)/uget_gtk-UgtkTrayIcon.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkTrayIcon.c' object='uget_gtk-UgtkTrayIcon.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkTrayIcon.o `test -f 'UgtkTrayIcon.c' || echo '$(srcdir)/'`UgtkTrayIcon.c uget_gtk-UgtkTrayIcon.obj: UgtkTrayIcon.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkTrayIcon.obj -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkTrayIcon.Tpo -c -o uget_gtk-UgtkTrayIcon.obj `if test -f 'UgtkTrayIcon.c'; then $(CYGPATH_W) 'UgtkTrayIcon.c'; else $(CYGPATH_W) '$(srcdir)/UgtkTrayIcon.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkTrayIcon.Tpo $(DEPDIR)/uget_gtk-UgtkTrayIcon.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkTrayIcon.c' object='uget_gtk-UgtkTrayIcon.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkTrayIcon.obj `if test -f 'UgtkTrayIcon.c'; then $(CYGPATH_W) 'UgtkTrayIcon.c'; else $(CYGPATH_W) '$(srcdir)/UgtkTrayIcon.c'; fi` uget_gtk-UgtkBanner.o: UgtkBanner.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkBanner.o -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkBanner.Tpo -c -o uget_gtk-UgtkBanner.o `test -f 'UgtkBanner.c' || echo '$(srcdir)/'`UgtkBanner.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkBanner.Tpo $(DEPDIR)/uget_gtk-UgtkBanner.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkBanner.c' object='uget_gtk-UgtkBanner.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkBanner.o `test -f 'UgtkBanner.c' || echo '$(srcdir)/'`UgtkBanner.c uget_gtk-UgtkBanner.obj: UgtkBanner.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkBanner.obj -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkBanner.Tpo -c -o uget_gtk-UgtkBanner.obj `if test -f 'UgtkBanner.c'; then $(CYGPATH_W) 'UgtkBanner.c'; else $(CYGPATH_W) '$(srcdir)/UgtkBanner.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkBanner.Tpo $(DEPDIR)/uget_gtk-UgtkBanner.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkBanner.c' object='uget_gtk-UgtkBanner.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkBanner.obj `if test -f 'UgtkBanner.c'; then $(CYGPATH_W) 'UgtkBanner.c'; else $(CYGPATH_W) '$(srcdir)/UgtkBanner.c'; fi` uget_gtk-UgtkSequence.o: UgtkSequence.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkSequence.o -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkSequence.Tpo -c -o uget_gtk-UgtkSequence.o `test -f 'UgtkSequence.c' || echo '$(srcdir)/'`UgtkSequence.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkSequence.Tpo $(DEPDIR)/uget_gtk-UgtkSequence.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkSequence.c' object='uget_gtk-UgtkSequence.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkSequence.o `test -f 'UgtkSequence.c' || echo '$(srcdir)/'`UgtkSequence.c uget_gtk-UgtkSequence.obj: UgtkSequence.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkSequence.obj -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkSequence.Tpo -c -o uget_gtk-UgtkSequence.obj `if test -f 'UgtkSequence.c'; then $(CYGPATH_W) 'UgtkSequence.c'; else $(CYGPATH_W) '$(srcdir)/UgtkSequence.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkSequence.Tpo $(DEPDIR)/uget_gtk-UgtkSequence.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkSequence.c' object='uget_gtk-UgtkSequence.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkSequence.obj `if test -f 'UgtkSequence.c'; then $(CYGPATH_W) 'UgtkSequence.c'; else $(CYGPATH_W) '$(srcdir)/UgtkSequence.c'; fi` uget_gtk-UgtkSelector.o: UgtkSelector.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkSelector.o -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkSelector.Tpo -c -o uget_gtk-UgtkSelector.o `test -f 'UgtkSelector.c' || echo '$(srcdir)/'`UgtkSelector.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkSelector.Tpo $(DEPDIR)/uget_gtk-UgtkSelector.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkSelector.c' object='uget_gtk-UgtkSelector.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkSelector.o `test -f 'UgtkSelector.c' || echo '$(srcdir)/'`UgtkSelector.c uget_gtk-UgtkSelector.obj: UgtkSelector.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkSelector.obj -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkSelector.Tpo -c -o uget_gtk-UgtkSelector.obj `if test -f 'UgtkSelector.c'; then $(CYGPATH_W) 'UgtkSelector.c'; else $(CYGPATH_W) '$(srcdir)/UgtkSelector.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkSelector.Tpo $(DEPDIR)/uget_gtk-UgtkSelector.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkSelector.c' object='uget_gtk-UgtkSelector.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkSelector.obj `if test -f 'UgtkSelector.c'; then $(CYGPATH_W) 'UgtkSelector.c'; else $(CYGPATH_W) '$(srcdir)/UgtkSelector.c'; fi` uget_gtk-UgtkProxyForm.o: UgtkProxyForm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkProxyForm.o -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkProxyForm.Tpo -c -o uget_gtk-UgtkProxyForm.o `test -f 'UgtkProxyForm.c' || echo '$(srcdir)/'`UgtkProxyForm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkProxyForm.Tpo $(DEPDIR)/uget_gtk-UgtkProxyForm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkProxyForm.c' object='uget_gtk-UgtkProxyForm.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkProxyForm.o `test -f 'UgtkProxyForm.c' || echo '$(srcdir)/'`UgtkProxyForm.c uget_gtk-UgtkProxyForm.obj: UgtkProxyForm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkProxyForm.obj -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkProxyForm.Tpo -c -o uget_gtk-UgtkProxyForm.obj `if test -f 'UgtkProxyForm.c'; then $(CYGPATH_W) 'UgtkProxyForm.c'; else $(CYGPATH_W) '$(srcdir)/UgtkProxyForm.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkProxyForm.Tpo $(DEPDIR)/uget_gtk-UgtkProxyForm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkProxyForm.c' object='uget_gtk-UgtkProxyForm.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkProxyForm.obj `if test -f 'UgtkProxyForm.c'; then $(CYGPATH_W) 'UgtkProxyForm.c'; else $(CYGPATH_W) '$(srcdir)/UgtkProxyForm.c'; fi` uget_gtk-UgtkDownloadForm.o: UgtkDownloadForm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkDownloadForm.o -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkDownloadForm.Tpo -c -o uget_gtk-UgtkDownloadForm.o `test -f 'UgtkDownloadForm.c' || echo '$(srcdir)/'`UgtkDownloadForm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkDownloadForm.Tpo $(DEPDIR)/uget_gtk-UgtkDownloadForm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkDownloadForm.c' object='uget_gtk-UgtkDownloadForm.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkDownloadForm.o `test -f 'UgtkDownloadForm.c' || echo '$(srcdir)/'`UgtkDownloadForm.c uget_gtk-UgtkDownloadForm.obj: UgtkDownloadForm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkDownloadForm.obj -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkDownloadForm.Tpo -c -o uget_gtk-UgtkDownloadForm.obj `if test -f 'UgtkDownloadForm.c'; then $(CYGPATH_W) 'UgtkDownloadForm.c'; else $(CYGPATH_W) '$(srcdir)/UgtkDownloadForm.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkDownloadForm.Tpo $(DEPDIR)/uget_gtk-UgtkDownloadForm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkDownloadForm.c' object='uget_gtk-UgtkDownloadForm.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkDownloadForm.obj `if test -f 'UgtkDownloadForm.c'; then $(CYGPATH_W) 'UgtkDownloadForm.c'; else $(CYGPATH_W) '$(srcdir)/UgtkDownloadForm.c'; fi` uget_gtk-UgtkCategoryForm.o: UgtkCategoryForm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkCategoryForm.o -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkCategoryForm.Tpo -c -o uget_gtk-UgtkCategoryForm.o `test -f 'UgtkCategoryForm.c' || echo '$(srcdir)/'`UgtkCategoryForm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkCategoryForm.Tpo $(DEPDIR)/uget_gtk-UgtkCategoryForm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkCategoryForm.c' object='uget_gtk-UgtkCategoryForm.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkCategoryForm.o `test -f 'UgtkCategoryForm.c' || echo '$(srcdir)/'`UgtkCategoryForm.c uget_gtk-UgtkCategoryForm.obj: UgtkCategoryForm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkCategoryForm.obj -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkCategoryForm.Tpo -c -o uget_gtk-UgtkCategoryForm.obj `if test -f 'UgtkCategoryForm.c'; then $(CYGPATH_W) 'UgtkCategoryForm.c'; else $(CYGPATH_W) '$(srcdir)/UgtkCategoryForm.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkCategoryForm.Tpo $(DEPDIR)/uget_gtk-UgtkCategoryForm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkCategoryForm.c' object='uget_gtk-UgtkCategoryForm.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkCategoryForm.obj `if test -f 'UgtkCategoryForm.c'; then $(CYGPATH_W) 'UgtkCategoryForm.c'; else $(CYGPATH_W) '$(srcdir)/UgtkCategoryForm.c'; fi` uget_gtk-UgtkNodeDialog.o: UgtkNodeDialog.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkNodeDialog.o -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkNodeDialog.Tpo -c -o uget_gtk-UgtkNodeDialog.o `test -f 'UgtkNodeDialog.c' || echo '$(srcdir)/'`UgtkNodeDialog.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkNodeDialog.Tpo $(DEPDIR)/uget_gtk-UgtkNodeDialog.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkNodeDialog.c' object='uget_gtk-UgtkNodeDialog.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkNodeDialog.o `test -f 'UgtkNodeDialog.c' || echo '$(srcdir)/'`UgtkNodeDialog.c uget_gtk-UgtkNodeDialog.obj: UgtkNodeDialog.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkNodeDialog.obj -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkNodeDialog.Tpo -c -o uget_gtk-UgtkNodeDialog.obj `if test -f 'UgtkNodeDialog.c'; then $(CYGPATH_W) 'UgtkNodeDialog.c'; else $(CYGPATH_W) '$(srcdir)/UgtkNodeDialog.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkNodeDialog.Tpo $(DEPDIR)/uget_gtk-UgtkNodeDialog.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkNodeDialog.c' object='uget_gtk-UgtkNodeDialog.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkNodeDialog.obj `if test -f 'UgtkNodeDialog.c'; then $(CYGPATH_W) 'UgtkNodeDialog.c'; else $(CYGPATH_W) '$(srcdir)/UgtkNodeDialog.c'; fi` uget_gtk-UgtkBatchDialog.o: UgtkBatchDialog.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkBatchDialog.o -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkBatchDialog.Tpo -c -o uget_gtk-UgtkBatchDialog.o `test -f 'UgtkBatchDialog.c' || echo '$(srcdir)/'`UgtkBatchDialog.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkBatchDialog.Tpo $(DEPDIR)/uget_gtk-UgtkBatchDialog.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkBatchDialog.c' object='uget_gtk-UgtkBatchDialog.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkBatchDialog.o `test -f 'UgtkBatchDialog.c' || echo '$(srcdir)/'`UgtkBatchDialog.c uget_gtk-UgtkBatchDialog.obj: UgtkBatchDialog.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkBatchDialog.obj -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkBatchDialog.Tpo -c -o uget_gtk-UgtkBatchDialog.obj `if test -f 'UgtkBatchDialog.c'; then $(CYGPATH_W) 'UgtkBatchDialog.c'; else $(CYGPATH_W) '$(srcdir)/UgtkBatchDialog.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkBatchDialog.Tpo $(DEPDIR)/uget_gtk-UgtkBatchDialog.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkBatchDialog.c' object='uget_gtk-UgtkBatchDialog.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkBatchDialog.obj `if test -f 'UgtkBatchDialog.c'; then $(CYGPATH_W) 'UgtkBatchDialog.c'; else $(CYGPATH_W) '$(srcdir)/UgtkBatchDialog.c'; fi` uget_gtk-UgtkScheduleForm.o: UgtkScheduleForm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkScheduleForm.o -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkScheduleForm.Tpo -c -o uget_gtk-UgtkScheduleForm.o `test -f 'UgtkScheduleForm.c' || echo '$(srcdir)/'`UgtkScheduleForm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkScheduleForm.Tpo $(DEPDIR)/uget_gtk-UgtkScheduleForm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkScheduleForm.c' object='uget_gtk-UgtkScheduleForm.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkScheduleForm.o `test -f 'UgtkScheduleForm.c' || echo '$(srcdir)/'`UgtkScheduleForm.c uget_gtk-UgtkScheduleForm.obj: UgtkScheduleForm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkScheduleForm.obj -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkScheduleForm.Tpo -c -o uget_gtk-UgtkScheduleForm.obj `if test -f 'UgtkScheduleForm.c'; then $(CYGPATH_W) 'UgtkScheduleForm.c'; else $(CYGPATH_W) '$(srcdir)/UgtkScheduleForm.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkScheduleForm.Tpo $(DEPDIR)/uget_gtk-UgtkScheduleForm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkScheduleForm.c' object='uget_gtk-UgtkScheduleForm.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkScheduleForm.obj `if test -f 'UgtkScheduleForm.c'; then $(CYGPATH_W) 'UgtkScheduleForm.c'; else $(CYGPATH_W) '$(srcdir)/UgtkScheduleForm.c'; fi` uget_gtk-UgtkSettingForm.o: UgtkSettingForm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkSettingForm.o -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkSettingForm.Tpo -c -o uget_gtk-UgtkSettingForm.o `test -f 'UgtkSettingForm.c' || echo '$(srcdir)/'`UgtkSettingForm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkSettingForm.Tpo $(DEPDIR)/uget_gtk-UgtkSettingForm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkSettingForm.c' object='uget_gtk-UgtkSettingForm.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkSettingForm.o `test -f 'UgtkSettingForm.c' || echo '$(srcdir)/'`UgtkSettingForm.c uget_gtk-UgtkSettingForm.obj: UgtkSettingForm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkSettingForm.obj -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkSettingForm.Tpo -c -o uget_gtk-UgtkSettingForm.obj `if test -f 'UgtkSettingForm.c'; then $(CYGPATH_W) 'UgtkSettingForm.c'; else $(CYGPATH_W) '$(srcdir)/UgtkSettingForm.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkSettingForm.Tpo $(DEPDIR)/uget_gtk-UgtkSettingForm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkSettingForm.c' object='uget_gtk-UgtkSettingForm.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkSettingForm.obj `if test -f 'UgtkSettingForm.c'; then $(CYGPATH_W) 'UgtkSettingForm.c'; else $(CYGPATH_W) '$(srcdir)/UgtkSettingForm.c'; fi` uget_gtk-UgtkSettingDialog.o: UgtkSettingDialog.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkSettingDialog.o -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkSettingDialog.Tpo -c -o uget_gtk-UgtkSettingDialog.o `test -f 'UgtkSettingDialog.c' || echo '$(srcdir)/'`UgtkSettingDialog.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkSettingDialog.Tpo $(DEPDIR)/uget_gtk-UgtkSettingDialog.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkSettingDialog.c' object='uget_gtk-UgtkSettingDialog.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkSettingDialog.o `test -f 'UgtkSettingDialog.c' || echo '$(srcdir)/'`UgtkSettingDialog.c uget_gtk-UgtkSettingDialog.obj: UgtkSettingDialog.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkSettingDialog.obj -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkSettingDialog.Tpo -c -o uget_gtk-UgtkSettingDialog.obj `if test -f 'UgtkSettingDialog.c'; then $(CYGPATH_W) 'UgtkSettingDialog.c'; else $(CYGPATH_W) '$(srcdir)/UgtkSettingDialog.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkSettingDialog.Tpo $(DEPDIR)/uget_gtk-UgtkSettingDialog.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkSettingDialog.c' object='uget_gtk-UgtkSettingDialog.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkSettingDialog.obj `if test -f 'UgtkSettingDialog.c'; then $(CYGPATH_W) 'UgtkSettingDialog.c'; else $(CYGPATH_W) '$(srcdir)/UgtkSettingDialog.c'; fi` uget_gtk-UgtkConfirmDialog.o: UgtkConfirmDialog.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkConfirmDialog.o -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkConfirmDialog.Tpo -c -o uget_gtk-UgtkConfirmDialog.o `test -f 'UgtkConfirmDialog.c' || echo '$(srcdir)/'`UgtkConfirmDialog.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkConfirmDialog.Tpo $(DEPDIR)/uget_gtk-UgtkConfirmDialog.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkConfirmDialog.c' object='uget_gtk-UgtkConfirmDialog.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkConfirmDialog.o `test -f 'UgtkConfirmDialog.c' || echo '$(srcdir)/'`UgtkConfirmDialog.c uget_gtk-UgtkConfirmDialog.obj: UgtkConfirmDialog.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkConfirmDialog.obj -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkConfirmDialog.Tpo -c -o uget_gtk-UgtkConfirmDialog.obj `if test -f 'UgtkConfirmDialog.c'; then $(CYGPATH_W) 'UgtkConfirmDialog.c'; else $(CYGPATH_W) '$(srcdir)/UgtkConfirmDialog.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkConfirmDialog.Tpo $(DEPDIR)/uget_gtk-UgtkConfirmDialog.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkConfirmDialog.c' object='uget_gtk-UgtkConfirmDialog.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkConfirmDialog.obj `if test -f 'UgtkConfirmDialog.c'; then $(CYGPATH_W) 'UgtkConfirmDialog.c'; else $(CYGPATH_W) '$(srcdir)/UgtkConfirmDialog.c'; fi` uget_gtk-UgtkAboutDialog.o: UgtkAboutDialog.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkAboutDialog.o -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkAboutDialog.Tpo -c -o uget_gtk-UgtkAboutDialog.o `test -f 'UgtkAboutDialog.c' || echo '$(srcdir)/'`UgtkAboutDialog.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkAboutDialog.Tpo $(DEPDIR)/uget_gtk-UgtkAboutDialog.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkAboutDialog.c' object='uget_gtk-UgtkAboutDialog.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkAboutDialog.o `test -f 'UgtkAboutDialog.c' || echo '$(srcdir)/'`UgtkAboutDialog.c uget_gtk-UgtkAboutDialog.obj: UgtkAboutDialog.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkAboutDialog.obj -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkAboutDialog.Tpo -c -o uget_gtk-UgtkAboutDialog.obj `if test -f 'UgtkAboutDialog.c'; then $(CYGPATH_W) 'UgtkAboutDialog.c'; else $(CYGPATH_W) '$(srcdir)/UgtkAboutDialog.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkAboutDialog.Tpo $(DEPDIR)/uget_gtk-UgtkAboutDialog.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkAboutDialog.c' object='uget_gtk-UgtkAboutDialog.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkAboutDialog.obj `if test -f 'UgtkAboutDialog.c'; then $(CYGPATH_W) 'UgtkAboutDialog.c'; else $(CYGPATH_W) '$(srcdir)/UgtkAboutDialog.c'; fi` uget_gtk-UgtkMenubar.o: UgtkMenubar.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkMenubar.o -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkMenubar.Tpo -c -o uget_gtk-UgtkMenubar.o `test -f 'UgtkMenubar.c' || echo '$(srcdir)/'`UgtkMenubar.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkMenubar.Tpo $(DEPDIR)/uget_gtk-UgtkMenubar.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkMenubar.c' object='uget_gtk-UgtkMenubar.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkMenubar.o `test -f 'UgtkMenubar.c' || echo '$(srcdir)/'`UgtkMenubar.c uget_gtk-UgtkMenubar.obj: UgtkMenubar.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkMenubar.obj -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkMenubar.Tpo -c -o uget_gtk-UgtkMenubar.obj `if test -f 'UgtkMenubar.c'; then $(CYGPATH_W) 'UgtkMenubar.c'; else $(CYGPATH_W) '$(srcdir)/UgtkMenubar.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkMenubar.Tpo $(DEPDIR)/uget_gtk-UgtkMenubar.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkMenubar.c' object='uget_gtk-UgtkMenubar.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkMenubar.obj `if test -f 'UgtkMenubar.c'; then $(CYGPATH_W) 'UgtkMenubar.c'; else $(CYGPATH_W) '$(srcdir)/UgtkMenubar.c'; fi` uget_gtk-UgtkMenubar-ui.o: UgtkMenubar-ui.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkMenubar-ui.o -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkMenubar-ui.Tpo -c -o uget_gtk-UgtkMenubar-ui.o `test -f 'UgtkMenubar-ui.c' || echo '$(srcdir)/'`UgtkMenubar-ui.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkMenubar-ui.Tpo $(DEPDIR)/uget_gtk-UgtkMenubar-ui.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkMenubar-ui.c' object='uget_gtk-UgtkMenubar-ui.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkMenubar-ui.o `test -f 'UgtkMenubar-ui.c' || echo '$(srcdir)/'`UgtkMenubar-ui.c uget_gtk-UgtkMenubar-ui.obj: UgtkMenubar-ui.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkMenubar-ui.obj -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkMenubar-ui.Tpo -c -o uget_gtk-UgtkMenubar-ui.obj `if test -f 'UgtkMenubar-ui.c'; then $(CYGPATH_W) 'UgtkMenubar-ui.c'; else $(CYGPATH_W) '$(srcdir)/UgtkMenubar-ui.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkMenubar-ui.Tpo $(DEPDIR)/uget_gtk-UgtkMenubar-ui.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkMenubar-ui.c' object='uget_gtk-UgtkMenubar-ui.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkMenubar-ui.obj `if test -f 'UgtkMenubar-ui.c'; then $(CYGPATH_W) 'UgtkMenubar-ui.c'; else $(CYGPATH_W) '$(srcdir)/UgtkMenubar-ui.c'; fi` uget_gtk-UgtkApp.o: UgtkApp.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkApp.o -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkApp.Tpo -c -o uget_gtk-UgtkApp.o `test -f 'UgtkApp.c' || echo '$(srcdir)/'`UgtkApp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkApp.Tpo $(DEPDIR)/uget_gtk-UgtkApp.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkApp.c' object='uget_gtk-UgtkApp.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkApp.o `test -f 'UgtkApp.c' || echo '$(srcdir)/'`UgtkApp.c uget_gtk-UgtkApp.obj: UgtkApp.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkApp.obj -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkApp.Tpo -c -o uget_gtk-UgtkApp.obj `if test -f 'UgtkApp.c'; then $(CYGPATH_W) 'UgtkApp.c'; else $(CYGPATH_W) '$(srcdir)/UgtkApp.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkApp.Tpo $(DEPDIR)/uget_gtk-UgtkApp.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkApp.c' object='uget_gtk-UgtkApp.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkApp.obj `if test -f 'UgtkApp.c'; then $(CYGPATH_W) 'UgtkApp.c'; else $(CYGPATH_W) '$(srcdir)/UgtkApp.c'; fi` uget_gtk-UgtkApp-ui.o: UgtkApp-ui.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkApp-ui.o -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkApp-ui.Tpo -c -o uget_gtk-UgtkApp-ui.o `test -f 'UgtkApp-ui.c' || echo '$(srcdir)/'`UgtkApp-ui.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkApp-ui.Tpo $(DEPDIR)/uget_gtk-UgtkApp-ui.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkApp-ui.c' object='uget_gtk-UgtkApp-ui.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkApp-ui.o `test -f 'UgtkApp-ui.c' || echo '$(srcdir)/'`UgtkApp-ui.c uget_gtk-UgtkApp-ui.obj: UgtkApp-ui.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkApp-ui.obj -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkApp-ui.Tpo -c -o uget_gtk-UgtkApp-ui.obj `if test -f 'UgtkApp-ui.c'; then $(CYGPATH_W) 'UgtkApp-ui.c'; else $(CYGPATH_W) '$(srcdir)/UgtkApp-ui.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkApp-ui.Tpo $(DEPDIR)/uget_gtk-UgtkApp-ui.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkApp-ui.c' object='uget_gtk-UgtkApp-ui.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkApp-ui.obj `if test -f 'UgtkApp-ui.c'; then $(CYGPATH_W) 'UgtkApp-ui.c'; else $(CYGPATH_W) '$(srcdir)/UgtkApp-ui.c'; fi` uget_gtk-UgtkApp-callback.o: UgtkApp-callback.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkApp-callback.o -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkApp-callback.Tpo -c -o uget_gtk-UgtkApp-callback.o `test -f 'UgtkApp-callback.c' || echo '$(srcdir)/'`UgtkApp-callback.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkApp-callback.Tpo $(DEPDIR)/uget_gtk-UgtkApp-callback.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkApp-callback.c' object='uget_gtk-UgtkApp-callback.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkApp-callback.o `test -f 'UgtkApp-callback.c' || echo '$(srcdir)/'`UgtkApp-callback.c uget_gtk-UgtkApp-callback.obj: UgtkApp-callback.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkApp-callback.obj -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkApp-callback.Tpo -c -o uget_gtk-UgtkApp-callback.obj `if test -f 'UgtkApp-callback.c'; then $(CYGPATH_W) 'UgtkApp-callback.c'; else $(CYGPATH_W) '$(srcdir)/UgtkApp-callback.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkApp-callback.Tpo $(DEPDIR)/uget_gtk-UgtkApp-callback.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkApp-callback.c' object='uget_gtk-UgtkApp-callback.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkApp-callback.obj `if test -f 'UgtkApp-callback.c'; then $(CYGPATH_W) 'UgtkApp-callback.c'; else $(CYGPATH_W) '$(srcdir)/UgtkApp-callback.c'; fi` uget_gtk-UgtkApp-timeout.o: UgtkApp-timeout.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkApp-timeout.o -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkApp-timeout.Tpo -c -o uget_gtk-UgtkApp-timeout.o `test -f 'UgtkApp-timeout.c' || echo '$(srcdir)/'`UgtkApp-timeout.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkApp-timeout.Tpo $(DEPDIR)/uget_gtk-UgtkApp-timeout.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkApp-timeout.c' object='uget_gtk-UgtkApp-timeout.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkApp-timeout.o `test -f 'UgtkApp-timeout.c' || echo '$(srcdir)/'`UgtkApp-timeout.c uget_gtk-UgtkApp-timeout.obj: UgtkApp-timeout.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkApp-timeout.obj -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkApp-timeout.Tpo -c -o uget_gtk-UgtkApp-timeout.obj `if test -f 'UgtkApp-timeout.c'; then $(CYGPATH_W) 'UgtkApp-timeout.c'; else $(CYGPATH_W) '$(srcdir)/UgtkApp-timeout.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkApp-timeout.Tpo $(DEPDIR)/uget_gtk-UgtkApp-timeout.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkApp-timeout.c' object='uget_gtk-UgtkApp-timeout.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkApp-timeout.obj `if test -f 'UgtkApp-timeout.c'; then $(CYGPATH_W) 'UgtkApp-timeout.c'; else $(CYGPATH_W) '$(srcdir)/UgtkApp-timeout.c'; fi` uget_gtk-UgtkApp-main.o: UgtkApp-main.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkApp-main.o -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkApp-main.Tpo -c -o uget_gtk-UgtkApp-main.o `test -f 'UgtkApp-main.c' || echo '$(srcdir)/'`UgtkApp-main.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkApp-main.Tpo $(DEPDIR)/uget_gtk-UgtkApp-main.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkApp-main.c' object='uget_gtk-UgtkApp-main.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkApp-main.o `test -f 'UgtkApp-main.c' || echo '$(srcdir)/'`UgtkApp-main.c uget_gtk-UgtkApp-main.obj: UgtkApp-main.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -MT uget_gtk-UgtkApp-main.obj -MD -MP -MF $(DEPDIR)/uget_gtk-UgtkApp-main.Tpo -c -o uget_gtk-UgtkApp-main.obj `if test -f 'UgtkApp-main.c'; then $(CYGPATH_W) 'UgtkApp-main.c'; else $(CYGPATH_W) '$(srcdir)/UgtkApp-main.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uget_gtk-UgtkApp-main.Tpo $(DEPDIR)/uget_gtk-UgtkApp-main.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UgtkApp-main.c' object='uget_gtk-UgtkApp-main.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uget_gtk_CPPFLAGS) $(CPPFLAGS) $(uget_gtk_CFLAGS) $(CFLAGS) -c -o uget_gtk-UgtkApp-main.obj `if test -f 'UgtkApp-main.c'; then $(CYGPATH_W) 'UgtkApp-main.c'; else $(CYGPATH_W) '$(srcdir)/UgtkApp-main.c'; fi` ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files 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 check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(bindir)"; 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: 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-am clean-am: clean-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS 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 -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \ distclean distclean-compile distclean-generic distclean-tags \ distdir dvi dvi-am html html-am info info-am install \ install-am install-binPROGRAMS 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 maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am \ uninstall-binPROGRAMS .PRECIOUS: 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: uget-2.2.0/ui-gtk/UgtkMenubar.c0000644000175000000120000007701213224532612013165 00000000000000/* * * Copyright (C) 2012-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #if defined _WIN32 || defined _WIN64 #include #include // ShellExecuteW() #endif #include #include #include #include #include #include #include #include // ---------------------------------------------------------------------------- // UgtkFileMenu static void on_create_download (GtkWidget* widget, UgtkApp* app) { ugtk_app_create_download (app, NULL, NULL); } static void on_offline_mode (GtkWidget* widget, UgtkApp* app) { UgetNode* cnode; gboolean offline; offline = gtk_check_menu_item_get_active ((GtkCheckMenuItem*) widget); app->setting.offline_mode = offline; // trayicon menu offline = gtk_check_menu_item_get_active ( (GtkCheckMenuItem*) app->trayicon.menu.offline_mode); if (offline != app->setting.offline_mode) { gtk_check_menu_item_set_active ( (GtkCheckMenuItem*) app->trayicon.menu.offline_mode, app->setting.offline_mode); } if (app->setting.offline_mode) { for (cnode = app->real.children; cnode; cnode = cnode->next) uget_app_stop_category ((UgetApp*)app, cnode); app->user_action = TRUE; } } // ---------------------------------------------------------------------------- // UgtkEditMenu static void on_clipboard_monitor (GtkWidget* widget, UgtkApp* app) { gboolean active; active = gtk_check_menu_item_get_active ((GtkCheckMenuItem*) widget); app->setting.clipboard.monitor = active; app->trayicon.menu.emission = FALSE; gtk_check_menu_item_set_active ( (GtkCheckMenuItem*) app->trayicon.menu.clipboard_monitor, active); app->trayicon.menu.emission = TRUE; } static void on_clipboard_quiet (GtkWidget* widget, UgtkApp* app) { gboolean active; active = gtk_check_menu_item_get_active ((GtkCheckMenuItem*) widget); app->setting.clipboard.quiet = active; app->trayicon.menu.emission = FALSE; gtk_check_menu_item_set_active ( (GtkCheckMenuItem*) app->trayicon.menu.clipboard_quiet, active); app->trayicon.menu.emission = TRUE; } static void on_commandline_quiet (GtkWidget* widget, UgtkApp* app) { gboolean active; active = gtk_check_menu_item_get_active ((GtkCheckMenuItem*) widget); app->setting.commandline.quiet = active; app->trayicon.menu.emission = FALSE; gtk_check_menu_item_set_active ( (GtkCheckMenuItem*) app->trayicon.menu.commandline_quiet, active); app->trayicon.menu.emission = TRUE; } static void on_skip_existing (GtkWidget* widget, UgtkApp* app) { gboolean active; active = gtk_check_menu_item_get_active ((GtkCheckMenuItem*) widget); app->setting.ui.skip_existing = active; app->trayicon.menu.emission = FALSE; gtk_check_menu_item_set_active ( (GtkCheckMenuItem*) app->trayicon.menu.skip_existing, active); app->trayicon.menu.emission = TRUE; } static void on_apply_recent (GtkWidget* widget, UgtkApp* app) { gboolean active; active = gtk_check_menu_item_get_active ((GtkCheckMenuItem*) widget); app->setting.ui.apply_recent = active; app->trayicon.menu.emission = FALSE; gtk_check_menu_item_set_active ( (GtkCheckMenuItem*) app->trayicon.menu.apply_recent, active); app->trayicon.menu.emission = TRUE; } static void on_config_completion (GtkWidget* widget, UgtkApp* app) { if (widget == app->menubar.edit.completion.disable) app->setting.completion.action = 0; else if (widget == app->menubar.edit.completion.hibernate) app->setting.completion.action = 1; else if (widget == app->menubar.edit.completion.suspend) app->setting.completion.action = 2; else if (widget == app->menubar.edit.completion.shutdown) app->setting.completion.action = 3; else if (widget == app->menubar.edit.completion.reboot) app->setting.completion.action = 4; else if (widget == app->menubar.edit.completion.custom) app->setting.completion.action = 5; } static void on_config_completion_remember (GtkWidget* widget, UgtkApp* app) { gboolean remember; remember = gtk_check_menu_item_get_active ((GtkCheckMenuItem*) widget); app->setting.completion.remember = remember; } static void on_config_completion_help (GtkWidget* widget, UgtkApp* app) { ugtk_launch_uri ("http://ugetdm.com/documentation/on-complete"); } static void on_config_settings (GtkWidget* widget, UgtkApp* app) { UgtkSettingDialog* sdialog; gchar* title; if (app->dialogs.setting) { gtk_window_present ((GtkWindow*) app->dialogs.setting); return; } title = g_strconcat (UGTK_APP_NAME " - ", _("Settings"), NULL); sdialog = ugtk_setting_dialog_new (title, app->window.self); g_free (title); ugtk_setting_dialog_set (sdialog, &app->setting); app->dialogs.setting = (GtkWidget*) sdialog->self; // set page // ugtk_setting_dialog_set_page (sdialog, UGTK_SETTING_PAGE_UI); // show settings dialog ugtk_setting_dialog_run (sdialog, app); } // ---------------------------------------------------------------------------- // UgtkViewMenu // static void on_change_visible_widget (GtkWidget* widget, UgtkApp* app) { struct UgtkWindowSetting* setting; GtkWidget* temp; gboolean visible; setting = &app->setting.window; visible = gtk_check_menu_item_get_active ((GtkCheckMenuItem*) widget); // Toolbar if (widget == app->menubar.view.toolbar) { setting->toolbar = visible; gtk_widget_set_visible (app->toolbar.self, visible); return; } // Statusbar if (widget == app->menubar.view.statusbar) { setting->statusbar = visible; gtk_widget_set_visible ((GtkWidget*) app->statusbar.self, visible); return; } // Category if (widget == app->menubar.view.category) { setting->category = visible; temp = gtk_paned_get_child1 (app->window.hpaned); gtk_widget_set_visible (temp, visible); return; } // Summary if (widget == app->menubar.view.summary) { setting->summary = visible; gtk_widget_set_visible (app->summary.self, visible); return; } } static void on_change_visible_summary (GtkWidget* widget, UgtkApp* app) { struct UgtkSummarySetting* setting; gboolean visible; setting = &app->setting.summary; visible = gtk_check_menu_item_get_active ((GtkCheckMenuItem*) widget); // which widget if (widget == app->menubar.view.summary_items.name) { setting->name = visible; app->summary.visible.name = visible; } else if (widget == app->menubar.view.summary_items.folder) { setting->folder = visible; app->summary.visible.folder = visible; } else if (widget == app->menubar.view.summary_items.category) { setting->category = visible; app->summary.visible.category = visible; } else if (widget == app->menubar.view.summary_items.uri) { setting->uri = visible; app->summary.visible.uri = visible; } else if (widget == app->menubar.view.summary_items.message) { setting->message = visible; app->summary.visible.message = visible; } ugtk_summary_show (&app->summary, app->traveler.download.cursor.node); } static void on_change_visible_column (GtkWidget* widget, UgtkApp* app) { struct UgtkDownloadColumnSetting* setting; UgtkTraveler* traveler; GtkTreeViewColumn* column; gboolean visible; gint column_index; setting = &app->setting.download_column; traveler = &app->traveler; visible = gtk_check_menu_item_get_active ((GtkCheckMenuItem*) widget); // which widget if (widget == app->menubar.view.columns.complete) { column_index = UGTK_NODE_COLUMN_COMPLETE; setting->complete = visible; } else if (widget == app->menubar.view.columns.total) { column_index = UGTK_NODE_COLUMN_TOTAL; setting->total = visible; } else if (widget == app->menubar.view.columns.percent) { column_index = UGTK_NODE_COLUMN_PERCENT; setting->percent = visible; } else if (widget == app->menubar.view.columns.elapsed) { column_index = UGTK_NODE_COLUMN_ELAPSED; setting->elapsed = visible; } else if (widget == app->menubar.view.columns.left) { column_index = UGTK_NODE_COLUMN_LEFT; setting->left = visible; } else if (widget == app->menubar.view.columns.speed) { column_index = UGTK_NODE_COLUMN_SPEED; setting->speed = visible; } else if (widget == app->menubar.view.columns.upload_speed) { column_index = UGTK_NODE_COLUMN_UPLOAD_SPEED; setting->upload_speed = visible; } else if (widget == app->menubar.view.columns.uploaded) { column_index = UGTK_NODE_COLUMN_UPLOADED; setting->uploaded = visible; } else if (widget == app->menubar.view.columns.ratio) { column_index = UGTK_NODE_COLUMN_RATIO; setting->ratio = visible; } else if (widget == app->menubar.view.columns.retry) { column_index = UGTK_NODE_COLUMN_RETRY; setting->retry = visible; } else if (widget == app->menubar.view.columns.category) { column_index = UGTK_NODE_COLUMN_CATEGORY; setting->category = visible; } else if (widget == app->menubar.view.columns.uri) { column_index = UGTK_NODE_COLUMN_URI; setting->uri = visible; } else if (widget == app->menubar.view.columns.added_on) { column_index = UGTK_NODE_COLUMN_ADDED_ON; setting->added_on = visible; } else if (widget == app->menubar.view.columns.completed_on) { column_index = UGTK_NODE_COLUMN_COMPLETED_ON; setting->completed_on = visible; } else return; column = gtk_tree_view_get_column (traveler->download.view, column_index); gtk_tree_view_column_set_visible (column, visible); } // ---------------------------------------------------------------------------- // UgtkCategoryMenu static void on_move_category_up (GtkWidget* widget, UgtkApp* app) { UgetNode* cnode; GtkTreeIter iter1, iter2; GtkTreePath *path1, *path2; cnode = app->traveler.category.cursor.node->data; if (cnode == NULL || cnode->prev == NULL) return; iter1.stamp = app->traveler.category.model->stamp; iter2.stamp = app->traveler.category.model->stamp; iter1.user_data = cnode; iter2.user_data = cnode->prev; uget_app_move_category ((UgetApp*) app, cnode, cnode->prev); ugtk_traveler_select_category (&app->traveler, app->traveler.category.cursor.pos -1, -1); gtk_widget_queue_draw ((GtkWidget*) app->traveler.category.view); // emit signal "row-changed" path1 = gtk_tree_model_get_path (GTK_TREE_MODEL (app->traveler.category.model), &iter1); path2 = gtk_tree_model_get_path (GTK_TREE_MODEL (app->traveler.category.model), &iter2); gtk_tree_model_row_changed (GTK_TREE_MODEL (app->traveler.category.model), path1, &iter1); gtk_tree_model_row_changed (GTK_TREE_MODEL (app->traveler.category.model), path2, &iter2); gtk_tree_path_free (path1); gtk_tree_path_free (path2); } static void on_move_category_down (GtkWidget* widget, UgtkApp* app) { UgetNode* cnode; GtkTreeIter iter1, iter2; GtkTreePath *path1, *path2; cnode = app->traveler.category.cursor.node->data; if (cnode == NULL || cnode->next == NULL) return; iter1.stamp = app->traveler.category.model->stamp; iter2.stamp = app->traveler.category.model->stamp; iter1.user_data = cnode; iter2.user_data = cnode->next; uget_app_move_category ((UgetApp*) app, cnode, cnode->next->next); ugtk_traveler_select_category (&app->traveler, app->traveler.category.cursor.pos +1, -1); gtk_widget_queue_draw ((GtkWidget*) app->traveler.category.view); // emit signal "row-changed" path1 = gtk_tree_model_get_path (GTK_TREE_MODEL (app->traveler.category.model), &iter1); path2 = gtk_tree_model_get_path (GTK_TREE_MODEL (app->traveler.category.model), &iter2); gtk_tree_model_row_changed (GTK_TREE_MODEL (app->traveler.category.model), path1, &iter1); gtk_tree_model_row_changed (GTK_TREE_MODEL (app->traveler.category.model), path2, &iter2); gtk_tree_path_free (path1); gtk_tree_path_free (path2); } static void on_delete_category (GtkWidget* widget, UgtkApp* app) { UgtkConfirmDialog* cdialog; // confirm to delete category cdialog = ugtk_confirm_dialog_new (UGTK_CONFIRM_DIALOG_DELETE_CATEGORY, app); ugtk_confirm_dialog_run (cdialog); } // ---------------------------------------------------------------------------- // UgtkDownloadMenu static void on_delete_download (GtkWidget* widget, UgtkApp* app) { ugtk_app_delete_download (app, FALSE); } static void on_delete_download_file (GtkWidget* widget, UgtkApp* app) { UgtkConfirmDialog* cdialog; if (app->setting.ui.delete_confirmation == FALSE) ugtk_app_delete_download (app, TRUE); else { // confirm to delete cdialog = ugtk_confirm_dialog_new(UGTK_CONFIRM_DIALOG_DELETE, app); ugtk_confirm_dialog_run (cdialog); } } static void on_open_download_file (GtkWidget* widget, UgtkApp* app) { UgetCommon* common; UgetNode* node; GtkWidget* dialog; gchar* string; node = app->traveler.download.cursor.node; if (node == NULL) return; node = node->data; common = ug_info_get (&node->info, UgetCommonInfo); if (common == NULL || common->folder == NULL || common->file == NULL) return; if (ugtk_launch_default_app (common->folder, common->file) == FALSE) { string = g_strdup_printf (_("Can't launch default application for file '%s'."), common->file); dialog = gtk_message_dialog_new (app->window.self, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "%s", string); g_free (string); string = g_strconcat (UGTK_APP_NAME " - ", _("Error"), NULL); gtk_window_set_title ((GtkWindow*) dialog, string); g_free (string); g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL); gtk_widget_show ((GtkWidget*) dialog); } } static void on_open_download_folder (GtkWidget* widget, UgtkApp* app) { UgetCommon* common; UgetNode* node; GtkWidget* dialog; gchar* string; node = app->traveler.download.cursor.node; if (node == NULL) return; node = node->data; common = ug_info_get (&node->info, UgetCommonInfo); if (common == NULL || common->folder == NULL) return; string = g_filename_from_utf8 (common->folder, -1, NULL, NULL, NULL); if (g_file_test (string, G_FILE_TEST_EXISTS) == FALSE) { g_free (string); string = g_strdup_printf (_("'%s' - This folder does not exist."), common->folder); dialog = gtk_message_dialog_new (app->window.self, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "%s", string); g_free (string); string = g_strconcat (UGTK_APP_NAME " - ", _("Error"), NULL); gtk_window_set_title ((GtkWindow*) dialog, string); g_free (string); g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL); gtk_widget_show ((GtkWidget*) dialog); return; } g_free (string); #if defined _WIN32 || defined _WIN64 { UgUri uuri; gchar* path; gchar* argument; gunichar2* argument_os; if (common->file == NULL && common->uri) { ug_uri_init (&uuri, common->uri); if (uuri.file == -1) argument = NULL; else { argument = g_strndup (uuri.uri + uuri.file, ug_uri_file (&uuri, NULL)); } path = g_build_filename (common->folder, argument, NULL); g_free (argument); } else path = g_build_filename (common->folder, common->file, NULL); if (g_file_test (path, G_FILE_TEST_EXISTS)) argument = g_strconcat ("/e,/select,\"", path, "\"", NULL); else argument = g_strconcat ("/e,\"", common->folder, "\"", NULL); g_free (path); argument_os = g_utf8_to_utf16 (argument, -1, NULL, NULL, NULL); g_free (argument); ShellExecuteW (NULL, NULL, L"explorer", argument_os, NULL, SW_SHOW); g_free (argument_os); } #else { GError* error = NULL; GFile* gfile; gchar* uri; gfile = g_file_new_for_path (common->folder); uri = g_file_get_uri (gfile); g_object_unref (gfile); g_app_info_launch_default_for_uri (uri, NULL, &error); g_free (uri); if (error) g_error_free (error); } #endif } static void on_set_download_force_start (GtkWidget* widget, UgtkApp* app) { UgetNode* node; UgetNode* cursor; GList* list; GList* link; list = ugtk_traveler_get_selected (&app->traveler); cursor = app->traveler.download.cursor.node->data; for (link = list; link; link = link->next) { node = link->data; node = node->data; link->data = node; uget_app_activate_download ((UgetApp*) app, node->data); } if (app->traveler.state.cursor.pos == 0) { ugtk_traveler_set_cursor (&app->traveler, cursor); ugtk_traveler_set_selected (&app->traveler, list); } g_list_free (list); // refresh other data & status gtk_widget_queue_draw ((GtkWidget*) app->traveler.category.view); gtk_widget_queue_draw ((GtkWidget*) app->traveler.state.view); // ugtk_summary_show (&app->summary, app->traveler.download.cursor.node); } static void on_set_download_runnable (GtkWidget* widget, UgtkApp* app) { ugtk_app_queue_download (app, TRUE); } // UgtkMenubar.download.move_to static void on_move_download (GtkWidget* widget, UgtkApp* app) { GPtrArray* array; UgetNode* cnode; UgetNode* dnode; GList* list; GList* link; guint index; array = app->menubar.download.move_to.array; cnode = NULL; for (index = 0; index < array->len; index += 2) { if (widget == g_ptr_array_index (array, index)) { cnode = g_ptr_array_index (array, index + 1); break; } } if (cnode == NULL || cnode == app->traveler.category.cursor.node->data) return; // if current category is "All" if (app->traveler.category.cursor.pos == 0) ugtk_traveler_reserve_selection (&app->traveler); list = ugtk_traveler_get_selected (&app->traveler); for (link = list; link; link = link->next) { dnode = link->data; dnode = dnode->data; uget_app_move_download_to ((UgetApp*) app, dnode, cnode->data); } g_list_free (list); // refresh gtk_widget_queue_draw ((GtkWidget*) app->traveler.category.view); gtk_widget_queue_draw ((GtkWidget*) app->traveler.state.view); // if current category is "All" if (app->traveler.category.cursor.pos == 0) ugtk_traveler_restore_selection (&app->traveler); } // UgtkMenubar.download.prioriy static void on_set_download_prioriy (GtkWidget* widget, UgtkApp* app) { UgetPriority priority; UgetRelation* relation; UgetNode* node; GList* list; GList* link; if (widget == app->menubar.download.prioriy.high) priority = UGET_PRIORITY_HIGH; else if (widget == app->menubar.download.prioriy.normal) priority = UGET_PRIORITY_NORMAL; else priority = UGET_PRIORITY_LOW; list = ugtk_traveler_get_selected (&app->traveler); for (link = list; link; link = link->next) { node = link->data; node = node->data; relation = ug_info_realloc (&node->info, UgetRelationInfo); relation->task.priority = priority; } g_list_free (list); } // ---------------------------------------------------------------------------- // UgtkHelpMenu // static void on_help_online (GtkWidget* widget, UgtkApp* app) { ugtk_launch_uri ("http://ugetdm.com/help"); } static void on_documentation (GtkWidget* widget, UgtkApp* app) { ugtk_launch_uri ("http://ugetdm.com/documentation"); } static void on_support_forum (GtkWidget* widget, UgtkApp* app) { ugtk_launch_uri ("http://ugetdm.com/forum/"); } static void on_submit_feedback (GtkWidget* widget, UgtkApp* app) { ugtk_launch_uri ("http://ugetdm.com/feedback"); } static void on_report_bug (GtkWidget* widget, UgtkApp* app) { ugtk_launch_uri ("http://ugetdm.com/reportbug"); } static void on_keyboard_shortcuts (GtkWidget* widget, UgtkApp* app) { ugtk_launch_uri ("http://ugetdm.com/keyboard-shortcuts"); } static void on_check_updates (GtkWidget* widget, UgtkApp* app) { ugtk_launch_uri ("http://ugetdm.com/versioncheck?v=" PACKAGE_VERSION); } static void on_about (GtkWidget* widget, UgtkApp* app) { UgtkAboutDialog* adialog; adialog = ugtk_about_dialog_new (app->window.self); // if (app->update_info.ready) // ugtk_about_dialog_set_info (adialog, app->update_info.text->str); ugtk_about_dialog_run (adialog); } // ---------------------------------------------------------------------------- // UgtkMenubar void ugtk_menubar_init_callback (UgtkMenubar* menubar, UgtkApp* app) { // ---------------------------------------------------- // UgtkFileMenu g_signal_connect (menubar->file.create_download, "activate", G_CALLBACK (on_create_download), app); g_signal_connect_swapped (menubar->file.create_category, "activate", G_CALLBACK (ugtk_app_create_category), app); g_signal_connect_swapped (menubar->file.create_torrent, "activate", G_CALLBACK (ugtk_app_create_torrent), app); g_signal_connect_swapped (menubar->file.create_metalink, "activate", G_CALLBACK (ugtk_app_create_metalink), app); g_signal_connect_swapped (menubar->file.batch.clipboard, "activate", G_CALLBACK (ugtk_app_clipboard_batch), app); g_signal_connect_swapped (menubar->file.batch.sequence, "activate", G_CALLBACK (ugtk_app_sequence_batch), app); g_signal_connect_swapped (menubar->file.batch.text_import, "activate", G_CALLBACK (ugtk_app_import_text_file), app); g_signal_connect_swapped (menubar->file.batch.html_import, "activate", G_CALLBACK (ugtk_app_import_html_file), app); g_signal_connect_swapped (menubar->file.batch.text_export, "activate", G_CALLBACK (ugtk_app_export_text_file), app); g_signal_connect_swapped (menubar->file.open_category, "activate", G_CALLBACK (ugtk_app_load_category), app); g_signal_connect_swapped (menubar->file.save_category, "activate", G_CALLBACK (ugtk_app_save_category), app); g_signal_connect_swapped (menubar->file.save, "activate", G_CALLBACK (ugtk_app_save), app); g_signal_connect (menubar->file.offline_mode, "toggled", G_CALLBACK (on_offline_mode), app); g_signal_connect_swapped (menubar->file.quit, "activate", G_CALLBACK (ugtk_app_decide_to_quit), app); // ---------------------------------------------------- // UgtkEditMenu g_signal_connect (menubar->edit.clipboard_monitor, "activate", G_CALLBACK (on_clipboard_monitor), app); g_signal_connect (menubar->edit.clipboard_quiet, "activate", G_CALLBACK (on_clipboard_quiet), app); g_signal_connect (menubar->edit.commandline_quiet, "activate", G_CALLBACK (on_commandline_quiet), app); g_signal_connect (menubar->edit.skip_existing, "activate", G_CALLBACK (on_skip_existing), app); g_signal_connect (menubar->edit.apply_recent, "activate", G_CALLBACK (on_apply_recent), app); g_signal_connect (menubar->edit.completion.disable, "activate", G_CALLBACK (on_config_completion), app); g_signal_connect (menubar->edit.completion.hibernate, "activate", G_CALLBACK (on_config_completion), app); g_signal_connect (menubar->edit.completion.suspend, "activate", G_CALLBACK (on_config_completion), app); g_signal_connect (menubar->edit.completion.shutdown, "activate", G_CALLBACK (on_config_completion), app); g_signal_connect (menubar->edit.completion.reboot, "activate", G_CALLBACK (on_config_completion), app); g_signal_connect (menubar->edit.completion.custom, "activate", G_CALLBACK (on_config_completion), app); g_signal_connect (menubar->edit.completion.remember, "activate", G_CALLBACK (on_config_completion_remember), app); g_signal_connect (menubar->edit.completion.help, "activate", G_CALLBACK (on_config_completion_help), app); g_signal_connect (menubar->edit.settings, "activate", G_CALLBACK (on_config_settings), app); // ---------------------------------------------------- // UgtkViewMenu g_signal_connect (menubar->view.toolbar, "toggled", G_CALLBACK (on_change_visible_widget), app); g_signal_connect (menubar->view.statusbar, "toggled", G_CALLBACK (on_change_visible_widget), app); g_signal_connect (menubar->view.category, "toggled", G_CALLBACK (on_change_visible_widget), app); g_signal_connect (menubar->view.summary, "toggled", G_CALLBACK (on_change_visible_widget), app); // summary items g_signal_connect (menubar->view.summary_items.name, "toggled", G_CALLBACK (on_change_visible_summary), app); g_signal_connect (menubar->view.summary_items.folder, "toggled", G_CALLBACK (on_change_visible_summary), app); g_signal_connect (menubar->view.summary_items.category, "toggled", G_CALLBACK (on_change_visible_summary), app); g_signal_connect (menubar->view.summary_items.uri, "toggled", G_CALLBACK (on_change_visible_summary), app); g_signal_connect (menubar->view.summary_items.message, "toggled", G_CALLBACK (on_change_visible_summary), app); // download columns g_signal_connect (menubar->view.columns.complete, "toggled", G_CALLBACK (on_change_visible_column), app); g_signal_connect (menubar->view.columns.total, "toggled", G_CALLBACK (on_change_visible_column), app); g_signal_connect (menubar->view.columns.percent, "toggled", G_CALLBACK (on_change_visible_column), app); g_signal_connect (menubar->view.columns.elapsed, "toggled", G_CALLBACK (on_change_visible_column), app); g_signal_connect (menubar->view.columns.left, "toggled", G_CALLBACK (on_change_visible_column), app); g_signal_connect (menubar->view.columns.speed, "toggled", G_CALLBACK (on_change_visible_column), app); g_signal_connect (menubar->view.columns.upload_speed, "toggled", G_CALLBACK (on_change_visible_column), app); g_signal_connect (menubar->view.columns.uploaded, "toggled", G_CALLBACK (on_change_visible_column), app); g_signal_connect (menubar->view.columns.ratio, "toggled", G_CALLBACK (on_change_visible_column), app); g_signal_connect (menubar->view.columns.retry, "toggled", G_CALLBACK (on_change_visible_column), app); g_signal_connect (menubar->view.columns.category, "toggled", G_CALLBACK (on_change_visible_column), app); g_signal_connect (menubar->view.columns.uri, "toggled", G_CALLBACK (on_change_visible_column), app); g_signal_connect (menubar->view.columns.added_on, "toggled", G_CALLBACK (on_change_visible_column), app); g_signal_connect (menubar->view.columns.completed_on, "toggled", G_CALLBACK (on_change_visible_column), app); // ---------------------------------------------------- // UgtkCategoryMenu g_signal_connect_swapped (menubar->category.create, "activate", G_CALLBACK (ugtk_app_create_category), app); g_signal_connect (menubar->category.delete, "activate", G_CALLBACK (on_delete_category), app); g_signal_connect_swapped (menubar->category.properties, "activate", G_CALLBACK (ugtk_app_edit_category), app); g_signal_connect (menubar->category.move_up, "activate", G_CALLBACK (on_move_category_up), app); g_signal_connect (menubar->category.move_down, "activate", G_CALLBACK (on_move_category_down), app); // ---------------------------------------------------- // UgtkDownloadMenu g_signal_connect (menubar->download.create, "activate", G_CALLBACK (on_create_download), app); g_signal_connect (menubar->download.delete, "activate", G_CALLBACK (on_delete_download), app); // file & folder g_signal_connect (menubar->download.delete_file, "activate", G_CALLBACK (on_delete_download_file), app); g_signal_connect (menubar->download.open, "activate", G_CALLBACK (on_open_download_file), app); g_signal_connect (menubar->download.open_folder, "activate", G_CALLBACK (on_open_download_folder), app); // change status g_signal_connect (menubar->download.force_start, "activate", G_CALLBACK (on_set_download_force_start), app); g_signal_connect (menubar->download.runnable, "activate", G_CALLBACK (on_set_download_runnable), app); g_signal_connect_swapped (menubar->download.pause, "activate", G_CALLBACK (ugtk_app_pause_download), app); // move g_signal_connect_swapped (menubar->download.move_up, "activate", G_CALLBACK (ugtk_app_move_download_up), app); g_signal_connect_swapped (menubar->download.move_down, "activate", G_CALLBACK (ugtk_app_move_download_down), app); g_signal_connect_swapped (menubar->download.move_top, "activate", G_CALLBACK (ugtk_app_move_download_top), app); g_signal_connect_swapped (menubar->download.move_bottom, "activate", G_CALLBACK (ugtk_app_move_download_bottom), app); // prioriy g_signal_connect (menubar->download.prioriy.high, "activate", G_CALLBACK (on_set_download_prioriy), app); g_signal_connect (menubar->download.prioriy.normal, "activate", G_CALLBACK (on_set_download_prioriy), app); g_signal_connect (menubar->download.prioriy.low, "activate", G_CALLBACK (on_set_download_prioriy), app); // properties g_signal_connect_swapped (menubar->download.properties, "activate", G_CALLBACK (ugtk_app_edit_download), app); // ---------------------------------------------------- // UgtkHelpMenu g_signal_connect (menubar->help.help_online, "activate", G_CALLBACK (on_help_online), app); g_signal_connect (menubar->help.documentation, "activate", G_CALLBACK (on_documentation), app); g_signal_connect (menubar->help.support_forum, "activate", G_CALLBACK (on_support_forum), app); g_signal_connect (menubar->help.submit_feedback, "activate", G_CALLBACK (on_submit_feedback), app); g_signal_connect (menubar->help.report_bug, "activate", G_CALLBACK (on_report_bug), app); g_signal_connect (menubar->help.keyboard_shortcuts, "activate", G_CALLBACK (on_keyboard_shortcuts), app); g_signal_connect (menubar->help.check_updates, "activate", G_CALLBACK (on_check_updates), app); g_signal_connect (menubar->help.about_uget, "activate", G_CALLBACK (on_about), app); } void ugtk_menubar_sync_category (UgtkMenubar* menubar, UgtkApp* app, gboolean reset) { UgetNode* cnode; GtkWidget* menu_item; GtkWidget* image; GPtrArray* array; guint index; array = menubar->download.move_to.array; if (reset) { // remove all item for (index = 0; index < array->len; index += 2) { menu_item = g_ptr_array_index (array, index); gtk_container_remove ( (GtkContainer*) menubar->download.move_to.self, menu_item); } g_ptr_array_set_size (array, 0); // add new item for (cnode = app->real.children; cnode; cnode = cnode->next) { // create menu item menu_item = gtk_image_menu_item_new_with_label (cnode->name); image = gtk_image_new_from_stock (GTK_STOCK_DND_MULTIPLE, GTK_ICON_SIZE_MENU); gtk_image_menu_item_set_image ((GtkImageMenuItem*) menu_item, image); gtk_menu_shell_append ( GTK_MENU_SHELL (app->menubar.download.move_to.self), menu_item); g_signal_connect (menu_item, "activate", G_CALLBACK (on_move_download), app); gtk_widget_show (menu_item); g_ptr_array_add (array, menu_item); g_ptr_array_add (array, cnode); } } // set sensitive for (index = 0; index < array->len; index += 2) { menu_item = g_ptr_array_index (array, index); cnode = g_ptr_array_index (array, index +1); if (cnode == app->traveler.category.cursor.node->data) gtk_widget_set_sensitive (menu_item, FALSE); else gtk_widget_set_sensitive (menu_item, TRUE); } } uget-2.2.0/ui-gtk/UgtkSelector.h0000644000175000000120000001026513224532612013356 00000000000000/* * * Copyright (C) 2005-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #ifndef UGTK_SELECTOR_H #define UGTK_SELECTOR_H #include #ifdef __cplusplus extern "C" { #endif typedef struct UgtkSelector UgtkSelector; typedef struct UgtkSelectorPage UgtkSelectorPage; typedef void (*UgtkSelectorNotify) (gpointer user_data, gboolean completed); // ---------------------------------------------------------------------------- // UgtkSelector // struct UgtkSelector { GtkWidget* self; // GtkVBox GtkWindow* parent; // parent window of UgtkSelector.self GtkNotebook* notebook; // GtkWidget* href_label; GtkEntry* href_entry; // entry for hypertext reference GtkWidget* href_separator; // select button GtkWidget* select_all; GtkWidget* select_none; GtkWidget* select_filter; // select by filter // UgtkSelectorPage is placed in array GArray* pages; // UgtkSelectorFilter use UgtkSelectorFilterData in UgtkSelectorPage struct UgtkSelectorFilter { GtkDialog* dialog; GtkTreeView* host_view; GtkTreeView* ext_view; } filter; // callback struct { UgtkSelectorNotify func; gpointer data; } notify; }; void ugtk_selector_init (UgtkSelector* selector, GtkWindow* parent); void ugtk_selector_finalize (UgtkSelector* selector); void ugtk_selector_hide_href (UgtkSelector* selector); // (gchar*) list->data. // To free the returned value, use: // g_list_free_full (list, (GDestroyNotify) g_free); GList* ugtk_selector_get_marked_uris (UgtkSelector* selector); // count marked item and notify gint ugtk_selector_count_marked (UgtkSelector* selector); gint ugtk_selector_n_items (UgtkSelector* selector); UgtkSelectorPage* ugtk_selector_add_page (UgtkSelector* selector, const gchar* title); UgtkSelectorPage* ugtk_selector_get_page (UgtkSelector* selector, gint nth_page); // ---------------------------------------------------------------------------- // UgtkSelectorPage // struct UgtkSelectorPage { GtkWidget* self; // GtkScrolledWindow GtkTreeView* view; GtkListStore* store; // total marked count gint n_marked; // used by UgtkSelectorFilter struct UgtkSelectorFilterData { GHashTable* hash; GtkListStore* host; GtkListStore* ext; } filter; }; void ugtk_selector_page_init (UgtkSelectorPage* page); void ugtk_selector_page_finalize (UgtkSelectorPage* page); // return numbers of uri added int ugtk_selector_page_add_uris (UgtkSelectorPage* page, GList* uris); void ugtk_selector_page_make_filter (UgtkSelectorPage* page); void ugtk_selector_page_mark_by_filter_all (UgtkSelectorPage* page); #ifdef __cplusplus } #endif #endif // End of UGTK_SELECTOR_H uget-2.2.0/ui-gtk/UgtkMenubar-ui.c0000644000175000000120000010616313224532612013600 00000000000000/* * * Copyright (C) 2012-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #include #include #include // UgtkFileMenu static void ugtk_menubar_file_init (UgtkMenubar* menubar, GtkAccelGroup* accel_group) { GtkWidget* image; GtkWidget* menu; GtkWidget* submenu; GtkWidget* menu_item; menu = gtk_menu_new (); menu_item = gtk_menu_item_new_with_mnemonic (_("_File")); gtk_menu_item_set_submenu ((GtkMenuItem*)menu_item, menu); gtk_menu_shell_append ((GtkMenuShell*)menubar->self, menu_item); gtk_menu_set_accel_group ((GtkMenu*)menu, accel_group); // gtk_menu_shell_append ((GtkMenuShell*)menu, gtk_tearoff_menu_item_new() ); // New Download menu_item = gtk_image_menu_item_new_with_mnemonic (_("New _Download...")); gtk_menu_item_set_accel_path ((GtkMenuItem*) menu_item, UGTK_APP_ACCEL_PATH_NEW); #if GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 10 image = gtk_image_new_from_icon_name ("document-new", GTK_ICON_SIZE_MENU); #else image = gtk_image_new_from_stock (GTK_STOCK_NEW, GTK_ICON_SIZE_MENU); #endif gtk_image_menu_item_set_image ((GtkImageMenuItem*)menu_item, image); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); menubar->file.create_download = menu_item; // New Category menu_item = gtk_image_menu_item_new_with_mnemonic (_("New _Category...")); #if GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 10 image = gtk_image_new_from_icon_name ("gtk-dnd-multiple", GTK_ICON_SIZE_MENU); #else image = gtk_image_new_from_stock (GTK_STOCK_DND_MULTIPLE, GTK_ICON_SIZE_MENU); #endif gtk_image_menu_item_set_image ((GtkImageMenuItem*)menu_item, image); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); menubar->file.create_category = menu_item; // separator // gtk_menu_shell_append ((GtkMenuShell*)submenu, gtk_separator_menu_item_new() ); // New Torrent menu_item = gtk_image_menu_item_new_with_mnemonic (_("New Torrent...")); // image = gtk_image_new_from_stock (GTK_STOCK_FILE, GTK_ICON_SIZE_MENU); // gtk_image_menu_item_set_image ((GtkImageMenuItem*)menu_item, image); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); menubar->file.create_torrent = menu_item; // New Metalink menu_item = gtk_image_menu_item_new_with_mnemonic (_("New Metalink...")); // image = gtk_image_new_from_stock (GTK_STOCK_FILE, GTK_ICON_SIZE_MENU); // gtk_image_menu_item_set_image ((GtkImageMenuItem*)menu_item, image); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); menubar->file.create_metalink = menu_item; // Batch Downloads --- start --- menu_item = gtk_image_menu_item_new_with_mnemonic (_("_Batch Downloads")); submenu = gtk_menu_new (); gtk_menu_set_accel_group ((GtkMenu*)submenu, accel_group); gtk_menu_item_set_submenu ((GtkMenuItem*)menu_item, submenu); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); // Batch downloads - Clipboard batch menu_item = gtk_image_menu_item_new_with_mnemonic (_("_Clipboard batch...")); #if GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 10 image = gtk_image_new_from_icon_name ("edit-paste", GTK_ICON_SIZE_MENU); #else image = gtk_image_new_from_stock (GTK_STOCK_PASTE, GTK_ICON_SIZE_MENU); #endif gtk_image_menu_item_set_image ((GtkImageMenuItem*)menu_item, image); gtk_menu_shell_append ((GtkMenuShell*)submenu, menu_item); menubar->file.batch.clipboard = menu_item; // Batch downloads - URL Sequence batch menu_item = gtk_image_menu_item_new_with_mnemonic (_("_URL Sequence batch...")); #if GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 10 image = gtk_image_new_from_icon_name ("view-sort-ascending", GTK_ICON_SIZE_MENU); #else image = gtk_image_new_from_stock (GTK_STOCK_SORT_ASCENDING, GTK_ICON_SIZE_MENU); #endif gtk_image_menu_item_set_image ((GtkImageMenuItem*)menu_item, image); gtk_menu_shell_append ((GtkMenuShell*)submenu, menu_item); menubar->file.batch.sequence = menu_item; // Batch downloads - Text file import (.txt) menu_item = gtk_image_menu_item_new_with_mnemonic (_("_Text file import (.txt)...")); #if GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 10 image = gtk_image_new_from_icon_name ("go-next", GTK_ICON_SIZE_MENU); #else image = gtk_image_new_from_stock (GTK_STOCK_GO_FORWARD, GTK_ICON_SIZE_MENU); #endif gtk_image_menu_item_set_image ((GtkImageMenuItem*)menu_item, image); gtk_menu_shell_append ((GtkMenuShell*)submenu, menu_item); menubar->file.batch.text_import = menu_item; // Batch downloads - HTML file import (.html) menu_item = gtk_image_menu_item_new_with_mnemonic (_("_HTML file import (.html)...")); #if GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 10 image = gtk_image_new_from_icon_name ("gtk-convert", GTK_ICON_SIZE_MENU); #else image = gtk_image_new_from_stock (GTK_STOCK_CONVERT, GTK_ICON_SIZE_MENU); #endif gtk_image_menu_item_set_image ((GtkImageMenuItem*)menu_item, image); gtk_menu_shell_append ((GtkMenuShell*)submenu, menu_item); menubar->file.batch.html_import = menu_item; // Batch downloads - separator gtk_menu_shell_append ((GtkMenuShell*)submenu, gtk_separator_menu_item_new() ); // Batch downloads - Export to Text file (.txt) menu_item = gtk_image_menu_item_new_with_mnemonic (_("_Export to Text file (.txt)...")); #if GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 10 image = gtk_image_new_from_icon_name ("go-previous", GTK_ICON_SIZE_MENU); #else image = gtk_image_new_from_stock (GTK_STOCK_GO_BACK, GTK_ICON_SIZE_MENU); #endif gtk_image_menu_item_set_image ((GtkImageMenuItem*)menu_item, image); gtk_menu_shell_append ((GtkMenuShell*)submenu, menu_item); menubar->file.batch.text_export = menu_item; // Batch downloads --- end --- gtk_menu_shell_append ((GtkMenuShell*)menu, gtk_separator_menu_item_new() ); // Open Category menu_item = gtk_image_menu_item_new_with_mnemonic (_("_Open category...")); gtk_menu_item_set_accel_path ((GtkMenuItem*) menu_item, UGTK_APP_ACCEL_PATH_LOAD); #if GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 10 image = gtk_image_new_from_icon_name ("document-open", GTK_ICON_SIZE_MENU); #else image = gtk_image_new_from_stock (GTK_STOCK_OPEN, GTK_ICON_SIZE_MENU); #endif gtk_image_menu_item_set_image ((GtkImageMenuItem*)menu_item, image); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); menubar->file.open_category = menu_item; // Save Category menu_item = gtk_image_menu_item_new_with_mnemonic (_("_Save category as...")); gtk_menu_item_set_accel_path ((GtkMenuItem*) menu_item, UGTK_APP_ACCEL_PATH_SAVE); #if GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 10 image = gtk_image_new_from_icon_name ("document-save", GTK_ICON_SIZE_MENU); #else image = gtk_image_new_from_stock (GTK_STOCK_SAVE, GTK_ICON_SIZE_MENU); #endif gtk_image_menu_item_set_image ((GtkImageMenuItem*)menu_item, image); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); menubar->file.save_category = menu_item; // Save All menu_item = gtk_image_menu_item_new_with_mnemonic (_("Save _all settings")); gtk_menu_item_set_accel_path ((GtkMenuItem*) menu_item, UGTK_APP_ACCEL_PATH_SAVE_ALL); #if GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 10 image = gtk_image_new_from_icon_name ("document-save", GTK_ICON_SIZE_MENU); #else image = gtk_image_new_from_stock (GTK_STOCK_SAVE, GTK_ICON_SIZE_MENU); #endif gtk_image_menu_item_set_image ((GtkImageMenuItem*)menu_item, image); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); menubar->file.save = menu_item; gtk_menu_shell_append ((GtkMenuShell*)menu, gtk_separator_menu_item_new() ); // Offline mode menu_item = gtk_check_menu_item_new_with_mnemonic (_("Offline Mode")); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); menubar->file.offline_mode = menu_item; menu_item = gtk_image_menu_item_new_from_stock (GTK_STOCK_QUIT, accel_group); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); menubar->file.quit = menu_item; } // UgtkEditMenu static void ugtk_menubar_edit_init (UgtkMenubar* menubar) { GtkWidget* image; GtkWidget* menu; GtkWidget* submenu; GtkWidget* menu_item; menu = gtk_menu_new (); menu_item = gtk_menu_item_new_with_mnemonic (_("_Edit")); gtk_menu_item_set_submenu ((GtkMenuItem*)menu_item, menu); gtk_menu_shell_append ((GtkMenuShell*)menubar->self, menu_item); // menu.gtk_menu_shell_append((GtkMenuShell*)menu, gtk_tearoff_menu_item_new() ); menu_item = gtk_check_menu_item_new_with_mnemonic (_("Clipboard _Monitor")); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); menubar->edit.clipboard_monitor = menu_item; menu_item = gtk_check_menu_item_new_with_mnemonic (_("Clipboard works quietly")); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); menubar->edit.clipboard_quiet = menu_item; menu_item = gtk_check_menu_item_new_with_mnemonic (_("Command-line works quietly")); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); menubar->edit.commandline_quiet = menu_item; menu_item = gtk_check_menu_item_new_with_mnemonic (_("Skip existing URI")); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); menubar->edit.skip_existing = menu_item; menu_item = gtk_check_menu_item_new_with_mnemonic (_("Apply recent download settings")); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); menubar->edit.apply_recent = menu_item; gtk_menu_shell_append ((GtkMenuShell*)menu, gtk_separator_menu_item_new()); // --- Completion Auto-Actions --- start --- menu_item = gtk_image_menu_item_new_with_mnemonic (_("Completion _Auto-Actions")); submenu = gtk_menu_new (); // gtk_menu_set_accel_group ((GtkMenu*)submenu, accel_group); gtk_menu_item_set_submenu ((GtkMenuItem*)menu_item, submenu); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); // Completion Auto-Actions - Disable menu_item = gtk_radio_menu_item_new_with_mnemonic (NULL, _("_Disable")); gtk_menu_shell_append ((GtkMenuShell*)submenu, menu_item); menubar->edit.completion.disable = menu_item; // Completion Auto-Actions - Hibernate menu_item = gtk_radio_menu_item_new_with_mnemonic_from_widget ( (GtkRadioMenuItem*) menu_item, _("Hibernate")); gtk_menu_shell_append ((GtkMenuShell*)submenu, menu_item); menubar->edit.completion.hibernate = menu_item; // Completion Auto-Actions - Suspend menu_item = gtk_radio_menu_item_new_with_mnemonic_from_widget ( (GtkRadioMenuItem*) menu_item, _("Suspend")); gtk_menu_shell_append ((GtkMenuShell*)submenu, menu_item); menubar->edit.completion.suspend = menu_item; // Completion Auto-Actions - Shutdown menu_item = gtk_radio_menu_item_new_with_mnemonic_from_widget ( (GtkRadioMenuItem*) menu_item, _("Shutdown")); gtk_menu_shell_append ((GtkMenuShell*)submenu, menu_item); menubar->edit.completion.shutdown = menu_item; // Completion Auto-Actions - Reboot menu_item = gtk_radio_menu_item_new_with_mnemonic_from_widget ( (GtkRadioMenuItem*) menu_item, _("Reboot")); gtk_menu_shell_append ((GtkMenuShell*)submenu, menu_item); menubar->edit.completion.reboot = menu_item; // Completion Auto-Actions - Custom menu_item = gtk_radio_menu_item_new_with_mnemonic_from_widget ( (GtkRadioMenuItem*) menu_item, _("Custom")); gtk_menu_shell_append ((GtkMenuShell*)submenu, menu_item); menubar->edit.completion.custom = menu_item; // separator gtk_menu_shell_append ((GtkMenuShell*)submenu, gtk_separator_menu_item_new()); // Completion Auto-Actions - Remember menu_item = gtk_check_menu_item_new_with_mnemonic (_("Remember setting")); gtk_menu_shell_append ((GtkMenuShell*)submenu, menu_item); menubar->edit.completion.remember = menu_item; // Completion Auto-Actions - Help menu_item = gtk_menu_item_new_with_mnemonic (_("_Help")); gtk_menu_shell_append ((GtkMenuShell*)submenu, menu_item); menubar->edit.completion.help = menu_item; // --- Completion Auto-Actions --- end --- // menu_item = gtk_menu_item_new_with_mnemonic (_("_Settings...")); menu_item = gtk_image_menu_item_new_with_mnemonic (_("_Settings...")); #if GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 10 image = gtk_image_new_from_icon_name ("document-properties", GTK_ICON_SIZE_MENU); #else image = gtk_image_new_from_stock (GTK_STOCK_PROPERTIES, GTK_ICON_SIZE_MENU); #endif gtk_image_menu_item_set_image ((GtkImageMenuItem*)menu_item, image); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); menubar->edit.settings = menu_item; } // UgtkViewMenu static void ugtk_menubar_view_init (UgtkMenubar* menubar) { GtkWidget* menu; GtkWidget* submenu; GtkWidget* menu_item; menu = gtk_menu_new (); menu_item = gtk_menu_item_new_with_mnemonic (_("_View")); gtk_menu_item_set_submenu ((GtkMenuItem*) menu_item, menu); gtk_menu_shell_append ((GtkMenuShell*) menubar->self, menu_item); menu_item = gtk_check_menu_item_new_with_mnemonic (_("_Toolbar")); gtk_check_menu_item_set_active ((GtkCheckMenuItem*) menu_item, TRUE); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); menubar->view.toolbar = menu_item; menu_item = gtk_check_menu_item_new_with_mnemonic (_("Statusbar")); gtk_check_menu_item_set_active ((GtkCheckMenuItem*) menu_item, TRUE); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); menubar->view.statusbar = menu_item; menu_item = gtk_check_menu_item_new_with_mnemonic (_("Category")); gtk_check_menu_item_set_active ((GtkCheckMenuItem*) menu_item, TRUE); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); menubar->view.category = menu_item; menu_item = gtk_check_menu_item_new_with_mnemonic (_("_Summary")); gtk_check_menu_item_set_active ((GtkCheckMenuItem*) menu_item, TRUE); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); menubar->view.summary = menu_item; gtk_menu_shell_append ((GtkMenuShell*)menu, gtk_separator_menu_item_new() ); // Summary Items --- start --- menu_item = gtk_menu_item_new_with_mnemonic (_("Summary _Items")); submenu = gtk_menu_new (); gtk_menu_item_set_submenu ((GtkMenuItem*) menu_item, submenu); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); // Summary Items - Name menu_item = gtk_check_menu_item_new_with_mnemonic (_("_Name")); gtk_check_menu_item_set_active ((GtkCheckMenuItem*) menu_item, TRUE); gtk_menu_shell_append ((GtkMenuShell*) submenu, menu_item); menubar->view.summary_items.name = menu_item; // Summary Items - Folder menu_item = gtk_check_menu_item_new_with_mnemonic (_("_Folder")); gtk_check_menu_item_set_active ((GtkCheckMenuItem*) menu_item, TRUE); gtk_menu_shell_append ((GtkMenuShell*) submenu, menu_item); menubar->view.summary_items.folder = menu_item; // Summary Items - Category menu_item = gtk_check_menu_item_new_with_mnemonic (_("Category")); gtk_check_menu_item_set_active ((GtkCheckMenuItem*) menu_item, TRUE); gtk_menu_shell_append ((GtkMenuShell*) submenu, menu_item); menubar->view.summary_items.category = menu_item; // Summary Items - Elapsed // menu_item = gtk_check_menu_item_new_with_mnemonic (_("_Elapsed")); // gtk_check_menu_item_set_active ((GtkCheckMenuItem*) menu_item, TRUE); // gtk_menu_shell_append ((GtkMenuShell*) submenu, menu_item); // menubar->view.summary_items.elapsed = menu_item; // Summary Items - URL menu_item = gtk_check_menu_item_new_with_mnemonic (_("_URL")); gtk_check_menu_item_set_active ((GtkCheckMenuItem*) menu_item, TRUE); gtk_menu_shell_append ((GtkMenuShell*) submenu, menu_item); menubar->view.summary_items.uri = menu_item; // Summary Items - Message menu_item = gtk_check_menu_item_new_with_mnemonic (_("_Message")); gtk_check_menu_item_set_active ((GtkCheckMenuItem*) menu_item, TRUE); gtk_menu_shell_append ((GtkMenuShell*) submenu, menu_item); menubar->view.summary_items.message = menu_item; // Summary Items --- end --- // gtk_menu_shell_append ((GtkMenuShell*)menu, gtk_separator_menu_item_new() ); // menu_item = gtk_check_menu_item_new_with_mnemonic (_("Download _Rules Hint")); // gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); // gtk_check_menu_item_set_active ((GtkCheckMenuItem*) menu_item, TRUE); // menubar->view.rules_hint = menu_item; // Download Columns --- start --- submenu = gtk_menu_new (); menu_item = gtk_menu_item_new_with_mnemonic (_("Download _Columns")); gtk_menu_item_set_submenu ((GtkMenuItem*) menu_item, submenu); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); menubar->view.columns.self = submenu; // Download Columns - Complete menu_item = gtk_check_menu_item_new_with_mnemonic (_("_Complete")); gtk_menu_shell_append ((GtkMenuShell*) submenu, menu_item); gtk_check_menu_item_set_active ((GtkCheckMenuItem*) menu_item, TRUE); menubar->view.columns.complete = menu_item; // Download Columns - Total menu_item = gtk_check_menu_item_new_with_mnemonic (_("_Size")); gtk_menu_shell_append ((GtkMenuShell*) submenu, menu_item); gtk_check_menu_item_set_active ((GtkCheckMenuItem*) menu_item, TRUE); menubar->view.columns.total = menu_item; // Download Columns - Percent (%) menu_item = gtk_check_menu_item_new_with_mnemonic (_("_Percent '%'")); gtk_menu_shell_append ((GtkMenuShell*) submenu, menu_item); gtk_check_menu_item_set_active ((GtkCheckMenuItem*) menu_item, TRUE); menubar->view.columns.percent = menu_item; // Download Columns - Elapsed menu_item = gtk_check_menu_item_new_with_mnemonic (_("_Elapsed")); gtk_menu_shell_append ((GtkMenuShell*) submenu, menu_item); gtk_check_menu_item_set_active ((GtkCheckMenuItem*) menu_item, TRUE); menubar->view.columns.elapsed = menu_item; // Download Columns - Left menu_item = gtk_check_menu_item_new_with_mnemonic (_("_Left")); gtk_menu_shell_append ((GtkMenuShell*) submenu, menu_item); gtk_check_menu_item_set_active ((GtkCheckMenuItem*) menu_item, TRUE); menubar->view.columns.left = menu_item; // Download Columns - Speed menu_item = gtk_check_menu_item_new_with_mnemonic (_("Speed")); gtk_menu_shell_append ((GtkMenuShell*) submenu, menu_item); gtk_check_menu_item_set_active ((GtkCheckMenuItem*) menu_item, TRUE); menubar->view.columns.speed = menu_item; // Download Columns - Up Speed menu_item = gtk_check_menu_item_new_with_mnemonic (_("Up Speed")); gtk_menu_shell_append ((GtkMenuShell*) submenu, menu_item); gtk_check_menu_item_set_active ((GtkCheckMenuItem*) menu_item, TRUE); menubar->view.columns.upload_speed = menu_item; // Download Columns - Uploaded menu_item = gtk_check_menu_item_new_with_mnemonic (_("Uploaded")); gtk_menu_shell_append ((GtkMenuShell*) submenu, menu_item); gtk_check_menu_item_set_active ((GtkCheckMenuItem*) menu_item, TRUE); menubar->view.columns.uploaded = menu_item; // Download Columns - Ratio menu_item = gtk_check_menu_item_new_with_mnemonic (_("Ratio")); gtk_menu_shell_append ((GtkMenuShell*) submenu, menu_item); gtk_check_menu_item_set_active ((GtkCheckMenuItem*) menu_item, TRUE); menubar->view.columns.ratio = menu_item; // Download Columns - Retry menu_item = gtk_check_menu_item_new_with_mnemonic (_("_Retry")); gtk_menu_shell_append ((GtkMenuShell*) submenu, menu_item); gtk_check_menu_item_set_active ((GtkCheckMenuItem*) menu_item, TRUE); menubar->view.columns.retry = menu_item; // Download Columns - Category menu_item = gtk_check_menu_item_new_with_mnemonic (_("Category")); gtk_menu_shell_append ((GtkMenuShell*) submenu, menu_item); gtk_check_menu_item_set_active ((GtkCheckMenuItem*) menu_item, TRUE); menubar->view.columns.category = menu_item; // Download Columns - URL menu_item = gtk_check_menu_item_new_with_mnemonic (_("_URL")); gtk_menu_shell_append ((GtkMenuShell*) submenu, menu_item); gtk_check_menu_item_set_active ((GtkCheckMenuItem*) menu_item, TRUE); menubar->view.columns.uri = menu_item; // Download Columns - Added On menu_item = gtk_check_menu_item_new_with_mnemonic (_("Added On")); gtk_menu_shell_append ((GtkMenuShell*) submenu, menu_item); gtk_check_menu_item_set_active ((GtkCheckMenuItem*) menu_item, TRUE); menubar->view.columns.added_on = menu_item; // Download Columns - Completed On menu_item = gtk_check_menu_item_new_with_mnemonic (_("Completed On")); gtk_menu_shell_append ((GtkMenuShell*) submenu, menu_item); gtk_check_menu_item_set_active ((GtkCheckMenuItem*) menu_item, TRUE); menubar->view.columns.completed_on = menu_item; // Download Columns --- end --- } // UgtkCategoryMenu static void ugtk_menubar_category_init (UgtkMenubar* menubar) { GtkWidget* image; GtkWidget* menu; GtkWidget* menu_item; menu = gtk_menu_new (); menu_item = gtk_menu_item_new_with_mnemonic (_("_Category")); gtk_menu_item_set_submenu ((GtkMenuItem*)menu_item, menu); gtk_menu_shell_append ((GtkMenuShell*)menubar->self, menu_item); menubar->category.self = menu; // New Category menu_item = gtk_image_menu_item_new_with_mnemonic(_("_New Category...")); #if GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 10 image = gtk_image_new_from_icon_name ("gtk-dnd-multiple", GTK_ICON_SIZE_MENU); #else image = gtk_image_new_from_stock (GTK_STOCK_DND_MULTIPLE, GTK_ICON_SIZE_MENU); #endif gtk_image_menu_item_set_image ((GtkImageMenuItem*)menu_item, image); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); menubar->category.create = menu_item; // Delete Category menu_item = gtk_image_menu_item_new_with_mnemonic(_("_Delete Category")); #if GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 10 image = gtk_image_new_from_icon_name ("window-close", GTK_ICON_SIZE_MENU); #else image = gtk_image_new_from_stock (GTK_STOCK_CLOSE, GTK_ICON_SIZE_MENU); #endif gtk_image_menu_item_set_image ((GtkImageMenuItem*)menu_item, image); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); menubar->category.delete = menu_item; // Properties menu_item = gtk_image_menu_item_new_from_stock (GTK_STOCK_PROPERTIES, NULL); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); menubar->category.properties = menu_item; gtk_menu_shell_append ((GtkMenuShell*)menu, gtk_separator_menu_item_new() ); // Move Up menu_item = gtk_image_menu_item_new_from_stock (GTK_STOCK_GO_UP, NULL); // menu_item = gtk_image_menu_item_new_with_mnemonic(_("Move _Up")); // image = gtk_image_new_from_stock (GTK_STOCK_GO_UP, GTK_ICON_SIZE_MENU); // gtk_image_menu_item_set_image ((GtkImageMenuItem*)menu_item, image); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); menubar->category.move_up = menu_item; // Move Down menu_item = gtk_image_menu_item_new_from_stock (GTK_STOCK_GO_DOWN, NULL); // menu_item = gtk_image_menu_item_new_with_mnemonic(_("Move _Down")); // image = gtk_image_new_from_stock (GTK_STOCK_GO_DOWN, GTK_ICON_SIZE_MENU); // gtk_image_menu_item_set_image ((GtkImageMenuItem*)menu_item, image); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); menubar->category.move_down = menu_item; } // UgtkDownloadMenu static void ugtk_menubar_download_init (UgtkMenubar* menubar, GtkAccelGroup* accel_group) { GtkWidget* image; GtkWidget* menu; GtkWidget* submenu; GtkWidget* menu_item; menu = gtk_menu_new (); gtk_menu_set_accel_group ((GtkMenu*)menu, accel_group); menu_item = gtk_menu_item_new_with_mnemonic (_("_Download")); gtk_menu_item_set_submenu ((GtkMenuItem*)menu_item, menu); gtk_menu_shell_append ((GtkMenuShell*)menubar->self, menu_item); menubar->download.self = menu; // gtk_menu_shell_append((GtkMenuShell*)menu, gtk_tearoff_menu_item_new() ); menu_item = gtk_image_menu_item_new_from_stock (GTK_STOCK_NEW, accel_group); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); menubar->download.create = menu_item; // menu_item = gtk_image_menu_item_new_from_stock (GTK_STOCK_DELETE, accel_group); menu_item = gtk_image_menu_item_new_with_mnemonic (_("_Delete Entry")); gtk_menu_item_set_accel_path ((GtkMenuItem*) menu_item, UGTK_APP_ACCEL_PATH_DELETE); #if GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 10 image = gtk_image_new_from_icon_name ("edit-delete", GTK_ICON_SIZE_MENU); #else image = gtk_image_new_from_stock (GTK_STOCK_DELETE, GTK_ICON_SIZE_MENU); #endif gtk_image_menu_item_set_image ((GtkImageMenuItem*)menu_item, image); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); menubar->download.delete = menu_item; menu_item = gtk_image_menu_item_new_with_mnemonic (_("Delete Entry and _File")); gtk_menu_item_set_accel_path ((GtkMenuItem*) menu_item, UGTK_APP_ACCEL_PATH_DELETE_F); // image = gtk_image_new_from_stock (GTK_STOCK_DELETE, GTK_ICON_SIZE_MENU); // gtk_image_menu_item_set_image ((GtkImageMenuItem*)menu_item, image); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); menubar->download.delete_file = menu_item; gtk_menu_shell_append ((GtkMenuShell*)menu, gtk_separator_menu_item_new() ); menu_item = gtk_image_menu_item_new_from_stock (GTK_STOCK_OPEN, NULL); gtk_menu_item_set_accel_path ((GtkMenuItem*) menu_item, UGTK_APP_ACCEL_PATH_OPEN); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); menubar->download.open = menu_item; gtk_widget_hide (menu_item); menu_item = gtk_image_menu_item_new_with_mnemonic(_("Open _Containing folder")); gtk_menu_item_set_accel_path ((GtkMenuItem*) menu_item, UGTK_APP_ACCEL_PATH_OPEN_F); #if GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 10 image = gtk_image_new_from_icon_name ("folder", GTK_ICON_SIZE_MENU); #else image = gtk_image_new_from_stock (GTK_STOCK_DIRECTORY, GTK_ICON_SIZE_MENU); #endif gtk_image_menu_item_set_image ((GtkImageMenuItem*)menu_item, image); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); menubar->download.open_folder = menu_item; gtk_menu_shell_append ((GtkMenuShell*)menu, gtk_separator_menu_item_new() ); menu_item = gtk_image_menu_item_new_with_mnemonic(_("Force Start")); // image = gtk_image_new_from_stock (GTK_STOCK_MEDIA_PLAY, GTK_ICON_SIZE_MENU); // gtk_image_menu_item_set_image ((GtkImageMenuItem*)menu_item, image); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); menubar->download.force_start = menu_item; menu_item = gtk_image_menu_item_new_with_mnemonic(_("_Runnable")); gtk_menu_item_set_accel_path ((GtkMenuItem*) menu_item, UGTK_APP_ACCEL_PATH_SWITCH); #if GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 10 image = gtk_image_new_from_icon_name ("media-playback-start", GTK_ICON_SIZE_MENU); #else image = gtk_image_new_from_stock (GTK_STOCK_MEDIA_PLAY, GTK_ICON_SIZE_MENU); #endif gtk_image_menu_item_set_image ((GtkImageMenuItem*)menu_item, image); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); menubar->download.runnable = menu_item; menu_item = gtk_image_menu_item_new_from_stock (GTK_STOCK_MEDIA_PAUSE, NULL); gtk_menu_item_set_accel_path ((GtkMenuItem*) menu_item, UGTK_APP_ACCEL_PATH_SWITCH); // menu_item = gtk_image_menu_item_new_with_mnemonic(_("P_ause")); // image = gtk_image_new_from_stock (GTK_STOCK_MEDIA_PAUSE, GTK_ICON_SIZE_MENU); // gtk_image_menu_item_set_image ((GtkImageMenuItem*)menu_item, image); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); menubar->download.pause = menu_item; gtk_menu_shell_append ((GtkMenuShell*)menu, gtk_separator_menu_item_new() ); // Move to --- start --- menu_item = gtk_image_menu_item_new_with_mnemonic(_("_Move To")); #if GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 10 image = gtk_image_new_from_icon_name ("gtk-dnd-multiple", GTK_ICON_SIZE_MENU); #else image = gtk_image_new_from_stock (GTK_STOCK_DND_MULTIPLE, GTK_ICON_SIZE_MENU); #endif gtk_image_menu_item_set_image ((GtkImageMenuItem*)menu_item, image); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); menubar->download.move_to.item = menu_item; // Move to - submenu submenu = gtk_menu_new (); gtk_menu_item_set_submenu ((GtkMenuItem*)menu_item, submenu); menubar->download.move_to.self = submenu; menubar->download.move_to.array = g_ptr_array_sized_new (16*2); // Move to --- end --- gtk_menu_shell_append ((GtkMenuShell*)menu, gtk_separator_menu_item_new() ); menu_item = gtk_image_menu_item_new_from_stock (GTK_STOCK_GO_UP, NULL); // menu_item = gtk_image_menu_item_new_with_mnemonic(_("Move _Up")); // image = gtk_image_new_from_stock (GTK_STOCK_GO_UP, GTK_ICON_SIZE_MENU); // gtk_image_menu_item_set_image ((GtkImageMenuItem*)menu_item, image); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); menubar->download.move_up = menu_item; menu_item = gtk_image_menu_item_new_from_stock (GTK_STOCK_GO_DOWN, NULL); // menu_item = gtk_image_menu_item_new_with_mnemonic(_("Move _Down")); // image = gtk_image_new_from_stock (GTK_STOCK_GO_DOWN, GTK_ICON_SIZE_MENU); // gtk_image_menu_item_set_image ((GtkImageMenuItem*)menu_item, image); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); menubar->download.move_down = menu_item; menu_item = gtk_image_menu_item_new_from_stock (GTK_STOCK_GOTO_TOP, NULL); // menu_item = gtk_image_menu_item_new_with_mnemonic(_("Move _Top")); // image = gtk_image_new_from_stock (GTK_STOCK_GOTO_TOP, GTK_ICON_SIZE_MENU); // gtk_image_menu_item_set_image ((GtkImageMenuItem*)menu_item, image); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); menubar->download.move_top = menu_item; menu_item = gtk_image_menu_item_new_from_stock (GTK_STOCK_GOTO_BOTTOM, NULL); // menu_item = gtk_image_menu_item_new_with_mnemonic(_("Move _Bottom")); // image = gtk_image_new_from_stock (GTK_STOCK_GOTO_BOTTOM, GTK_ICON_SIZE_MENU); // gtk_image_menu_item_set_image ((GtkImageMenuItem*)menu_item, image); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); menubar->download.move_bottom = menu_item; gtk_menu_shell_append ((GtkMenuShell*)menu, gtk_separator_menu_item_new() ); // Priority --- start --- menu_item = gtk_image_menu_item_new_with_mnemonic(_("Priority")); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); menubar->download.prioriy.item = menu_item; // Priority - submenu submenu = gtk_menu_new (); gtk_menu_item_set_submenu ((GtkMenuItem*)menu_item, submenu); menubar->download.prioriy.self = submenu; // Priority - High menu_item = gtk_radio_menu_item_new_with_mnemonic ( NULL, _("_High")); gtk_menu_shell_append ((GtkMenuShell*)submenu, menu_item); menubar->download.prioriy.high = menu_item; // Priority - Normal menu_item = gtk_radio_menu_item_new_with_mnemonic_from_widget ( (GtkRadioMenuItem*) menu_item, _("_Normal")); gtk_menu_shell_append ((GtkMenuShell*)submenu, menu_item); menubar->download.prioriy.normal = menu_item; // Priority - Low menu_item = gtk_radio_menu_item_new_with_mnemonic_from_widget ( (GtkRadioMenuItem*) menu_item, _("_Low")); gtk_menu_shell_append ((GtkMenuShell*)submenu, menu_item); menubar->download.prioriy.low = menu_item; // Priority --- end --- menu_item = gtk_image_menu_item_new_from_stock (GTK_STOCK_PROPERTIES, NULL); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); menubar->download.properties = menu_item; } // UgtkHelpMenu static void ugtk_menubar_help_init (UgtkMenubar* menubar) { GtkWidget* image; GtkWidget* menu; GtkWidget* menu_item; menu = gtk_menu_new (); menu_item = gtk_menu_item_new_with_mnemonic(_("_Help")); gtk_menu_item_set_submenu ((GtkMenuItem*)menu_item, menu); gtk_menu_shell_append ((GtkMenuShell*)menubar->self, menu_item); // Get Help Online menu_item = gtk_image_menu_item_new_with_mnemonic(_("Get Help Online")); #if GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 10 image = gtk_image_new_from_icon_name ("help-browser", GTK_ICON_SIZE_MENU); #else image = gtk_image_new_from_stock (GTK_STOCK_HELP, GTK_ICON_SIZE_MENU); #endif gtk_image_menu_item_set_image ((GtkImageMenuItem*)menu_item, image); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); menubar->help.help_online = menu_item; // Documentation menu_item = gtk_image_menu_item_new_with_mnemonic(_("Documentation")); #if GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 10 image = gtk_image_new_from_icon_name ("text-x-generic", GTK_ICON_SIZE_MENU); #else image = gtk_image_new_from_stock (GTK_STOCK_FILE, GTK_ICON_SIZE_MENU); #endif gtk_image_menu_item_set_image ((GtkImageMenuItem*)menu_item, image); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); menubar->help.documentation = menu_item; // Support Forum menu_item = gtk_image_menu_item_new_with_mnemonic(_("Support Forum")); #if GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 10 image = gtk_image_new_from_icon_name ("dialog-question", GTK_ICON_SIZE_MENU); #else image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_QUESTION, GTK_ICON_SIZE_MENU); #endif gtk_image_menu_item_set_image ((GtkImageMenuItem*)menu_item, image); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); menubar->help.support_forum = menu_item; // Submit Feedback menu_item = gtk_image_menu_item_new_with_mnemonic(_("Submit Feedback")); #if GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 10 image = gtk_image_new_from_icon_name ("list-add", GTK_ICON_SIZE_MENU); #else image = gtk_image_new_from_stock (GTK_STOCK_ADD, GTK_ICON_SIZE_MENU); #endif gtk_image_menu_item_set_image ((GtkImageMenuItem*)menu_item, image); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); menubar->help.submit_feedback = menu_item; // Report a Bug menu_item = gtk_image_menu_item_new_with_mnemonic(_("Report a Bug")); #if GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 10 image = gtk_image_new_from_icon_name ("dialog-warning-symbolic", GTK_ICON_SIZE_MENU); #else image = gtk_image_new_from_stock (GTK_STOCK_CAPS_LOCK_WARNING, GTK_ICON_SIZE_MENU); #endif gtk_image_menu_item_set_image ((GtkImageMenuItem*)menu_item, image); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); menubar->help.report_bug = menu_item; // Keyboard Shortcuts menu_item = gtk_image_menu_item_new_with_mnemonic(_("Keyboard Shortcuts")); // image = gtk_image_new_from_stock (GTK_STOCK_DND_MULTIPLE, GTK_ICON_SIZE_MENU); // gtk_image_menu_item_set_image ((GtkImageMenuItem*)menu_item, image); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); menubar->help.keyboard_shortcuts = menu_item; // Check for Updates menu_item = gtk_image_menu_item_new_with_mnemonic(_("Check for Updates")); // image = gtk_image_new_from_stock (GTK_STOCK_DND_MULTIPLE, GTK_ICON_SIZE_MENU); // gtk_image_menu_item_set_image ((GtkImageMenuItem*)menu_item, image); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); menubar->help.check_updates = menu_item; // About Uget menu_item = gtk_image_menu_item_new_from_stock (GTK_STOCK_ABOUT, NULL); gtk_menu_shell_append ((GtkMenuShell*)menu, menu_item); menubar->help.about_uget = menu_item; } void ugtk_menubar_init_ui (UgtkMenubar* menubar, GtkAccelGroup* accel_group) { menubar->self = gtk_menu_bar_new (); ugtk_menubar_file_init (menubar, accel_group); ugtk_menubar_edit_init (menubar); ugtk_menubar_view_init (menubar); ugtk_menubar_category_init (menubar); ugtk_menubar_download_init (menubar, accel_group); ugtk_menubar_help_init (menubar); } uget-2.2.0/ui-gtk/UgtkConfig.h0000644000175000000120000000537713224532612013013 00000000000000/* * * Copyright (C) 2012-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #ifndef UGTK_CONFIG_H #define UGTK_CONFIG_H #ifdef HAVE_CONFIG_H # include #elif defined _WIN32 || defined _WIN64 //# define HAVE_GLIB 1 #endif #ifdef __cplusplus extern "C" { #endif #ifndef GETTEXT_PACKAGE #define GETTEXT_PACKAGE "uget" #endif #ifndef PACKAGE_VERSION #define PACKAGE_VERSION "2.2.0" #endif // ---------------------------------------------------------------------------- // path const char* ugtk_get_data_dir (void); const char* ugtk_get_config_dir (void); const char* ugtk_get_locale_dir (void); #if defined _WIN32 || defined _WIN64 const char* ugtk_get_install_dir (void); gboolean ugtk_is_portable (void); // Please undef UG_DATADIR and LOCALEDIR if you doesn't want to use fixed path // to load data and you use autoconf and automake to build uGet in MSYS2. #undef UG_DATADIR #undef LOCALEDIR #ifndef UG_DATADIR #define UG_DATADIR ugtk_get_data_dir() #endif #ifndef LOCALEDIR #define LOCALEDIR ugtk_get_locale_dir() #endif #else #ifndef UG_DATADIR #define UG_DATADIR "/usr/share" #endif #ifndef LOCALEDIR #define LOCALEDIR UG_DATADIR "/locale" #endif #endif // _WIN32 || _WIN64 #ifdef __cplusplus } #endif #endif // UGTK_CONFIG_H uget-2.2.0/ui-gtk/UgtkBatchDialog.h0000644000175000000120000000643513224532612013743 00000000000000/* * * Copyright (C) 2005-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #ifndef UGTK_BATCH_DIALOG_H #define UGTK_BATCH_DIALOG_H #include #include #include #include #include #ifdef __cplusplus extern "C" { #endif typedef struct UgtkBatchDialog UgtkBatchDialog; struct UgtkBatchDialog { UGTK_NODE_DIALOG_MEMBERS; // GtkDialog* self; // GtkBox* hbox; // GtkWidget* notebook; // GtkTreeView* node_view; // UgtkNodeTree* node_tree; // gulong handler_id[3]; // UgtkApp* app; // UgetNode* node; // UgtkProxyForm proxy; // UgtkDownloadForm download; // UgtkCategoryForm category; UgtkSelector selector; UgtkSequence sequencer; }; UgtkBatchDialog* ugtk_batch_dialog_new (const char* title, UgtkApp* app); void ugtk_batch_dialog_free (UgtkBatchDialog* bdialog); void ugtk_batch_dialog_use_selector (UgtkBatchDialog* bdialog); void ugtk_batch_dialog_use_sequencer (UgtkBatchDialog* bdialog); // enable/disable category node list view in left side // return index of selected category #define ugtk_batch_dialog_get_category(bdialog, cnode) \ ugtk_node_dialog_get_category((UgtkNodeDialog*) bdialog, cnode) #define ugtk_batch_dialog_set_category(bdialog, cnode) \ ugtk_node_dialog_set_category((UgtkNodeDialog*) bdialog, cnode) // void ugtk_batch_dialog_apply_recent (UgtkNodeDialog* ndialog, UgtkApp* app); #define ugtk_batch_dialog_apply_recent(bdialog, app) \ ugtk_node_dialog_apply_recent((UgtkNodeDialog*) bdialog, app); void ugtk_batch_dialog_disable_batch (UgtkBatchDialog* bdialog); void ugtk_batch_dialog_run (UgtkBatchDialog* bdialog); #ifdef __cplusplus } #endif #endif // End of UGTK_BATCH_DIALOG_H uget-2.2.0/ui-gtk/UgtkConfig.c0000644000175000000120000000654713224532612013006 00000000000000/* * * Copyright (C) 2012-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #include // ---------------------------------------------------------------------------- // path #if defined _WIN32 || defined _WIN64 #include const char* ugtk_get_install_dir (void) { static gchar* install_dir = NULL; if (install_dir == NULL) { gchar* path; gunichar2* path_wcs; HMODULE hmod; hmod = GetModuleHandle (NULL); // UNICODE path_wcs = g_malloc (sizeof (wchar_t) * MAX_PATH); GetModuleFileNameW (hmod, path_wcs, MAX_PATH); path = g_utf16_to_utf8 (path_wcs, -1, NULL, NULL, NULL); g_free (path_wcs); install_dir = g_path_get_dirname (path); g_free (path); } return install_dir; } gboolean ugtk_is_portable_mode (void) { static int portable = -1; char* local_path; if (portable == -1) { local_path = g_build_filename (ugtk_get_install_dir(), "uget-portable-mode", NULL); portable = g_file_test (local_path, G_FILE_TEST_EXISTS); g_free (local_path); } return portable; } const char* ugtk_get_data_dir (void) { static gchar* data_dir = NULL; if (data_dir == NULL) data_dir = g_build_filename (ugtk_get_install_dir(), "..", "share", NULL); return data_dir; } const char* ugtk_get_config_dir (void) { static const gchar* config_dir = NULL; if (config_dir == NULL) { if (ugtk_is_portable_mode () == TRUE) config_dir = g_build_filename (ugtk_get_install_dir(), "..", "config", NULL); else config_dir = g_get_user_config_dir (); } return config_dir; } #else const char* ugtk_get_data_dir (void) { return UG_DATADIR; } const char* ugtk_get_config_dir (void) { return g_get_user_config_dir (); } #endif // _WIN32 || _WIN64 const char* ugtk_get_locale_dir (void) { static gchar* locale_dir = NULL; if (locale_dir == NULL) locale_dir = g_build_filename (ugtk_get_data_dir(), "locale", NULL); return locale_dir; } uget-2.2.0/ui-gtk/UgtkSelector.c0000644000175000000120000006342113224532612013353 00000000000000/* * * Copyright (C) 2005-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #include #include #include #include #include // UGTK_APP_NAME #include // ---------------------------------------------------------------------------- // UgtkSelectorItem // typedef struct UgtkSelectorItem UgtkSelectorItem; struct UgtkSelectorItem { gboolean mark; gchar* uri; void* data; }; // GtkListStore for UgtkSelectorItem static GList* ugtk_selector_store_get_marked (GtkListStore* store, GList* list); static void ugtk_selector_store_set_mark_all (GtkListStore* store, gboolean mark); static void ugtk_selector_store_clear (GtkListStore* store); // GtkTreeView for UgtkSelectorItem static GtkTreeView* ugtk_selector_view_new (const gchar* title, gboolean active_toggled); static GtkCellRenderer* ugtk_selector_view_get_renderer_toggle (GtkTreeView* view); // ---------------------------------------------------------------------------- // UgtkSelector // static void ugtk_selector_init_ui (UgtkSelector* selector); static void ugtk_selector_filter_init (struct UgtkSelectorFilter* filter, UgtkSelector* selector); static void ugtk_selector_filter_show (struct UgtkSelectorFilter* filter, UgtkSelectorPage* page); // signal handlers static void on_selector_item_toggled (GtkCellRendererToggle* cell, gchar* path_str, UgtkSelector* selector); static void on_selector_mark_all (GtkWidget* button, UgtkSelector* selector); static void on_selector_mark_none (GtkWidget* button, UgtkSelector* selector); static void on_selector_mark_filter (GtkWidget* button, UgtkSelector* selector); static void on_filter_dialog_response (GtkDialog* dialog, gint response_id, UgtkSelector* selector); static void on_filter_button_all (GtkWidget* widget, GtkTreeView* treeview); static void on_filter_button_none (GtkWidget* widget, GtkTreeView* treeview); void ugtk_selector_init (UgtkSelector* selector, GtkWindow* parent) { selector->parent = parent; ugtk_selector_init_ui (selector); // UgtkSelectorPage initialize selector->pages = g_array_new (FALSE, FALSE, sizeof (UgtkSelectorPage)); // UgtkSelectorFilter initialize ugtk_selector_filter_init (&selector->filter, selector); g_signal_connect (selector->select_all, "clicked", G_CALLBACK (on_selector_mark_all), selector); g_signal_connect (selector->select_none, "clicked", G_CALLBACK (on_selector_mark_none), selector); g_signal_connect (selector->select_filter, "clicked", G_CALLBACK (on_selector_mark_filter), selector); } void ugtk_selector_finalize (UgtkSelector* selector) { UgtkSelectorPage* page; GArray* array; guint index; // UgtkSelectorPage finalize array = selector->pages; for (index=0; index < array->len; index++) { page = &g_array_index (array, UgtkSelectorPage, index); ugtk_selector_page_finalize (page); } g_array_free (selector->pages, TRUE); // UgtkSelectorFilter finalize gtk_widget_destroy (GTK_WIDGET (selector->filter.dialog)); } void ugtk_selector_hide_href (UgtkSelector* selector) { gtk_widget_hide ((GtkWidget*) selector->href_label); gtk_widget_hide ((GtkWidget*) selector->href_entry); gtk_widget_hide ((GtkWidget*) selector->href_separator); } static GList* ugtk_selector_get_marked (UgtkSelector* selector) { UgtkSelectorPage* page; GList* list; guint index; list = NULL; for (index = 0; index < selector->pages->len; index++) { page = &g_array_index (selector->pages, UgtkSelectorPage, index); list = ugtk_selector_store_get_marked (page->store, list); } return g_list_reverse (list); } GList* ugtk_selector_get_marked_uris (UgtkSelector* selector) { UgtkSelectorItem* item; GString* gstr; GList* list; GList* link; const gchar* base_href; list = ugtk_selector_get_marked (selector); base_href = gtk_entry_get_text (selector->href_entry); if (base_href[0] == 0) base_href = NULL; for (link = list; link; link = link->next) { item = link->data; // URI list if (ug_uri_init (NULL, item->uri) == 0 && base_href) { gstr = g_string_new (base_href); if (gstr->str[gstr->len -1] == '/') { if (item->uri[0] == '/') g_string_truncate (gstr, gstr->len -1); } else if (item->uri[0] != '/') g_string_append_c (gstr, '/'); g_string_append (gstr, item->uri); } else gstr = g_string_new (item->uri); link->data = g_string_free (gstr, FALSE); } return list; } gint ugtk_selector_count_marked (UgtkSelector* selector) { gint count; guint index; count = 0; for (index = 0; index < selector->pages->len; index++) { count += g_array_index (selector->pages, UgtkSelectorPage, index).n_marked; // count += page->n_marked; } if (selector->notify.func) selector->notify.func (selector->notify.data, (count) ? TRUE: FALSE); return count; } gint ugtk_selector_n_items (UgtkSelector* selector) { gint count; guint index; UgtkSelectorPage* page; count = 0; for (index = 0; index < selector->pages->len; index++) { page = &g_array_index (selector->pages, UgtkSelectorPage, index); count += gtk_tree_model_iter_n_children (GTK_TREE_MODEL (page->store), NULL); } return count; } UgtkSelectorPage* ugtk_selector_add_page (UgtkSelector* selector, const gchar* title) { GtkCellRenderer* renderer; UgtkSelectorPage* page; GArray* array; array = selector->pages; g_array_set_size (array, array->len + 1); page = &g_array_index (array, UgtkSelectorPage, array->len - 1); ugtk_selector_page_init (page); renderer = ugtk_selector_view_get_renderer_toggle (page->view); g_signal_connect (renderer, "toggled", G_CALLBACK (on_selector_item_toggled), selector); gtk_notebook_append_page (selector->notebook, page->self, gtk_label_new (title)); return page; } UgtkSelectorPage* ugtk_selector_get_page (UgtkSelector* selector, gint nth_page) { UgtkSelectorPage* page; if (nth_page < 0) nth_page = gtk_notebook_get_current_page (selector->notebook); if (nth_page == -1 || nth_page >= (gint)selector->pages->len) return NULL; page = &g_array_index (selector->pages, UgtkSelectorPage, nth_page); return page; } // ---------------------------------------------------------------------------- // UgtkSelectorFilter use UgtkSelectorFilterData in UgtkSelectorPage // static GtkWidget* ugtk_selector_filter_view_init (GtkTreeView* item_view) { GtkSizeGroup* sizegroup; GtkWidget* widget; GtkBox* vbox; GtkBox* hbox; vbox = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 2); // filter view and it's scrolled window gtk_widget_set_size_request ((GtkWidget*) item_view, 120, 120); widget = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (widget), GTK_SHADOW_IN); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (widget), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_container_add (GTK_CONTAINER (widget), GTK_WIDGET (item_view)); gtk_box_pack_start (vbox, widget, TRUE, TRUE, 2); // button sizegroup = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); hbox = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); gtk_box_pack_start (vbox, (GtkWidget*) hbox, FALSE, FALSE, 2); widget = gtk_button_new_with_label (_("All")); gtk_size_group_add_widget (sizegroup, widget); gtk_box_pack_start (hbox, widget, FALSE, FALSE, 1); g_signal_connect (widget, "clicked", G_CALLBACK (on_filter_button_all), item_view); widget = gtk_button_new_with_label (_("None")); gtk_size_group_add_widget (sizegroup, widget); gtk_box_pack_start (hbox, widget, FALSE, FALSE, 1); g_signal_connect (widget, "clicked", G_CALLBACK (on_filter_button_none), item_view); return (GtkWidget*) vbox; } static void ugtk_selector_filter_init (struct UgtkSelectorFilter* filter, UgtkSelector* selector) { GtkDialog* dialog; GtkWidget* widget; GtkBox* vbox; GtkBox* hbox; gchar* title; title = g_strconcat (UGTK_APP_NAME " - ", _("Mark by filter"), NULL); dialog = (GtkDialog*) gtk_dialog_new_with_buttons (title, selector->parent, 0, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OK, GTK_RESPONSE_OK, NULL); g_free (title); gtk_window_set_modal ((GtkWindow*) dialog, FALSE); // gtk_window_set_resizable ((GtkWindow*) dialog, FALSE); gtk_window_set_destroy_with_parent ((GtkWindow*) dialog, TRUE); gtk_window_set_transient_for ((GtkWindow*) dialog, selector->parent); gtk_window_resize ((GtkWindow*) dialog, 480, 330); g_signal_connect (dialog, "response", G_CALLBACK (on_filter_dialog_response), selector); filter->dialog = dialog; vbox = (GtkBox*) gtk_dialog_get_content_area (dialog); gtk_box_pack_start (vbox, gtk_label_new (_("Mark URLs by host AND filename extension.")), FALSE, FALSE, 3); gtk_box_pack_start (vbox, gtk_label_new (_("This will reset all marks of URLs.")), FALSE, FALSE, 3); hbox = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); gtk_box_pack_start (vbox, (GtkWidget*) hbox, TRUE, TRUE, 1); // filter view ----------------------- // left side filter->host_view = ugtk_selector_view_new (_("Host"), TRUE); widget = ugtk_selector_filter_view_init (filter->host_view); gtk_box_pack_start (hbox, widget, TRUE, TRUE, 2); // right side (filename extension) filter->ext_view = ugtk_selector_view_new (_("File Ext."), TRUE); widget = ugtk_selector_filter_view_init (filter->ext_view); gtk_box_pack_start (hbox, widget, FALSE, TRUE, 2); gtk_widget_show_all (GTK_WIDGET (vbox)); } static void ugtk_selector_filter_show (struct UgtkSelectorFilter* filter, UgtkSelectorPage* page) { GtkWindow* parent; gtk_tree_view_set_model (filter->host_view, GTK_TREE_MODEL (page->filter.host)); gtk_tree_view_set_model (filter->ext_view, GTK_TREE_MODEL (page->filter.ext)); // disable sensitive of parent window // enable sensitive in function on_filter_dialog_response() parent = gtk_window_get_transient_for ((GtkWindow*) filter->dialog); if (parent) gtk_widget_set_sensitive ((GtkWidget*) parent, FALSE); // create filter dialog if (gtk_window_get_modal (parent)) gtk_dialog_run (filter->dialog); else gtk_widget_show ((GtkWidget*) filter->dialog); } // signal handler ------------------------------ static void on_selector_item_toggled (GtkCellRendererToggle* cell, gchar* path_str, UgtkSelector* selector) { UgtkSelectorPage* page; UgtkSelectorItem* item; GtkTreeIter iter; GtkTreePath* path; GtkTreeModel* model; page = ugtk_selector_get_page (selector, -1); model = GTK_TREE_MODEL (page->store); path = gtk_tree_path_new_from_string (path_str); gtk_tree_model_get_iter (model, &iter, path); gtk_tree_path_free (path); gtk_tree_model_get (model, &iter, 0, &item, -1); // UgtkSelectorItem.mark item->mark ^= 1; if (item->mark) page->n_marked++; else page->n_marked--; // count and notify ugtk_selector_count_marked (selector); } static void on_selector_mark_all (GtkWidget* button, UgtkSelector* selector) { UgtkSelectorPage* page; page = ugtk_selector_get_page (selector, -1); if (page == NULL) return; ugtk_selector_store_set_mark_all (page->store, TRUE); gtk_widget_queue_draw (GTK_WIDGET (page->view)); // count and notify page->n_marked = gtk_tree_model_iter_n_children (GTK_TREE_MODEL (page->store), NULL); ugtk_selector_count_marked (selector); } static void on_selector_mark_none (GtkWidget* button, UgtkSelector* selector) { UgtkSelectorPage* page; page = ugtk_selector_get_page (selector, -1); if (page == NULL) return; ugtk_selector_store_set_mark_all (page->store, FALSE); gtk_widget_queue_draw (GTK_WIDGET (page->view)); // count and notify page->n_marked = 0; ugtk_selector_count_marked (selector); } static void on_selector_mark_filter (GtkWidget* button, UgtkSelector* selector) { UgtkSelectorPage* page; page = ugtk_selector_get_page (selector, -1); if (page == NULL) return; ugtk_selector_page_make_filter (page); ugtk_selector_filter_show (&selector->filter, page); } static void on_filter_dialog_response (GtkDialog* dialog, gint response_id, UgtkSelector* selector) { UgtkSelectorPage* page; GtkWindow* parent; if (response_id == GTK_RESPONSE_OK) { // update selection of page page = ugtk_selector_get_page (selector, -1); if (page) ugtk_selector_page_mark_by_filter_all (page); } // enable parent window parent = gtk_window_get_transient_for ((GtkWindow*) dialog); if (parent) gtk_widget_set_sensitive ((GtkWidget*) parent, TRUE); // hide filter dialog gtk_widget_hide ((GtkWidget*) dialog); // count and notify ugtk_selector_count_marked (selector); } static void on_filter_button_all (GtkWidget* widget, GtkTreeView* treeview) { GtkListStore* store; store = (GtkListStore*) gtk_tree_view_get_model (treeview); ugtk_selector_store_set_mark_all (store, TRUE); gtk_widget_queue_draw ((GtkWidget*) treeview); } static void on_filter_button_none (GtkWidget* widget, GtkTreeView* treeview) { GtkListStore* store; store = (GtkListStore*) gtk_tree_view_get_model (treeview); ugtk_selector_store_set_mark_all (store, FALSE); gtk_widget_queue_draw ((GtkWidget*) treeview); } // ---------------------------------------------------------------------------- // UgtkSelectorPage // void ugtk_selector_page_init (UgtkSelectorPage* page) { GtkScrolledWindow* scrolled; page->store = gtk_list_store_new (1, G_TYPE_POINTER); page->view = ugtk_selector_view_new (_("URL"), FALSE); gtk_tree_view_set_model (page->view, GTK_TREE_MODEL (page->store)); // scrolled page->self = gtk_scrolled_window_new (NULL, NULL); scrolled = GTK_SCROLLED_WINDOW (page->self); gtk_scrolled_window_set_shadow_type (scrolled, GTK_SHADOW_IN); gtk_scrolled_window_set_policy (scrolled, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_container_add (GTK_CONTAINER (scrolled), GTK_WIDGET (page->view)); gtk_widget_show (page->self); // total marked count page->n_marked = 0; // UgtkSelectorFilterData initialize page->filter.hash = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify) g_list_free); page->filter.host = gtk_list_store_new (1, G_TYPE_POINTER); page->filter.ext = gtk_list_store_new (1, G_TYPE_POINTER); } void ugtk_selector_page_finalize (UgtkSelectorPage* page) { ugtk_selector_store_clear (page->store); g_object_unref (page->store); // UgtkSelectorFilterData finalize g_hash_table_destroy (page->filter.hash); ugtk_selector_store_clear (page->filter.host); g_object_unref (page->filter.host); ugtk_selector_store_clear (page->filter.ext); g_object_unref (page->filter.ext); } int ugtk_selector_page_add_uris (UgtkSelectorPage* page, GList* uris) { GtkTreeIter iter; UgtkSelectorItem* item; int counts; for (counts = 0; uris; uris = uris->next) { if (uris->data == NULL) continue; counts++; item = g_slice_alloc (sizeof (UgtkSelectorItem)); item->mark = TRUE; item->uri = uris->data; item->data = NULL; uris->data = NULL; // item->uri gtk_list_store_append (page->store, &iter); gtk_list_store_set (page->store, &iter, 0, item, -1); page->n_marked++; } return counts; } static void ugtk_selector_page_add_filter (UgtkSelectorPage* page, GtkListStore* filter_store, gchar* key, UgtkSelectorItem* value) { UgtkSelectorItem* filter_item; GtkTreeIter iter; GList* filter_list; gchar* orig_key; if (g_hash_table_lookup_extended (page->filter.hash, key, (gpointer*) &orig_key, (gpointer*) &filter_list) == FALSE) { filter_item = g_slice_alloc (sizeof (UgtkSelectorItem)); filter_item->uri = key; filter_item->mark = TRUE; filter_item->data = NULL; gtk_list_store_append (filter_store, &iter); gtk_list_store_set (filter_store, &iter, 0, filter_item, -1); filter_list = NULL; } else { g_hash_table_steal (page->filter.hash, key); g_free (key); key = orig_key; } filter_list = g_list_prepend (filter_list, value); g_hash_table_insert (page->filter.hash, key, filter_list); } void ugtk_selector_page_make_filter (UgtkSelectorPage* page) { UgtkSelectorItem* item; GtkTreeModel* model; GtkTreeIter iter; UgUri* upart; int value; gchar* key; if (g_hash_table_size (page->filter.hash)) return; upart = g_slice_alloc (sizeof (UgUri)); model = GTK_TREE_MODEL (page->store); value = gtk_tree_model_get_iter_first (model, &iter); while (value) { gtk_tree_model_get (model, &iter, 0, &item, -1); // create filter by host ---------------- ug_uri_init (upart, item->uri); if (upart->authority) key = g_strndup (item->uri, upart->path); else key = g_strdup ("(none)"); ugtk_selector_page_add_filter (page, page->filter.host, key, item); // create filter by filename extension -- value = ug_uri_part_file_ext (upart, (const char**) &key); if (value) key = g_strdup_printf (".%.*s", value, key); else key = g_strdup (".(none)"); ugtk_selector_page_add_filter (page, page->filter.ext, key, item); // next value = gtk_tree_model_iter_next (model, &iter); } g_slice_free1 (sizeof (UgUri), upart); } static void ugtk_selector_page_mark_by_filter (UgtkSelectorPage* page, GtkListStore* filter_store) { UgtkSelectorItem* item; GList* related; GList* marked; GList* link; marked = ugtk_selector_store_get_marked (filter_store, NULL); for (link = marked; link; link = link->next) { item = link->data; related = g_hash_table_lookup (page->filter.hash, item->uri); for (; related; related = related->next) { item = related->data; item->mark++; // increase mark count } } g_list_free (marked); } void ugtk_selector_page_mark_by_filter_all (UgtkSelectorPage* page) { UgtkSelectorItem* item; GtkTreeModel* model; GtkTreeIter iter; gboolean valid; // clear all mark ugtk_selector_store_set_mark_all (page->store, FALSE); page->n_marked = 0; // If filter (host and filename extension) was selected, increase mark count. ugtk_selector_page_mark_by_filter (page, page->filter.host); ugtk_selector_page_mark_by_filter (page, page->filter.ext); // remark model = GTK_TREE_MODEL (page->store); valid = gtk_tree_model_get_iter_first (model, &iter); while (valid) { gtk_tree_model_get (model, &iter, 0, &item, -1); valid = gtk_tree_model_iter_next (model, &iter); // decrease mark count. If mark count is 2, it still marked. if (item->mark > 0) { item->mark--; if (item->mark) page->n_marked++; } } } // ---------------------------------------------------------------------------- // GtkListStore for UgtkSelectorItem // (UgItem*) list->data. To free the returned value, call g_list_free() static GList* ugtk_selector_store_get_marked (GtkListStore* store, GList* list) { UgtkSelectorItem* item; GtkTreeModel* model; GtkTreeIter iter; gboolean valid; model = GTK_TREE_MODEL (store); valid = gtk_tree_model_get_iter_first (model, &iter); while (valid) { gtk_tree_model_get (model, &iter, 0, &item, -1); valid = gtk_tree_model_iter_next (model, &iter); if (item->mark) list = g_list_prepend (list, item); } return list; } static void ugtk_selector_store_set_mark_all (GtkListStore* store, gboolean mark) { UgtkSelectorItem* item; GtkTreeModel* model; GtkTreeIter iter; gboolean valid; model = (GtkTreeModel*) store; valid = gtk_tree_model_get_iter_first (model, &iter); while (valid) { gtk_tree_model_get (model, &iter, 0, &item, -1); valid = gtk_tree_model_iter_next (model, &iter); item->mark = mark; } } static void ugtk_selector_store_clear (GtkListStore* store) { UgtkSelectorItem* item; GtkTreeModel* model; GtkTreeIter iter; model = GTK_TREE_MODEL (store); while (gtk_tree_model_get_iter_first (model, &iter)) { gtk_tree_model_get (model, &iter, 0, &item, -1); gtk_list_store_remove (store, &iter); g_free (item->uri); g_slice_free1 (sizeof (UgtkSelectorItem), item); } } // ---------------------------------------------------------------------------- // GtkTreeView for UgtkSelectorItem // static void col_set_toggle (GtkTreeViewColumn *column, GtkCellRenderer *cell, GtkTreeModel *model, GtkTreeIter *iter, gpointer data) { UgtkSelectorItem* item; gtk_tree_model_get (model, iter, 0, &item, -1); g_object_set (cell, "active", item->mark, NULL); } static void col_set_uri (GtkTreeViewColumn *column, GtkCellRenderer *cell, GtkTreeModel *model, GtkTreeIter *iter, gpointer data) { UgtkSelectorItem* item; gtk_tree_model_get (model, iter, 0, &item, -1); g_object_set (cell, "text", item->uri, NULL); } // toggled callback static void on_cell_toggled (GtkCellRendererToggle* cell, gchar* path_str, GtkTreeView* view) { GtkTreeIter iter; GtkTreePath* path; GtkTreeModel* model; UgtkSelectorItem* item; path = gtk_tree_path_new_from_string (path_str); model = gtk_tree_view_get_model (view); gtk_tree_model_get_iter (model, &iter, path); gtk_tree_path_free (path); gtk_tree_model_get (model, &iter, 0, &item, -1); item->mark ^= 1; } static GtkTreeView* ugtk_selector_view_new (const gchar* title, gboolean active_toggled) { GtkTreeView* view; GtkCellRenderer* renderer; GtkTreeViewColumn* column; view = (GtkTreeView*) gtk_tree_view_new (); // gtk_tree_view_set_fixed_height_mode (view, TRUE); // UgtkSelectorItem.mark renderer = gtk_cell_renderer_toggle_new (); column = gtk_tree_view_column_new (); gtk_tree_view_column_set_title (column, "M"); gtk_tree_view_column_pack_start (column, renderer, TRUE); gtk_tree_view_column_set_cell_data_func (column, renderer, col_set_toggle, NULL, NULL); gtk_tree_view_column_set_resizable (column, FALSE); gtk_tree_view_column_set_alignment (column, 0.5); gtk_tree_view_column_set_min_width (column, 15); // gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_FIXED); gtk_tree_view_append_column (view, column); if (active_toggled) { g_signal_connect (renderer, "toggled", G_CALLBACK (on_cell_toggled), view); } // UgtkSelectorItem.uri renderer = gtk_cell_renderer_text_new (); column = gtk_tree_view_column_new (); gtk_tree_view_column_set_title (column, title); gtk_tree_view_column_pack_start (column, renderer, TRUE); gtk_tree_view_column_set_cell_data_func (column, renderer, col_set_uri, NULL, NULL); gtk_tree_view_column_set_resizable (column, TRUE); // gtk_tree_view_column_set_expand (column, TRUE); // gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_FIXED); gtk_tree_view_append_column (view, column); gtk_widget_show (GTK_WIDGET (view)); return view; } static GtkCellRenderer* ugtk_selector_view_get_renderer_toggle (GtkTreeView* view) { GtkCellRenderer* renderer; GtkTreeViewColumn* column; GList* list; column = gtk_tree_view_get_column (view, 0); list = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (column)); renderer = list->data; g_list_free (list); return renderer; } // UI static void ugtk_selector_init_ui (UgtkSelector* selector) { GtkBox* vbox; GtkBox* hbox; GtkWidget* widget; gchar* string; selector->self = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2); vbox = (GtkBox*) selector->self; hbox = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); gtk_box_pack_start (vbox, (GtkWidget*) hbox, FALSE, FALSE, 1); string = g_strconcat (_("Base hypertext reference"), " :", NULL); selector->href_label = gtk_label_new (string); g_free (string); gtk_box_pack_start (hbox, selector->href_label, FALSE, TRUE, 1); selector->href_entry = (GtkEntry*) gtk_entry_new (); gtk_box_pack_start (vbox, (GtkWidget*) selector->href_entry, FALSE, FALSE, 1); selector->href_separator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL); gtk_box_pack_start (vbox, selector->href_separator, FALSE, FALSE, 1); selector->notebook = (GtkNotebook*) gtk_notebook_new (); gtk_box_pack_start (vbox, (GtkWidget*) selector->notebook, TRUE, TRUE, 1); hbox = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); gtk_box_pack_start (vbox, (GtkWidget*) hbox, FALSE, FALSE, 1); // select all widget = gtk_button_new_with_mnemonic (_("Mark _All")); gtk_box_pack_start (hbox, widget, TRUE, TRUE, 1); selector->select_all = widget; // select none widget = gtk_button_new_with_mnemonic (_("Mark _None")); gtk_box_pack_start (hbox, widget, TRUE, TRUE, 1); selector->select_none = widget; // select by filter widget = gtk_button_new_with_mnemonic (_("_Mark by filter...")); gtk_box_pack_start (hbox, widget, TRUE, TRUE, 1); selector->select_filter = widget; gtk_widget_show_all ((GtkWidget*) vbox); } uget-2.2.0/ui-gtk/UgtkApp-callback.c0000644000175000000120000004720013224532612014042 00000000000000/* * * Copyright (C) 2012-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #include #include #include // static functions static void ugtk_window_init_callback (struct UgtkWindow* window, UgtkApp* app); static void ugtk_toolbar_init_callback (struct UgtkToolbar* toolbar, UgtkApp* app); // functions for UgetNode.notification static void node_inserted (UgetNode* node, UgetNode* sibling, UgetNode* child); static void node_removed (UgetNode* node, UgetNode* sibling, UgetNode* child); static void node_updated (UgetNode* child); void ugtk_app_init_callback (UgtkApp* app) { // gtk_accel_group_connect (app->accel_group, GDK_KEY_q, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE, // g_cclosure_new_swap (G_CALLBACK (ugtk_app_quit), app, NULL)); // gtk_accel_group_connect (app->accel_group, GDK_KEY_s, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE, // g_cclosure_new_swap (G_CALLBACK (ugtk_app_save), app, NULL)); // gtk_accel_group_connect (app->accel_group, GDK_KEY_c, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE, // g_cclosure_new_swap (G_CALLBACK (on_summary_copy_selected), app, NULL)); ugtk_window_init_callback (&app->window, app); ugtk_menubar_init_callback (&app->menubar, app); ugtk_toolbar_init_callback (&app->toolbar, app); ugtk_trayicon_init_callback (&app->trayicon, app); // node notification uget_app_set_notification ((UgetApp*) app, app, node_inserted, node_removed, (UgNotifyFunc) node_updated); } // ---------------------------------------------------------------------------- // Toolbar static void on_create_download (GtkWidget* widget, UgtkApp* app) { ugtk_app_create_download (app, NULL, NULL); } static void on_set_download_runnable (GtkWidget* widget, UgtkApp* app) { ugtk_app_queue_download (app, TRUE); } // ---------------------------------------------------------------------------- // UgtkWindow // UgtkTraveler.download.view selection "changed" static void on_download_selection_changed (GtkTreeSelection* selection, UgtkApp* app) { gint n_selected; n_selected = gtk_tree_selection_count_selected_rows (selection); ugtk_statusbar_set_info (&app->statusbar, n_selected); ugtk_app_decide_download_sensitive (app); } // UgtkTraveler.download.view "cursor-changed" static void on_download_cursor_changed (GtkTreeView* view, UgtkApp* app) { GtkWidget* item; UgetNode* node; UgetRelation* relation; UgetPriority priority; node = app->traveler.download.cursor.node; if (node) node = node->data; ugtk_summary_show (&app->summary, node); // UgtkMenubar.download.priority if (node == NULL) priority = UGET_PRIORITY_NORMAL; else { relation = ug_info_get (&node->info, UgetRelationInfo); if (relation) priority = relation->task.priority; else priority = UGET_PRIORITY_NORMAL; } // set item switch (priority) { case UGET_PRIORITY_HIGH: item = app->menubar.download.prioriy.high; break; case UGET_PRIORITY_LOW: item = app->menubar.download.prioriy.low; break; case UGET_PRIORITY_NORMAL: default: item = app->menubar.download.prioriy.normal; break; } gtk_check_menu_item_set_active ((GtkCheckMenuItem*) item, TRUE); } // UgtkTraveler.category.view "cursor-changed" // UgtkTraveler.state.view "cursor-changed" static void on_category_cursor_changed (GtkTreeView* view, UgtkApp* app) { UgtkTraveler* traveler; traveler = &app->traveler; if (traveler->state.cursor.pos != traveler->state.cursor.pos_last || traveler->category.cursor.pos != traveler->category.cursor.pos_last) { // set sorting column ugtk_traveler_set_sorting (traveler, TRUE, app->setting.download_column.sort.nth, app->setting.download_column.sort.type); } // show/hide download column and setup items in UgtkViewMenu if (traveler->state.cursor.pos != traveler->state.cursor.pos_last) { struct UgtkDownloadColumnSetting* setting; GtkTreeView* view; GtkTreeViewColumn* column; gboolean sensitive; view = traveler->download.view; setting = &app->setting.download_column; // Finished if (traveler->state.cursor.pos == 3) sensitive = FALSE; else sensitive = TRUE; gtk_widget_set_sensitive (app->menubar.view.columns.complete, sensitive); gtk_widget_set_sensitive (app->menubar.view.columns.percent, sensitive); column = gtk_tree_view_get_column (view, UGTK_NODE_COLUMN_COMPLETE); gtk_tree_view_column_set_visible (column, sensitive && setting->complete); column = gtk_tree_view_get_column (view, UGTK_NODE_COLUMN_PERCENT); gtk_tree_view_column_set_visible (column, sensitive && setting->percent); // Recycled if (traveler->state.cursor.pos == 4) sensitive = FALSE; else sensitive = TRUE; gtk_widget_set_sensitive (app->menubar.view.columns.elapsed, sensitive); column = gtk_tree_view_get_column (view, UGTK_NODE_COLUMN_ELAPSED); gtk_tree_view_column_set_visible (column, sensitive && setting->elapsed); // Finished & Recycled if (traveler->state.cursor.pos == 3 || traveler->state.cursor.pos == 4) sensitive = FALSE; else sensitive = TRUE; gtk_widget_set_sensitive (app->menubar.view.columns.left, sensitive); gtk_widget_set_sensitive (app->menubar.view.columns.speed, sensitive); gtk_widget_set_sensitive (app->menubar.view.columns.upload_speed, sensitive); gtk_widget_set_sensitive (app->menubar.view.columns.uploaded, sensitive); gtk_widget_set_sensitive (app->menubar.view.columns.ratio, sensitive); column = gtk_tree_view_get_column (view, UGTK_NODE_COLUMN_LEFT); gtk_tree_view_column_set_visible (column, sensitive && setting->left); column = gtk_tree_view_get_column (view, UGTK_NODE_COLUMN_SPEED); gtk_tree_view_column_set_visible (column, sensitive && setting->speed); column = gtk_tree_view_get_column (view, UGTK_NODE_COLUMN_UPLOAD_SPEED); gtk_tree_view_column_set_visible (column, sensitive && setting->upload_speed); column = gtk_tree_view_get_column (view, UGTK_NODE_COLUMN_UPLOADED); gtk_tree_view_column_set_visible (column, sensitive && setting->uploaded); column = gtk_tree_view_get_column (view, UGTK_NODE_COLUMN_RATIO); gtk_tree_view_column_set_visible (column, sensitive && setting->ratio); } if (view == app->traveler.category.view) { ugtk_app_decide_category_sensitive (app); // sync UgtkMenubar.download.move_to ugtk_menubar_sync_category (&app->menubar, app, FALSE); } } // button-press-event static gboolean on_button_press_event (GtkTreeView* view, GdkEventButton* event, UgtkApp* app) { GtkTreeSelection* selection; GtkTreePath* path; GtkMenu* menu; gboolean is_selected; // right button press // if (event->type != GDK_BUTTON_PRESS) // return FALSE; if (event->button != 3) // right mouse button return FALSE; // popup a menu if (view == app->traveler.category.view) menu = (GtkMenu*) app->menubar.category.self; else if (view == app->traveler.download.view) menu = (GtkMenu*) app->menubar.download.self; else if (view == app->summary.view) menu = app->summary.menu.self; else return FALSE; gtk_menu_popup (menu, NULL, NULL, NULL, NULL, event->button, gtk_get_current_event_time()); if (gtk_tree_view_get_path_at_pos (view, (gint)event->x, (gint)event->y, &path, NULL, NULL, NULL)) { selection = gtk_tree_view_get_selection (view); is_selected = gtk_tree_selection_path_is_selected (selection, path); gtk_tree_path_free (path); if (is_selected) return TRUE; } return FALSE; } // UgtkSummary.menu.copy signal handler static void on_summary_copy_selected (GtkWidget* widget, UgtkApp* app) { gchar* text; text = ugtk_summary_get_text_selected (&app->summary); ugtk_clipboard_set_text (&app->clipboard, text); } // UgtkSummary.menu.copy_all signal handler static void on_summary_copy_all (GtkWidget* widget, UgtkApp* app) { gchar* text; text = ugtk_summary_get_text_all (&app->summary); ugtk_clipboard_set_text (&app->clipboard, text); } // This function is used by on_window_key_press_event() static void menu_position_func (GtkMenu* menu, gint* x, gint* y, gboolean* push_in, gpointer user_data) { GtkRequisition menu_requisition; GtkAllocation allocation; GtkWidget* widget; gint max_x, max_y; widget = user_data; gdk_window_get_origin (gtk_widget_get_window (widget), x, y); gtk_widget_get_preferred_size (GTK_WIDGET (menu), &menu_requisition, NULL); gtk_widget_get_allocation (widget, &allocation); if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) *x += allocation.width - allocation.width / 3; else *x += allocation.width / 3; *y += allocation.height / 3; // if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) // *x += allocation.width - menu_requisition.width; // else // *x += allocation.x; // *y += allocation.y + allocation.height; // Make sure we are on the screen. max_x = MAX (0, gdk_screen_width () - menu_requisition.width); max_y = MAX (0, gdk_screen_height () - menu_requisition.height); *x = CLAMP (*x, 0, max_x); *y = CLAMP (*y, 0, max_y); } // key-press-event static gboolean on_window_key_press_event (GtkWidget* widget, GdkEventKey* event, UgtkApp* app) { GtkTreeView* focus; GtkMenu* menu; // g_print ("key-press : 0x%x\n", event->keyval); if (event->keyval != GDK_KEY_Menu) return FALSE; focus = (GtkTreeView*) gtk_window_get_focus (app->window.self); if (focus == app->traveler.category.view) { widget = (GtkWidget*) app->traveler.category.view; menu = (GtkMenu*) app->menubar.category.self; } else if (focus == app->traveler.download.view) { widget = (GtkWidget*) app->traveler.download.view; menu = (GtkMenu*) app->menubar.download.self; } else if (focus == app->summary.view) { widget = (GtkWidget*) app->summary.view; menu = (GtkMenu*) app->summary.menu.self; } else return FALSE; gtk_menu_popup (menu, NULL, NULL, menu_position_func, widget, 0, gtk_get_current_event_time()); return TRUE; } // UgtkWindow.self "delete-event" static gboolean on_window_delete_event (GtkWidget* widget, GdkEvent* event, UgtkApp* app) { if (app->setting.ui.close_to_tray == FALSE) ugtk_app_decide_to_quit (app); else { ugtk_tray_icon_set_visible (&app->trayicon, TRUE); gtk_widget_hide ((GtkWidget*) app->window.self); } return TRUE; } // UgtkTraveler.download.view "key-press-event" static gboolean on_traveler_key_press_event (GtkWidget* widget, GdkEventKey* event, UgtkApp* app) { /* // check shift key status GdkWindow* gdk_win; GdkDevice* dev_pointer; GdkModifierType mask; // check shift key status gdk_win = gtk_widget_get_parent_window ((GtkWidget*) app->cwidget.current.widget->view); dev_pointer = gdk_device_manager_get_client_pointer ( gdk_display_get_device_manager (gdk_window_get_display (gdk_win))); gdk_window_get_device_position (gdk_win, dev_pointer, NULL, NULL, &mask); if (app->cwidget.current.category) { switch (event->keyval) { case GDK_KEY_Delete: case GDK_KEY_KP_Delete: if (mask & GDK_SHIFT_MASK) ugtk_app_delete_download (app, TRUE); else ugtk_app_delete_download (app, FALSE); return TRUE; case GDK_KEY_Return: case GDK_KEY_KP_Enter: if (mask & GDK_SHIFT_MASK) on_open_download_folder (widget, app); else on_open_download_file (widget, app); return TRUE; } } */ switch (event->keyval) { case GDK_KEY_Delete: ugtk_app_delete_download (app, FALSE); return TRUE; case GDK_KEY_space: ugtk_app_switch_download_state (app); return TRUE; default: break; } return FALSE; } static void ugtk_window_init_callback (struct UgtkWindow* window, UgtkApp* app) { GtkTreeSelection* selection; // UgtkTraveler selection = gtk_tree_view_get_selection (app->traveler.download.view); g_signal_connect (selection, "changed", G_CALLBACK (on_download_selection_changed), app); g_signal_connect (app->traveler.download.view, "cursor-changed", G_CALLBACK (on_download_cursor_changed), app); g_signal_connect_after (app->traveler.category.view, "cursor-changed", G_CALLBACK (on_category_cursor_changed), app); g_signal_connect_after (app->traveler.state.view, "cursor-changed", G_CALLBACK (on_category_cursor_changed), app); // pop-up menu by mouse button g_signal_connect (app->traveler.category.view, "button-press-event", G_CALLBACK (on_button_press_event), app); g_signal_connect (app->traveler.download.view, "button-press-event", G_CALLBACK (on_button_press_event), app); g_signal_connect (app->summary.view, "button-press-event", G_CALLBACK (on_button_press_event), app); // UgtkSummary.menu signal handlers g_signal_connect (app->summary.menu.copy, "activate", G_CALLBACK (on_summary_copy_selected), app); g_signal_connect (app->summary.menu.copy_all, "activate", G_CALLBACK (on_summary_copy_all), app); // UgtkWindow.self signal handlers g_signal_connect (window->self, "key-press-event", G_CALLBACK (on_window_key_press_event), app); g_signal_connect (window->self, "delete-event", G_CALLBACK (on_window_delete_event), app); g_signal_connect_swapped (window->self, "destroy", G_CALLBACK (ugtk_app_quit), app); // UgtkTraveler signal handlers g_signal_connect (app->traveler.download.view, "key-press-event", G_CALLBACK (on_traveler_key_press_event), app); } // ---------------------------------------------------------------------------- // UgtkToolbar static void ugtk_toolbar_init_callback (struct UgtkToolbar* toolbar, UgtkApp* app) { // create new g_signal_connect (toolbar->create, "clicked", G_CALLBACK (on_create_download), app); g_signal_connect (toolbar->create_download, "activate", G_CALLBACK (on_create_download), app); g_signal_connect_swapped (toolbar->create_category, "activate", G_CALLBACK (ugtk_app_create_category), app); g_signal_connect_swapped (toolbar->create_sequence, "activate", G_CALLBACK (ugtk_app_sequence_batch), app); g_signal_connect_swapped (toolbar->create_clipboard, "activate", G_CALLBACK (ugtk_app_clipboard_batch), app); g_signal_connect_swapped (toolbar->create_torrent, "activate", G_CALLBACK (ugtk_app_create_torrent), app); g_signal_connect_swapped (toolbar->create_metalink, "activate", G_CALLBACK (ugtk_app_create_metalink), app); // save g_signal_connect_swapped (toolbar->save, "clicked", G_CALLBACK (ugtk_app_save), app); // change status g_signal_connect (toolbar->runnable, "clicked", G_CALLBACK (on_set_download_runnable), app); g_signal_connect_swapped (toolbar->pause, "clicked", G_CALLBACK (ugtk_app_pause_download), app); // change data g_signal_connect_swapped (toolbar->properties, "clicked", G_CALLBACK (ugtk_app_edit_download), app); // move g_signal_connect_swapped (toolbar->move_up, "clicked", G_CALLBACK (ugtk_app_move_download_up), app); g_signal_connect_swapped (toolbar->move_down, "clicked", G_CALLBACK (ugtk_app_move_download_down), app); g_signal_connect_swapped (toolbar->move_top, "clicked", G_CALLBACK (ugtk_app_move_download_top), app); g_signal_connect_swapped (toolbar->move_bottom, "clicked", G_CALLBACK (ugtk_app_move_download_bottom), app); } // ---------------------------------------------------------------------------- // functions for UgetNode.notification static void node_inserted (UgetNode* node, UgetNode* sibling, UgetNode* child) { GtkTreePath* path; GtkTreeIter iter; UgtkApp* app; app = node->notification->data; if (node == (UgetNode*) app->traveler.category.model->root) { // category inserted path = gtk_tree_path_new_from_indices ( uget_node_child_position (node, child) +1, -1); iter.stamp = app->traveler.category.model->stamp; iter.user_data = child; gtk_tree_model_row_inserted ( GTK_TREE_MODEL (app->traveler.category.model), path, &iter); gtk_tree_path_free (path); // sync UgtkMenubar.download.move_to ugtk_menubar_sync_category (&app->menubar, app, TRUE); } else if (node == (UgetNode*) app->traveler.download.model->root) { // download inserted path = gtk_tree_path_new_from_indices ( uget_node_child_position (node, child), -1); iter.stamp = app->traveler.download.model->stamp; iter.user_data = child; gtk_tree_model_row_inserted ( GTK_TREE_MODEL (app->traveler.download.model), path, &iter); gtk_tree_path_free (path); } } static void node_removed (UgetNode* node, UgetNode* sibling, UgetNode* child) { GtkTreePath* path; UgtkApp* app; int pos; app = node->notification->data; if (node == (UgetNode*) app->traveler.category.model->root) { // category removed if (sibling) pos = uget_node_child_position (node, sibling); else pos = app->traveler.category.model->root->n_children; // pos + "All Category" path = gtk_tree_path_new_from_indices (pos + 1, -1); gtk_tree_model_row_deleted ( GTK_TREE_MODEL (app->traveler.category.model), path); gtk_tree_path_free (path); // sync UgtkMenubar.download.move_to ugtk_menubar_sync_category (&app->menubar, app, TRUE); } else if (node == (UgetNode*) app->traveler.download.model->root) { // download removed if (sibling) pos = uget_node_child_position (node, sibling); else pos = app->traveler.download.model->root->n_children; path = gtk_tree_path_new_from_indices (pos, -1); gtk_tree_model_row_deleted ( GTK_TREE_MODEL (app->traveler.download.model), path); gtk_tree_path_free (path); } } static void node_updated (UgetNode* child) { GtkTreePath* path; GtkTreeIter iter; UgetNode* node; UgtkApp* app; node = child->parent; app = node->notification->data; if (node == (UgetNode*) app->traveler.category.model->root) { // category changed path = gtk_tree_path_new_from_indices ( uget_node_child_position (node, child) +1, -1); iter.stamp = app->traveler.category.model->stamp; iter.user_data = child; gtk_tree_model_row_changed ( GTK_TREE_MODEL (app->traveler.category.model), path, &iter); gtk_tree_path_free (path); // sync UgtkMenubar.download.move_to ugtk_menubar_sync_category (&app->menubar, app, TRUE); } else if (node == (UgetNode*) app->traveler.download.model->root) { // download changed path = gtk_tree_path_new_from_indices ( uget_node_child_position (node, child), -1); iter.stamp = app->traveler.download.model->stamp; iter.user_data = child; gtk_tree_model_row_changed ( GTK_TREE_MODEL (app->traveler.download.model), path, &iter); gtk_tree_path_free (path); } } uget-2.2.0/ui-gtk/UgtkSettingDialog.c0000644000175000000120000002376513224532612014337 00000000000000/* * * Copyright (C) 2005-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include // Callback static void on_cursor_changed (GtkTreeView* view, UgtkSettingDialog* sdialog); static void on_response (GtkDialog *dialog, gint response_id, UgtkSettingDialog* sdialog); UgtkSettingDialog* ugtk_setting_dialog_new (const gchar* title, GtkWindow* parent) { PangoContext* context; PangoLayout* layout; int text_width; UgtkSettingDialog* dialog; GtkCellRenderer* renderer; GtkWidget* widget; GtkBox* vbox; GtkBox* hbox; dialog = g_malloc0 (sizeof (UgtkSettingDialog)); dialog->self = (GtkDialog*) gtk_dialog_new_with_buttons (title, parent, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OK, GTK_RESPONSE_OK, NULL); #if GTK_MAJOR_VERSION <= 3 && GTK_MINOR_VERSION < 14 gtk_window_set_has_resize_grip ((GtkWindow*) dialog->self, FALSE); #endif gtk_dialog_set_default_response (dialog->self, GTK_RESPONSE_OK); vbox = (GtkBox*) gtk_dialog_get_content_area (dialog->self); hbox = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); gtk_box_pack_start (vbox, GTK_WIDGET (hbox), FALSE, FALSE, 2); // Notebook widget = gtk_notebook_new (); gtk_widget_set_size_request (widget, 430, 320); gtk_box_pack_end (hbox, widget, TRUE, TRUE, 3); dialog->notebook = (GtkNotebook*) widget; gtk_notebook_set_show_tabs (dialog->notebook, FALSE); gtk_notebook_set_show_border (dialog->notebook, FALSE); // get text width context = gtk_widget_get_pango_context (widget); layout = pango_layout_new (context); pango_layout_set_text (layout, "User Interface", -1); pango_layout_get_pixel_size (layout, &text_width, NULL); g_object_unref (layout); text_width = text_width * 5 / 3; if (text_width < 130) text_width = 130; // TreeView dialog->list_store = gtk_list_store_new (1, G_TYPE_STRING); widget = gtk_tree_view_new_with_model ( GTK_TREE_MODEL (dialog->list_store)); gtk_widget_set_size_request (widget, text_width, 120); gtk_box_pack_start (hbox, widget, FALSE, FALSE, 0); dialog->tree_view = (GtkTreeView*) widget; gtk_tree_view_set_headers_visible (dialog->tree_view, FALSE); renderer = gtk_cell_renderer_text_new (); gtk_tree_view_insert_column_with_attributes ( dialog->tree_view, 0, _("Name"), renderer, "text", 0, NULL); g_signal_connect (dialog->tree_view, "cursor-changed", G_CALLBACK (on_cursor_changed), dialog); // ------------------------------------------------------------------------ // UI settings page vbox = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 2); gtk_container_set_border_width (GTK_CONTAINER (vbox), 2); ugtk_user_interface_form_init (&dialog->ui); gtk_box_pack_start (vbox, dialog->ui.self, FALSE, FALSE, 2); ugtk_setting_dialog_add (dialog, _("User Interface"), (GtkWidget*) vbox); // ------------------------------------------------------------------------ // Clipboard settings page ugtk_clipboard_form_init (&dialog->clipboard); gtk_container_set_border_width (GTK_CONTAINER (dialog->clipboard.self), 2); ugtk_setting_dialog_add (dialog, _("Clipboard"), dialog->clipboard.self); // ------------------------------------------------------------------------ // Bandwidth settings page ugtk_bandwidth_form_init (&dialog->bandwidth); gtk_container_set_border_width (GTK_CONTAINER (dialog->bandwidth.self), 2); ugtk_setting_dialog_add (dialog, _("Bandwidth"), dialog->bandwidth.self); // ------------------------------------------------------------------------ // Scheduler settings page ugtk_schedule_form_init (&dialog->scheduler); gtk_container_set_border_width (GTK_CONTAINER (dialog->scheduler.self), 2); ugtk_setting_dialog_add (dialog, _("Scheduler"), dialog->scheduler.self); // ------------------------------------------------------------------------ // Plugin settings page ugtk_plugin_form_init (&dialog->plugin); gtk_container_set_border_width (GTK_CONTAINER (dialog->plugin.self), 2); ugtk_setting_dialog_add (dialog, _("Plug-in"), dialog->plugin.self); // ------------------------------------------------------------------------ // Plugin Media & Media Website settings page ugtk_media_website_form_init (&dialog->media_website); gtk_container_set_border_width (GTK_CONTAINER (dialog->media_website.self), 2); ugtk_setting_dialog_add (dialog, _("Media website"), dialog->media_website.self); // ------------------------------------------------------------------------ // Others settings page vbox = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 2); gtk_container_set_border_width (GTK_CONTAINER (vbox), 2); ugtk_setting_dialog_add (dialog, _("Others"), (GtkWidget*) vbox); ugtk_commandline_form_init (&dialog->commandline); gtk_box_pack_start (vbox, dialog->commandline.self, FALSE, FALSE, 4); gtk_box_pack_start (vbox, gtk_label_new (""), FALSE, FALSE, 0); ugtk_auto_save_form_init (&dialog->auto_save); gtk_box_pack_start (vbox, dialog->auto_save.self, FALSE, FALSE, 2); gtk_box_pack_start (vbox, gtk_label_new (""), FALSE, FALSE, 0); ugtk_completion_form_init (&dialog->completion); gtk_box_pack_start (vbox, dialog->completion.self, FALSE, FALSE, 2); gtk_widget_show_all ((GtkWidget*) hbox); // gtk_container_set_focus_child (GTK_CONTAINER (dialog->self), dialog->pattern_entry); // g_signal_connect (dialog->pattern_entry, "key-press-event", G_CALLBACK (on_key_press_event), dialog); return dialog; } void ugtk_setting_dialog_free (UgtkSettingDialog* dialog) { gtk_widget_destroy ((GtkWidget*) dialog->self); g_free (dialog); } void ugtk_setting_dialog_run (UgtkSettingDialog* dialog, UgtkApp* app) { dialog->app = app; g_signal_connect (dialog->self, "response", G_CALLBACK (on_response), dialog); gtk_widget_show ((GtkWidget*) dialog->self); } void ugtk_setting_dialog_set (UgtkSettingDialog* dialog, UgtkSetting* setting) { ugtk_schedule_form_set (&dialog->scheduler, setting); ugtk_clipboard_form_set (&dialog->clipboard, setting); ugtk_bandwidth_form_set (&dialog->bandwidth, setting); ugtk_user_interface_form_set (&dialog->ui, setting); ugtk_completion_form_set (&dialog->completion, setting); ugtk_auto_save_form_set (&dialog->auto_save, setting); ugtk_commandline_form_set (&dialog->commandline, setting); ugtk_plugin_form_set (&dialog->plugin, setting); ugtk_media_website_form_set (&dialog->media_website, setting); } void ugtk_setting_dialog_get (UgtkSettingDialog* dialog, UgtkSetting* setting) { ugtk_schedule_form_get (&dialog->scheduler, setting); ugtk_clipboard_form_get (&dialog->clipboard, setting); ugtk_bandwidth_form_get (&dialog->bandwidth, setting); ugtk_user_interface_form_get (&dialog->ui, setting); ugtk_completion_form_get (&dialog->completion, setting); ugtk_auto_save_form_get (&dialog->auto_save, setting); ugtk_commandline_form_get (&dialog->commandline, setting); ugtk_plugin_form_get (&dialog->plugin, setting); ugtk_media_website_form_get (&dialog->media_website, setting); } void ugtk_setting_dialog_add (UgtkSettingDialog* sdialog, const gchar* title, GtkWidget* page) { GtkTreeIter iter; gtk_list_store_append (sdialog->list_store, &iter); gtk_list_store_set (sdialog->list_store, &iter, 0, title, -1); gtk_notebook_append_page (sdialog->notebook, page, gtk_label_new (title)); } void ugtk_setting_dialog_set_page (UgtkSettingDialog* sdialog, int nth) { GtkTreePath* path; path = gtk_tree_path_new_from_indices (nth, -1); gtk_tree_view_set_cursor (sdialog->tree_view, path, NULL, FALSE); gtk_tree_path_free (path); gtk_notebook_set_current_page (sdialog->notebook, nth); } // ---------------------------------------------------------------------------- // Callback static void on_cursor_changed (GtkTreeView* view, UgtkSettingDialog* sdialog) { GtkTreePath* path; int nth; gtk_tree_view_get_cursor (view, &path, NULL); if (path == NULL) return; nth = *gtk_tree_path_get_indices (path); gtk_tree_path_free (path); gtk_notebook_set_current_page (sdialog->notebook, nth); } static void on_response (GtkDialog *dialog, gint response_id, UgtkSettingDialog* sdialog) { UgtkApp* app; app = sdialog->app; if (app) app->dialogs.setting = NULL; if (response_id == GTK_RESPONSE_OK) { ugtk_setting_dialog_get (sdialog, &app->setting); ugtk_app_set_ui_setting (app, &app->setting); ugtk_app_set_menu_setting (app, &app->setting); ugtk_app_set_other_setting (app, &app->setting); ugtk_app_set_plugin_setting (app, &app->setting); } ugtk_setting_dialog_free (sdialog); } uget-2.2.0/ui-gtk/UgtkAboutDialog.c0000644000175000000120000001332613224532612013764 00000000000000static const char uget_license[] = { " Copyright (C) 2005-2018 by C.H. Huang" "\n" " plushuang.tw@gmail.com" "\n" "\n" "This library is free software; you can redistribute it and/or" "\n" "modify it under the terms of the GNU Lesser General Public" "\n" "License as published by the Free Software Foundation; either" "\n" "version 2.1 of the License, or (at your option) any later version." "\n" "\n" "This library is distributed in the hope that it will be useful," "\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of" "\n" "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU" "\n" "Lesser General Public License for more details." "\n" "\n" "You should have received a copy of the GNU Lesser General Public" "\n" "License along with this library; if not, write to the Free Software" "\n" "Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA" "\n" "\n" "---------" "\n" "\n" "In addition, as a special exception, the copyright holders give" "\n" "permission to link the code of portions of this program with the" "\n" "OpenSSL library under certain conditions as described in each" "\n" "individual source file, and distribute linked combinations" "\n" "including the two." "\n" "You must obey the GNU Lesser General Public License in all respects" "\n" "for all of the code used other than OpenSSL. If you modify" "\n" "file(s) with this exception, you may extend this exception to your" "\n" "version of the file(s), but you are not obligated to do so. If you" "\n" "do not wish to do so, delete this exception statement from your" "\n" "version. If you delete this exception statement from all source" "\n" "files in the program, then also delete it here." "\n" "\0" }; #include #include #include #define UGET_URL_WEBSITE "http://ugetdm.com/" // static data static const gchar* uget_authors[] = { "C.H. Huang (\xE9\xBB\x83\xE6\xAD\xA3\xE9\x9B\x84)", NULL }; static const gchar* uget_artists[] = { "Michael Tunnell (visuex.com)", NULL}; static const gchar* uget_comments = N_("Download Manager"); static const gchar* uget_copyright = "Copyright (C) 2005-2018 C.H. Huang"; static const gchar* translator_credits = N_("translator-credits"); static void ugtk_about_dialog_on_response (GtkWidget* widget, gint response_id, UgtkAboutDialog* adialog) { // GTK_RESPONSE_CANCEL ugtk_about_dialog_free (adialog); } UgtkAboutDialog* ugtk_about_dialog_new (GtkWindow* parent) { UgtkAboutDialog* adialog; GtkScrolledWindow* scrolled; GtkTextBuffer* textbuf; GtkWidget* textview; GtkBox* box; char* path; char* comments; adialog = g_malloc (sizeof (UgtkAboutDialog)); adialog->self = (GtkDialog*) gtk_about_dialog_new (); gtk_window_set_transient_for ((GtkWindow*) adialog->self, parent); gtk_dialog_set_default_response (adialog->self, GTK_RESPONSE_CANCEL); path = g_build_filename ( ugtk_get_data_dir (), "pixmaps", "uget", "logo.png", NULL); adialog->pixbuf = gdk_pixbuf_new_from_file (path, NULL); g_free (path); comments = g_strconcat ( gettext (uget_comments), "\n", _("uGet Founder: "), uget_authors[0], "\n", _("uGet Project Manager: "), uget_artists[0], "\n", NULL); g_object_set (adialog->self, // "logo-icon-name", UGTK_APP_ICON_NAME, "logo", adialog->pixbuf, "program-name", UGTK_APP_NAME, "version", PACKAGE_VERSION, "comments", comments, "copyright", uget_copyright, #if defined _WIN32 || defined _WIN64 "website-label", UGET_URL_WEBSITE, #else "website", UGET_URL_WEBSITE, #endif "license", uget_license, "authors", uget_authors, "artists", uget_artists, "translator-credits", gettext (translator_credits), NULL); g_free (comments); textview = gtk_text_view_new (); textbuf = gtk_text_view_get_buffer ((GtkTextView*) textview); adialog->textbuf = textbuf; adialog->scrolled = gtk_scrolled_window_new (NULL, NULL); scrolled = (GtkScrolledWindow*) adialog->scrolled; gtk_widget_set_size_request ((GtkWidget*) scrolled, 200, 120); gtk_scrolled_window_set_shadow_type (scrolled, GTK_SHADOW_IN); gtk_scrolled_window_set_policy (scrolled, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_container_add (GTK_CONTAINER (scrolled), textview); gtk_widget_hide ((GtkWidget*) scrolled); box = (GtkBox*) gtk_dialog_get_content_area (adialog->self); gtk_box_pack_end (box, (GtkWidget*) scrolled, TRUE, TRUE, 2); g_signal_connect (adialog->self, "response", G_CALLBACK (ugtk_about_dialog_on_response), adialog); return adialog; } void ugtk_about_dialog_free (UgtkAboutDialog* adialog) { gtk_widget_destroy ((GtkWidget*) adialog->self); if (adialog->pixbuf) g_object_unref (adialog->pixbuf); g_free (adialog); } void ugtk_about_dialog_set_info (UgtkAboutDialog* adialog, const gchar* info_text) { gtk_text_buffer_set_text (adialog->textbuf, info_text, -1); gtk_widget_show_all ((GtkWidget*) adialog->scrolled); } void ugtk_about_dialog_run (UgtkAboutDialog* adialog) { gtk_dialog_run (adialog->self); } uget-2.2.0/ui-gtk/UgtkDownloadForm.h0000644000175000000120000001105413224532612014166 00000000000000/* * * Copyright (C) 2005-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #ifndef UGTK_DOWNLOAD_FORM_H #define UGTK_DOWNLOAD_FORM_H #include #include #include #ifdef __cplusplus extern "C" { #endif typedef struct UgtkDownloadForm UgtkDownloadForm; typedef struct UgtkSetting UgtkSetting; struct UgtkDownloadForm { GtkWindow* parent; // parent window of UgtkDownloadForm.self // ---------------------------------------------------- // Page 1 // GtkWidget* page1; GtkWidget* uri_label; GtkWidget* uri_entry; // GtkWidget* url_button; GtkWidget* mirrors_label; GtkWidget* mirrors_entry; // GtkWidget* mirror_button; GtkWidget* file_label; GtkWidget* file_entry; // GtkWidget* file_button; GtkWidget* folder_combo; GtkWidget* folder_entry; // GtkWidget* folder_button; // GtkWidget* referrer_label; GtkWidget* referrer_entry; // widgets for login fields // GtkWidget* username_label; GtkWidget* username_entry; // GtkWidget* password_label; GtkWidget* password_entry; // widgets for Status GtkWidget* radio_runnable; GtkWidget* radio_pause; // Connections per server GtkWidget* title_connections; GtkWidget* label_connections; GtkWidget* spin_connections; // connections // ---------------------------------------------------- // Page 2 // GtkWidget* page2; GtkWidget* cookie_label; GtkWidget* cookie_entry; GtkWidget* post_label; GtkWidget* post_entry; GtkWidget* agent_label; // user agent GtkWidget* agent_entry; GtkSpinButton* spin_download_speed; GtkSpinButton* spin_upload_speed; // GtkWidget* spin_parts; // GtkWidget* spin_redirect; GtkWidget* spin_retry; // counts GtkWidget* spin_delay; // seconds GtkToggleButton* timestamp; // ---------------------------------------------------- // User changed entry // struct UgtkDownloadFormChanged { gboolean enable:1; gboolean uri:1; gboolean mirrors:1; gboolean file:1; gboolean folder:1; gboolean user:1; gboolean password:1; gboolean referrer:1; gboolean cookie:1; gboolean post:1; gboolean agent:1; gboolean retry:1; // spin_retry gboolean delay:1; // spin_delay gboolean connections:1; // spin_connections gboolean max_upload_speed:1; // spin_upload_speed gboolean max_download_speed:1; // spin_download_speed gboolean timestamp:1; } changed; gboolean completed:1; }; void ugtk_download_form_init (UgtkDownloadForm* dform, UgtkProxyForm* proxy, GtkWindow* parent); void ugtk_download_form_get (UgtkDownloadForm* dform, UgetNode* node); void ugtk_download_form_set (UgtkDownloadForm* dform, UgetNode* node, gboolean keep_changed); void ugtk_download_form_set_multiple (UgtkDownloadForm* dform, gboolean multiple_mode); void ugtk_download_form_set_folders (UgtkDownloadForm* dform, UgtkSetting* setting); void ugtk_download_form_get_folders (UgtkDownloadForm* dform, UgtkSetting* setting); void ugtk_download_form_complete_entry (UgtkDownloadForm* dform); #ifdef __cplusplus } #endif #endif // End of UGTK_DOWNLOAD_FORM_H uget-2.2.0/INSTALL0000644000175000000120000003661413144520723010432 00000000000000Installation Instructions ************************* Copyright (C) 1994-1996, 1999-2002, 2004-2016 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind. Basic Installation ================== Briefly, the shell command './configure && make && make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the 'README' file for instructions specific to this package. Some packages provide this 'INSTALL' file but do not implement all of the features documented below. The lack of an optional feature in a given package is not necessarily a bug. More recommendations for GNU packages can be found in *note Makefile Conventions: (standards)Makefile Conventions. The 'configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a 'Makefile' in each directory of the package. It may also create one or more '.h' files containing system-dependent definitions. Finally, it creates a shell script 'config.status' that you can run in the future to recreate the current configuration, and a file 'config.log' containing compiler output (useful mainly for debugging 'configure'). It can also use an optional file (typically called 'config.cache' and enabled with '--cache-file=config.cache' or simply '-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how 'configure' could check whether to do them, and mail diffs or instructions to the address given in the 'README' so they can be considered for the next release. If you are using the cache, and at some point 'config.cache' contains results you don't want to keep, you may remove or edit it. The file 'configure.ac' (or 'configure.in') is used to create 'configure' by a program called 'autoconf'. You need 'configure.ac' if you want to change it or regenerate 'configure' using a newer version of 'autoconf'. The simplest way to compile this package is: 1. 'cd' to the directory containing the package's source code and type './configure' to configure the package for your system. Running 'configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type 'make' to compile the package. 3. Optionally, type 'make check' to run any self-tests that come with the package, generally using the just-built uninstalled binaries. 4. Type 'make install' to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular user, and only the 'make install' phase executed with root privileges. 5. Optionally, type 'make installcheck' to repeat any self-tests, but this time using the binaries in their final installed location. This target does not install anything. Running this target as a regular user, particularly if the prior 'make install' required root privileges, verifies that the installation completed correctly. 6. You can remove the program binaries and object files from the source code directory by typing 'make clean'. To also remove the files that 'configure' created (so you can compile the package for a different kind of computer), type 'make distclean'. There is also a 'make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. 7. Often, you can also type 'make uninstall' to remove the installed files again. In practice, not all packages have tested that uninstallation works correctly, even though it is required by the GNU Coding Standards. 8. Some packages, particularly those that use Automake, provide 'make distcheck', which can by used by developers to test that all other targets like 'make install' and 'make uninstall' work correctly. This target is generally not run by end users. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the 'configure' script does not know about. Run './configure --help' for details on some of the pertinent environment variables. You can give 'configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU 'make'. 'cd' to the directory where you want the object files and executables to go and run the 'configure' script. 'configure' automatically checks for the source code in the directory that 'configure' is in and in '..'. This is known as a "VPATH" build. With a non-GNU 'make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use 'make distclean' before reconfiguring for another architecture. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or "universal" binaries--by specifying multiple '-arch' options to the compiler but only a single '-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CPP="gcc -E" CXXCPP="g++ -E" This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results using the 'lipo' tool if you have problems. Installation Names ================== By default, 'make install' installs the package's commands under '/usr/local/bin', include files under '/usr/local/include', etc. You can specify an installation prefix other than '/usr/local' by giving 'configure' the option '--prefix=PREFIX', where PREFIX must be an absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option '--exec-prefix=PREFIX' to 'configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like '--bindir=DIR' to specify different values for particular kinds of files. Run 'configure --help' for a list of the directories you can set and what kinds of files go in them. In general, the default for these options is expressed in terms of '${prefix}', so that specifying just '--prefix' will affect all of the other directory specifications that were not explicitly provided. The most portable way to affect installation locations is to pass the correct locations to 'configure'; however, many packages provide one or both of the following shortcuts of passing variable assignments to the 'make install' command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each affected directory. For example, 'make install prefix=/alternate/directory' will choose an alternate location for all directory configuration variables that were expressed in terms of '${prefix}'. Any directories that were specified during 'configure', but not in terms of '${prefix}', must each be overridden at install time for the entire installation to be relocated. The approach of makefile variable overrides for each directory variable is required by the GNU Coding Standards, and ideally causes no recompilation. However, some platforms have known limitations with the semantics of shared libraries that end up requiring recompilation when using this method, particularly noticeable in packages that use GNU Libtool. The second method involves providing the 'DESTDIR' variable. For example, 'make install DESTDIR=/alternate/directory' will prepend '/alternate/directory' before all installation names. The approach of 'DESTDIR' overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even when some directory options were not specified in terms of '${prefix}' at 'configure' time. Optional Features ================= If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving 'configure' the option '--program-prefix=PREFIX' or '--program-suffix=SUFFIX'. Some packages pay attention to '--enable-FEATURE' options to 'configure', where FEATURE indicates an optional part of the package. They may also pay attention to '--with-PACKAGE' options, where PACKAGE is something like 'gnu-as' or 'x' (for the X Window System). The 'README' should mention any '--enable-' and '--with-' options that the package recognizes. For packages that use the X Window System, 'configure' can usually find the X include and library files automatically, but if it doesn't, you can use the 'configure' options '--x-includes=DIR' and '--x-libraries=DIR' to specify their locations. Some packages offer the ability to configure how verbose the execution of 'make' will be. For these packages, running './configure --enable-silent-rules' sets the default to minimal output, which can be overridden with 'make V=1'; while running './configure --disable-silent-rules' sets the default to verbose, which can be overridden with 'make V=0'. Particular systems ================== On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. HP-UX 'make' updates targets which have the same time stamps as their prerequisites, which makes it generally unusable when shipped generated files such as 'configure' are involved. Use GNU 'make' instead. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its '' header file. The option '-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended to try ./configure CC="cc" and if that doesn't work, try ./configure CC="cc -nodtk" On Solaris, don't put '/usr/ucb' early in your 'PATH'. This directory contains several dysfunctional programs; working variants of these programs are available in '/usr/bin'. So, if you need '/usr/ucb' in your 'PATH', put it _after_ '/usr/bin'. On Haiku, software installed for all users goes in '/boot/common', not '/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common Specifying the System Type ========================== There may be some features 'configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, 'configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the '--build=TYPE' option. TYPE can either be a short name for the system type, such as 'sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file 'config.sub' for the possible values of each field. If 'config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option '--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with '--host=TYPE'. Sharing Defaults ================ If you want to set default values for 'configure' scripts to share, you can create a site shell script called 'config.site' that gives default values for variables like 'CC', 'cache_file', and 'prefix'. 'configure' looks for 'PREFIX/share/config.site' if it exists, then 'PREFIX/etc/config.site' if it exists. Or, you can set the 'CONFIG_SITE' environment variable to the location of the site script. A warning: not all 'configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to 'configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the 'configure' command line, using 'VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified 'gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for 'CONFIG_SHELL' due to an Autoconf limitation. Until the limitation is lifted, you can use this workaround: CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash 'configure' Invocation ====================== 'configure' recognizes the following options to control how it operates. '--help' '-h' Print a summary of all of the options to 'configure', and exit. '--help=short' '--help=recursive' Print a summary of the options unique to this package's 'configure', and exit. The 'short' variant lists options used only in the top level, while the 'recursive' variant lists options also present in any nested packages. '--version' '-V' Print the version of Autoconf used to generate the 'configure' script, and exit. '--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally 'config.cache'. FILE defaults to '/dev/null' to disable caching. '--config-cache' '-C' Alias for '--cache-file=config.cache'. '--quiet' '--silent' '-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to '/dev/null' (any error messages will still be shown). '--srcdir=DIR' Look for the package's source code in directory DIR. Usually 'configure' can determine that directory automatically. '--prefix=DIR' Use DIR as the installation prefix. *note Installation Names:: for more details, including other options available for fine-tuning the installation locations. '--no-create' '-n' Run the configure checks, but stop before creating any output files. 'configure' also accepts some other, not widely useful, options. Run 'configure --help' for more details. uget-2.2.0/aclocal.m40000644000175000000120000024406213224532664011245 00000000000000# generated automatically by aclocal 1.15.1 -*- Autoconf -*- # Copyright (C) 1996-2017 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_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. 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'.])]) # Copyright (C) 1995-2002 Free Software Foundation, Inc. # Copyright (C) 2001-2003,2004 Red Hat, Inc. # # This file is free software, distributed under the terms of the GNU # General Public License. As a special exception to the GNU General # Public License, this file may be distributed as part of a program # that contains a configuration script generated by Autoconf, under # the same distribution terms as the rest of that program. # # This file can be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU Public License # but which still want to provide support for the GNU gettext functionality. # # Macro to add for using GNU gettext. # Ulrich Drepper , 1995, 1996 # # Modified to never use included libintl. # Owen Taylor , 12/15/1998 # # Major rework to remove unused code # Owen Taylor , 12/11/2002 # # Added better handling of ALL_LINGUAS from GNU gettext version # written by Bruno Haible, Owen Taylor 5/30/3002 # # Modified to require ngettext # Matthias Clasen 08/06/2004 # # We need this here as well, since someone might use autoconf-2.5x # to configure GLib then an older version to configure a package # using AM_GLIB_GNU_GETTEXT AC_PREREQ(2.53) dnl dnl We go to great lengths to make sure that aclocal won't dnl try to pull in the installed version of these macros dnl when running aclocal in the glib directory. dnl m4_copy([AC_DEFUN],[glib_DEFUN]) m4_copy([AC_REQUIRE],[glib_REQUIRE]) dnl dnl At the end, if we're not within glib, we'll define the public dnl definitions in terms of our private definitions. dnl # GLIB_LC_MESSAGES #-------------------- glib_DEFUN([GLIB_LC_MESSAGES], [AC_CHECK_HEADERS([locale.h]) if test $ac_cv_header_locale_h = yes; then AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, [AC_TRY_LINK([#include ], [return LC_MESSAGES], am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) if test $am_cv_val_LC_MESSAGES = yes; then AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your file defines LC_MESSAGES.]) fi fi]) # GLIB_PATH_PROG_WITH_TEST #---------------------------- dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) glib_DEFUN([GLIB_PATH_PROG_WITH_TEST], [# Extract the first word of "$2", so it can be a program name with args. set dummy $2; ac_word=[$]2 AC_MSG_CHECKING([for $ac_word]) AC_CACHE_VAL(ac_cv_path_$1, [case "[$]$1" in /*) ac_cv_path_$1="[$]$1" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in ifelse([$5], , $PATH, [$5]); do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if [$3]; then ac_cv_path_$1="$ac_dir/$ac_word" break fi fi done IFS="$ac_save_ifs" dnl If no 4th arg is given, leave the cache variable unset, dnl so AC_PATH_PROGS will keep looking. ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" ])dnl ;; esac])dnl $1="$ac_cv_path_$1" if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then AC_MSG_RESULT([$]$1) else AC_MSG_RESULT(no) fi AC_SUBST($1)dnl ]) dnl Checks for special options needed on Mac OS X. dnl Defines INTL_MACOSX_LIBS. dnl dnl Copied from intlmacosx.m4 in gettext, GPL. dnl Copyright (C) 2004-2013 Free Software Foundation, Inc. glib_DEFUN([glib_gt_INTL_MACOSX], [ dnl Check for API introduced in Mac OS X 10.2. AC_CACHE_CHECK([for CFPreferencesCopyAppValue], [gt_cv_func_CFPreferencesCopyAppValue], [gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[CFPreferencesCopyAppValue(NULL, NULL)]])], [gt_cv_func_CFPreferencesCopyAppValue=yes], [gt_cv_func_CFPreferencesCopyAppValue=no]) LIBS="$gt_save_LIBS"]) if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1], [Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework.]) fi dnl Check for API introduced in Mac OS X 10.3. AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent], [gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[CFLocaleCopyCurrent();]])], [gt_cv_func_CFLocaleCopyCurrent=yes], [gt_cv_func_CFLocaleCopyCurrent=no]) LIBS="$gt_save_LIBS"]) if test $gt_cv_func_CFLocaleCopyCurrent = yes; then AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1], [Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the CoreFoundation framework.]) fi INTL_MACOSX_LIBS= if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" fi AC_SUBST([INTL_MACOSX_LIBS]) ]) # GLIB_WITH_NLS #----------------- glib_DEFUN([GLIB_WITH_NLS], dnl NLS is obligatory [USE_NLS=yes AC_SUBST(USE_NLS) gt_cv_have_gettext=no CATOBJEXT=NONE XGETTEXT=: INTLLIBS= glib_gt_INTL_MACOSX AC_CHECK_HEADER(libintl.h, [gt_cv_func_dgettext_libintl="no" libintl_extra_libs="" # # First check in libc # AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc, [AC_TRY_LINK([ #include ], [return !ngettext ("","", 1)], gt_cv_func_ngettext_libc=yes, gt_cv_func_ngettext_libc=no) ]) if test "$gt_cv_func_ngettext_libc" = "yes" ; then AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc, [AC_TRY_LINK([ #include ], [return !dgettext ("","")], gt_cv_func_dgettext_libc=yes, gt_cv_func_dgettext_libc=no) ]) fi if test "$gt_cv_func_ngettext_libc" = "yes" ; then AC_CHECK_FUNCS(bind_textdomain_codeset) fi # # If we don't have everything we want, check in libintl # if test "$gt_cv_func_dgettext_libc" != "yes" \ || test "$gt_cv_func_ngettext_libc" != "yes" \ || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then AC_CHECK_LIB(intl, bindtextdomain, [AC_CHECK_LIB(intl, ngettext, [AC_CHECK_LIB(intl, dgettext, gt_cv_func_dgettext_libintl=yes)])]) if test "$gt_cv_func_dgettext_libintl" != "yes" ; then AC_MSG_CHECKING([if -liconv is needed to use gettext]) AC_MSG_RESULT([]) AC_CHECK_LIB(intl, ngettext, [AC_CHECK_LIB(intl, dcgettext, [gt_cv_func_dgettext_libintl=yes libintl_extra_libs=-liconv], :,-liconv)], :,-liconv) fi # # If we found libintl, then check in it for bind_textdomain_codeset(); # we'll prefer libc if neither have bind_textdomain_codeset(), # and both have dgettext and ngettext # if test "$gt_cv_func_dgettext_libintl" = "yes" ; then glib_save_LIBS="$LIBS" LIBS="$LIBS -lintl $libintl_extra_libs" unset ac_cv_func_bind_textdomain_codeset AC_CHECK_FUNCS(bind_textdomain_codeset) LIBS="$glib_save_LIBS" if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then gt_cv_func_dgettext_libc=no else if test "$gt_cv_func_dgettext_libc" = "yes" \ && test "$gt_cv_func_ngettext_libc" = "yes"; then gt_cv_func_dgettext_libintl=no fi fi fi fi if test "$gt_cv_func_dgettext_libc" = "yes" \ || test "$gt_cv_func_dgettext_libintl" = "yes"; then gt_cv_have_gettext=yes fi if test "$gt_cv_func_dgettext_libintl" = "yes"; then INTLLIBS="-lintl $libintl_extra_libs $INTL_MACOSX_LIBS" fi if test "$gt_cv_have_gettext" = "yes"; then AC_DEFINE(HAVE_GETTEXT,1, [Define if the GNU gettext() function is already present or preinstalled.]) GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl if test "$MSGFMT" != "no"; then glib_save_LIBS="$LIBS" LIBS="$LIBS $INTLLIBS" AC_CHECK_FUNCS(dcgettext) MSGFMT_OPTS= AC_MSG_CHECKING([if msgfmt accepts -c]) GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[ msgid "" msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Project-Id-Version: test 1.0\n" "PO-Revision-Date: 2007-02-15 12:01+0100\n" "Last-Translator: test \n" "Language-Team: C \n" "MIME-Version: 1.0\n" "Content-Transfer-Encoding: 8bit\n" ], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])]) AC_SUBST(MSGFMT_OPTS) AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) AC_TRY_LINK(, [extern int _nl_msg_cat_cntr; return _nl_msg_cat_cntr], [CATOBJEXT=.gmo DATADIRNAME=share], [case $host in *-*-solaris*) dnl On Solaris, if bind_textdomain_codeset is in libc, dnl GNU format message catalog is always supported, dnl since both are added to the libc all together. dnl Hence, we'd like to go with DATADIRNAME=share and dnl and CATOBJEXT=.gmo in this case. AC_CHECK_FUNC(bind_textdomain_codeset, [CATOBJEXT=.gmo DATADIRNAME=share], [CATOBJEXT=.mo DATADIRNAME=lib]) ;; *-*-openbsd*) CATOBJEXT=.mo DATADIRNAME=share ;; *) CATOBJEXT=.mo DATADIRNAME=lib ;; esac]) LIBS="$glib_save_LIBS" INSTOBJEXT=.mo else gt_cv_have_gettext=no fi fi ]) if test "$gt_cv_have_gettext" = "yes" ; then AC_DEFINE(ENABLE_NLS, 1, [always defined to indicate that i18n is enabled]) fi dnl Test whether we really found GNU xgettext. if test "$XGETTEXT" != ":"; then dnl If it is not GNU xgettext we define it as : so that the dnl Makefiles still can work. if $XGETTEXT --omit-header /dev/null 2> /dev/null; then : ; else AC_MSG_RESULT( [found xgettext program is not GNU xgettext; ignore it]) XGETTEXT=":" fi fi # We need to process the po/ directory. POSUB=po AC_OUTPUT_COMMANDS( [case "$CONFIG_FILES" in *po/Makefile.in*) sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile esac]) dnl These rules are solely for the distribution goal. While doing this dnl we only have to keep exactly one list of the available catalogs dnl in configure.ac. for lang in $ALL_LINGUAS; do GMOFILES="$GMOFILES $lang.gmo" POFILES="$POFILES $lang.po" done dnl Make all variables we use known to autoconf. AC_SUBST(CATALOGS) AC_SUBST(CATOBJEXT) AC_SUBST(DATADIRNAME) AC_SUBST(GMOFILES) AC_SUBST(INSTOBJEXT) AC_SUBST(INTLLIBS) AC_SUBST(PO_IN_DATADIR_TRUE) AC_SUBST(PO_IN_DATADIR_FALSE) AC_SUBST(POFILES) AC_SUBST(POSUB) ]) # AM_GLIB_GNU_GETTEXT # ------------------- # Do checks necessary for use of gettext. If a suitable implementation # of gettext is found in either in libintl or in the C library, # it will set INTLLIBS to the libraries needed for use of gettext # and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable # gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST() # on various variables needed by the Makefile.in.in installed by # glib-gettextize. dnl AU_DEFUN([GLIB_GNU_GETTEXT], [AC_REQUIRE([AC_PROG_CC])dnl GLIB_LC_MESSAGES GLIB_WITH_NLS if test "$gt_cv_have_gettext" = "yes"; then if test "x$ALL_LINGUAS" = "x"; then LINGUAS= else AC_MSG_CHECKING(for catalogs to be installed) NEW_LINGUAS= for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then NEW_LINGUAS="$NEW_LINGUAS $presentlang" fi done LINGUAS=$NEW_LINGUAS AC_MSG_RESULT($LINGUAS) fi dnl Construct list of names of catalog files to be constructed. if test -n "$LINGUAS"; then for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done fi fi dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly dnl find the mkinstalldirs script in another subdir but ($top_srcdir). dnl Try to locate is. MKINSTALLDIRS= if test -n "$ac_aux_dir"; then MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" fi if test -z "$MKINSTALLDIRS"; then MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" fi AC_SUBST(MKINSTALLDIRS) dnl Generate list of files to be processed by xgettext which will dnl be included in po/Makefile. test -d po || mkdir po if test "x$srcdir" != "x."; then if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then posrcprefix="$srcdir/" else posrcprefix="../$srcdir/" fi else posrcprefix="../" fi rm -f po/POTFILES sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ < $srcdir/po/POTFILES.in > po/POTFILES ], [[$0: This macro is deprecated. You should use upstream gettext instead.]]) # AM_GLIB_DEFINE_LOCALEDIR(VARIABLE) # ------------------------------- # Define VARIABLE to the location where catalog files will # be installed by po/Makefile. glib_DEFUN([GLIB_DEFINE_LOCALEDIR], [glib_REQUIRE([GLIB_GNU_GETTEXT])dnl glib_save_prefix="$prefix" glib_save_exec_prefix="$exec_prefix" glib_save_datarootdir="$datarootdir" test "x$prefix" = xNONE && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix=$prefix datarootdir=`eval echo "${datarootdir}"` if test "x$CATOBJEXT" = "x.mo" ; then localedir=`eval echo "${libdir}/locale"` else localedir=`eval echo "${datadir}/locale"` fi prefix="$glib_save_prefix" exec_prefix="$glib_save_exec_prefix" datarootdir="$glib_save_datarootdir" AC_DEFINE_UNQUOTED($1, "$localedir", [Define the location where the catalogs will be installed]) ]) dnl dnl Now the definitions that aclocal will find dnl ifdef(glib_configure_ac,[],[ AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)]) AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)]) ])dnl # GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL]) # # Create a temporary file with TEST-FILE as its contents and pass the # file name to PROGRAM. Perform ACTION-IF-PASS if PROGRAM exits with # 0 and perform ACTION-IF-FAIL for any other exit status. AC_DEFUN([GLIB_RUN_PROG], [cat >conftest.foo <<_ACEOF $2 _ACEOF if AC_RUN_LOG([$1 conftest.foo]); then m4_ifval([$3], [$3], [:]) m4_ifvaln([$4], [else $4])dnl echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD fi]) dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml]) # serial 42 IT_PROG_INTLTOOL AC_DEFUN([IT_PROG_INTLTOOL], [ AC_PREREQ([2.50])dnl AC_REQUIRE([AM_NLS])dnl case "$am__api_version" in 1.[01234]) AC_MSG_ERROR([Automake 1.5 or newer is required to use intltool]) ;; *) ;; esac INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'` INTLTOOL_APPLIED_VERSION=`intltool-update --version | head -1 | cut -d" " -f3` INTLTOOL_APPLIED_VERSION_AS_INT=`echo $INTLTOOL_APPLIED_VERSION | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'` if test -n "$1"; then AC_MSG_CHECKING([for intltool >= $1]) AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found]) test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" || AC_MSG_ERROR([Your intltool is too old. You need intltool $1 or later.]) fi AC_PATH_PROG(INTLTOOL_UPDATE, [intltool-update]) AC_PATH_PROG(INTLTOOL_MERGE, [intltool-merge]) AC_PATH_PROG(INTLTOOL_EXTRACT, [intltool-extract]) if test -z "$INTLTOOL_UPDATE" -o -z "$INTLTOOL_MERGE" -o -z "$INTLTOOL_EXTRACT"; then AC_MSG_ERROR([The intltool scripts were not found. Please install intltool.]) fi if test -z "$AM_DEFAULT_VERBOSITY"; then AM_DEFAULT_VERBOSITY=1 fi AC_SUBST([AM_DEFAULT_VERBOSITY]) INTLTOOL_V_MERGE='$(INTLTOOL__v_MERGE_$(V))' INTLTOOL__v_MERGE_='$(INTLTOOL__v_MERGE_$(AM_DEFAULT_VERBOSITY))' INTLTOOL__v_MERGE_0='@echo " ITMRG " [$]@;' AC_SUBST(INTLTOOL_V_MERGE) AC_SUBST(INTLTOOL__v_MERGE_) AC_SUBST(INTLTOOL__v_MERGE_0) INTLTOOL_V_MERGE_OPTIONS='$(intltool__v_merge_options_$(V))' intltool__v_merge_options_='$(intltool__v_merge_options_$(AM_DEFAULT_VERBOSITY))' intltool__v_merge_options_0='-q' AC_SUBST(INTLTOOL_V_MERGE_OPTIONS) AC_SUBST(intltool__v_merge_options_) AC_SUBST(intltool__v_merge_options_0) INTLTOOL_DESKTOP_RULE='%.desktop: %.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_DIRECTORY_RULE='%.directory: %.directory.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_KEYS_RULE='%.keys: %.keys.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -k -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_PROP_RULE='%.prop: %.prop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_OAF_RULE='%.oaf: %.oaf.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -o -p $(top_srcdir)/po $< [$]@' INTLTOOL_PONG_RULE='%.pong: %.pong.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_SERVER_RULE='%.server: %.server.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -o -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_SHEET_RULE='%.sheet: %.sheet.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_SOUNDLIST_RULE='%.soundlist: %.soundlist.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_UI_RULE='%.ui: %.ui.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_XML_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' if test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge 5000; then INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u --no-translations $< [$]@' else INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; $(INTLTOOL_V_MERGE)_it_tmp_dir=tmp.intltool.[$][$]RANDOM && mkdir [$][$]_it_tmp_dir && LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u [$][$]_it_tmp_dir $< [$]@ && rmdir [$][$]_it_tmp_dir' fi INTLTOOL_XAM_RULE='%.xam: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_KBD_RULE='%.kbd: %.kbd.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -m -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_CAVES_RULE='%.caves: %.caves.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_SCHEMAS_RULE='%.schemas: %.schemas.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -s -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_THEME_RULE='%.theme: %.theme.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_SERVICE_RULE='%.service: %.service.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_POLICY_RULE='%.policy: %.policy.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' _IT_SUBST(INTLTOOL_DESKTOP_RULE) _IT_SUBST(INTLTOOL_DIRECTORY_RULE) _IT_SUBST(INTLTOOL_KEYS_RULE) _IT_SUBST(INTLTOOL_PROP_RULE) _IT_SUBST(INTLTOOL_OAF_RULE) _IT_SUBST(INTLTOOL_PONG_RULE) _IT_SUBST(INTLTOOL_SERVER_RULE) _IT_SUBST(INTLTOOL_SHEET_RULE) _IT_SUBST(INTLTOOL_SOUNDLIST_RULE) _IT_SUBST(INTLTOOL_UI_RULE) _IT_SUBST(INTLTOOL_XAM_RULE) _IT_SUBST(INTLTOOL_KBD_RULE) _IT_SUBST(INTLTOOL_XML_RULE) _IT_SUBST(INTLTOOL_XML_NOMERGE_RULE) _IT_SUBST(INTLTOOL_CAVES_RULE) _IT_SUBST(INTLTOOL_SCHEMAS_RULE) _IT_SUBST(INTLTOOL_THEME_RULE) _IT_SUBST(INTLTOOL_SERVICE_RULE) _IT_SUBST(INTLTOOL_POLICY_RULE) # Check the gettext tools to make sure they are GNU AC_PATH_PROG(XGETTEXT, xgettext) AC_PATH_PROG(MSGMERGE, msgmerge) AC_PATH_PROG(MSGFMT, msgfmt) AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) if test -z "$XGETTEXT" -o -z "$MSGMERGE" -o -z "$MSGFMT"; then AC_MSG_ERROR([GNU gettext tools not found; required for intltool]) fi xgversion="`$XGETTEXT --version|grep '(GNU ' 2> /dev/null`" mmversion="`$MSGMERGE --version|grep '(GNU ' 2> /dev/null`" mfversion="`$MSGFMT --version|grep '(GNU ' 2> /dev/null`" if test -z "$xgversion" -o -z "$mmversion" -o -z "$mfversion"; then AC_MSG_ERROR([GNU gettext tools not found; required for intltool]) fi AC_PATH_PROG(INTLTOOL_PERL, perl) if test -z "$INTLTOOL_PERL"; then AC_MSG_ERROR([perl not found]) fi AC_MSG_CHECKING([for perl >= 5.8.1]) $INTLTOOL_PERL -e "use 5.8.1;" > /dev/null 2>&1 if test $? -ne 0; then AC_MSG_ERROR([perl 5.8.1 is required for intltool]) else IT_PERL_VERSION=`$INTLTOOL_PERL -e "printf '%vd', $^V"` AC_MSG_RESULT([$IT_PERL_VERSION]) fi if test "x$2" != "xno-xml"; then AC_MSG_CHECKING([for XML::Parser]) if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then AC_MSG_RESULT([ok]) else AC_MSG_ERROR([XML::Parser perl module is required for intltool]) fi fi # Substitute ALL_LINGUAS so we can use it in po/Makefile AC_SUBST(ALL_LINGUAS) IT_PO_SUBDIR([po]) ]) # IT_PO_SUBDIR(DIRNAME) # --------------------- # All po subdirs have to be declared with this macro; the subdir "po" is # declared by IT_PROG_INTLTOOL. # AC_DEFUN([IT_PO_SUBDIR], [AC_PREREQ([2.53])dnl We use ac_top_srcdir inside AC_CONFIG_COMMANDS. dnl dnl The following CONFIG_COMMANDS should be executed at the very end dnl of config.status. AC_CONFIG_COMMANDS_PRE([ AC_CONFIG_COMMANDS([$1/stamp-it], [ if [ ! grep "^# INTLTOOL_MAKEFILE$" "$1/Makefile.in" > /dev/null ]; then AC_MSG_ERROR([$1/Makefile.in.in was not created by intltoolize.]) fi rm -f "$1/stamp-it" "$1/stamp-it.tmp" "$1/POTFILES" "$1/Makefile.tmp" >"$1/stamp-it.tmp" [sed '/^#/d s/^[[].*] *// /^[ ]*$/d '"s|^| $ac_top_srcdir/|" \ "$srcdir/$1/POTFILES.in" | sed '$!s/$/ \\/' >"$1/POTFILES" ] [sed '/^POTFILES =/,/[^\\]$/ { /^POTFILES =/!d r $1/POTFILES } ' "$1/Makefile.in" >"$1/Makefile"] rm -f "$1/Makefile.tmp" mv "$1/stamp-it.tmp" "$1/stamp-it" ]) ])dnl ]) # _IT_SUBST(VARIABLE) # ------------------- # Abstract macro to do either _AM_SUBST_NOTMAKE or AC_SUBST # AC_DEFUN([_IT_SUBST], [ AC_SUBST([$1]) m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([$1])]) ] ) # deprecated macros AU_ALIAS([AC_PROG_INTLTOOL], [IT_PROG_INTLTOOL]) # A hint is needed for aclocal from Automake <= 1.9.4: # AC_DEFUN([AC_PROG_INTLTOOL], ...) # nls.m4 serial 5 (gettext-0.18) dnl Copyright (C) 1995-2003, 2005-2006, 2008-2014, 2016 Free Software dnl Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. AC_PREREQ([2.50]) AC_DEFUN([AM_NLS], [ AC_MSG_CHECKING([whether NLS is requested]) dnl Default is enabled NLS AC_ARG_ENABLE([nls], [ --disable-nls do not use Native Language Support], USE_NLS=$enableval, USE_NLS=yes) AC_MSG_RESULT([$USE_NLS]) AC_SUBST([USE_NLS]) ]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # serial 11 (pkg-config-0.29.1) dnl Copyright © 2004 Scott James Remnant . dnl Copyright © 2012-2015 Dan Nicholson dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl dnl This program is distributed in the hope that it will be useful, but dnl WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU dnl General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA dnl 02111-1307, USA. dnl dnl As a special exception to the GNU General Public License, if you dnl distribute this file as part of a program that contains a dnl configuration script generated by Autoconf, you may include it under dnl the same distribution terms that you use for the rest of that dnl program. dnl PKG_PREREQ(MIN-VERSION) dnl ----------------------- dnl Since: 0.29 dnl dnl Verify that the version of the pkg-config macros are at least dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's dnl installed version of pkg-config, this checks the developer's version dnl of pkg.m4 when generating configure. dnl dnl To ensure that this macro is defined, also add: dnl m4_ifndef([PKG_PREREQ], dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) dnl dnl See the "Since" comment for each macro you use to see what version dnl of the macros you require. m4_defun([PKG_PREREQ], [m4_define([PKG_MACROS_VERSION], [0.29.1]) m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) ])dnl PKG_PREREQ dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) dnl ---------------------------------- dnl Since: 0.16 dnl dnl Search for the pkg-config tool and set the PKG_CONFIG variable to dnl first found in the path. Checks that the version of pkg-config found dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is dnl used since that's the first version where most current features of dnl pkg-config existed. 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 ])dnl PKG_PROG_PKG_CONFIG dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl ------------------------------------------------------------------- dnl Since: 0.18 dnl dnl Check to see whether a particular set of modules exists. Similar to dnl PKG_CHECK_MODULES(), but does not set variables or print errors. dnl dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) dnl only at the first occurence in configure.ac, so if the first place dnl it's called might be skipped (such as if it is within an "if", you dnl 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]) dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) dnl --------------------------------------------- dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting dnl pkg_failed based on the result. 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 ])dnl _PKG_CONFIG dnl _PKG_SHORT_ERRORS_SUPPORTED dnl --------------------------- dnl Internal check to see if pkg-config supports short errors. 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 ])dnl _PKG_SHORT_ERRORS_SUPPORTED dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], dnl [ACTION-IF-NOT-FOUND]) dnl -------------------------------------------------------------- dnl Since: 0.4.0 dnl dnl Note that if there is a possibility the first call to dnl PKG_CHECK_MODULES might not happen, you should be sure to include an dnl 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 ])dnl PKG_CHECK_MODULES dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], dnl [ACTION-IF-NOT-FOUND]) dnl --------------------------------------------------------------------- dnl Since: 0.29 dnl dnl Checks for existence of MODULES and gathers its build flags with dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags dnl and VARIABLE-PREFIX_LIBS from --libs. dnl dnl Note that if there is a possibility the first call to dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to dnl include an explicit call to PKG_PROG_PKG_CONFIG in your dnl configure.ac. AC_DEFUN([PKG_CHECK_MODULES_STATIC], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl _save_PKG_CONFIG=$PKG_CONFIG PKG_CONFIG="$PKG_CONFIG --static" PKG_CHECK_MODULES($@) PKG_CONFIG=$_save_PKG_CONFIG[]dnl ])dnl PKG_CHECK_MODULES_STATIC dnl PKG_INSTALLDIR([DIRECTORY]) dnl ------------------------- dnl Since: 0.27 dnl dnl Substitutes the variable pkgconfigdir as the location where a module dnl should install pkg-config .pc files. By default the directory is dnl $libdir/pkgconfig, but the default can be changed by passing dnl DIRECTORY. The user can override through the --with-pkgconfigdir dnl parameter. AC_DEFUN([PKG_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([pkgconfigdir], [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, [with_pkgconfigdir=]pkg_default) AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ])dnl PKG_INSTALLDIR dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) dnl -------------------------------- dnl Since: 0.27 dnl dnl Substitutes the variable noarch_pkgconfigdir as the location where a dnl module should install arch-independent pkg-config .pc files. By dnl default the directory is $datadir/pkgconfig, but the default can be dnl changed by passing DIRECTORY. The user can override through the dnl --with-noarch-pkgconfigdir parameter. AC_DEFUN([PKG_NOARCH_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([noarch-pkgconfigdir], [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, [with_noarch_pkgconfigdir=]pkg_default) AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ])dnl PKG_NOARCH_INSTALLDIR dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl ------------------------------------------- dnl Since: 0.28 dnl dnl Retrieves the value of the pkg-config variable for the given module. AC_DEFUN([PKG_CHECK_VAR], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl _PKG_CONFIG([$1], [variable="][$3]["], [$2]) AS_VAR_COPY([$1], [pkg_cv_][$1]) AS_VAR_IF([$1], [""], [$5], [$4])dnl ])dnl PKG_CHECK_VAR dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES, dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND], dnl [DESCRIPTION], [DEFAULT]) dnl ------------------------------------------ dnl dnl Prepare a "--with-" configure option using the lowercase dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and dnl PKG_CHECK_MODULES in a single macro. AC_DEFUN([PKG_WITH_MODULES], [ m4_pushdef([with_arg], m4_tolower([$1])) m4_pushdef([description], [m4_default([$5], [build with ]with_arg[ support])]) m4_pushdef([def_arg], [m4_default([$6], [auto])]) m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes]) m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no]) m4_case(def_arg, [yes],[m4_pushdef([with_without], [--without-]with_arg)], [m4_pushdef([with_without],[--with-]with_arg)]) AC_ARG_WITH(with_arg, AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),, [AS_TR_SH([with_]with_arg)=def_arg]) AS_CASE([$AS_TR_SH([with_]with_arg)], [yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)], [auto],[PKG_CHECK_MODULES([$1],[$2], [m4_n([def_action_if_found]) $3], [m4_n([def_action_if_not_found]) $4])]) m4_popdef([with_arg]) m4_popdef([description]) m4_popdef([def_arg]) ])dnl PKG_WITH_MODULES dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES, dnl [DESCRIPTION], [DEFAULT]) dnl ----------------------------------------------- dnl dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES dnl check._[VARIABLE-PREFIX] is exported as make variable. AC_DEFUN([PKG_HAVE_WITH_MODULES], [ PKG_WITH_MODULES([$1],[$2],,,[$3],[$4]) AM_CONDITIONAL([HAVE_][$1], [test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"]) ])dnl PKG_HAVE_WITH_MODULES dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES, dnl [DESCRIPTION], [DEFAULT]) dnl ------------------------------------------------------ dnl dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make dnl and preprocessor variable. AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES], [ PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4]) AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"], [AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])]) ])dnl PKG_HAVE_DEFINE_WITH_MODULES # Copyright (C) 2002-2017 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. # 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.15' 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.15.1], [], [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.15.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # Copyright (C) 2011-2017 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. # AM_PROG_AR([ACT-IF-FAIL]) # ------------------------- # Try to determine the archiver interface, and trigger the ar-lib wrapper # if it is needed. If the detection of archiver interface fails, run # ACT-IF-FAIL (default is to abort configure with a proper error message). AC_DEFUN([AM_PROG_AR], [AC_BEFORE([$0], [LT_INIT])dnl AC_BEFORE([$0], [AC_PROG_LIBTOOL])dnl AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([ar-lib])dnl AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false]) : ${AR=ar} AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface], [AC_LANG_PUSH([C]) am_cv_ar_interface=ar AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])], [am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([am_ar_try]) if test "$ac_status" -eq 0; then am_cv_ar_interface=ar else am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([am_ar_try]) if test "$ac_status" -eq 0; then am_cv_ar_interface=lib else am_cv_ar_interface=unknown fi fi rm -f conftest.lib libconftest.a ]) AC_LANG_POP([C])]) case $am_cv_ar_interface in ar) ;; lib) # Microsoft lib, so override with the ar-lib wrapper script. # FIXME: It is wrong to rewrite AR. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__AR in this case, # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something # similar. AR="$am_aux_dir/ar-lib $AR" ;; unknown) m4_default([$1], [AC_MSG_ERROR([could not determine $AR interface])]) ;; esac AC_SUBST([AR])dnl ]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2017 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. # 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], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2017 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. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$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])]) # Copyright (C) 1999-2017 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. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2017 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. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each '.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2017 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 macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # 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.65])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], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) 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], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [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([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). 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])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro 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 # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) 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-2017 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. # 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+set}" != 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-2017 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. # 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])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2017 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. # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2017 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. # 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 is modern enough. # If it is, 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 --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2017 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. # _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) 1999-2017 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. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2017 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. # 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-2017 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. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # 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 ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file 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 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 if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done 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]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2017 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. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2017 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. # 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-2017 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. # _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-2017 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. # _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}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} 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 uget-2.2.0/configure0000755000175000000120000077544613224532667011336 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for uget 2.2.0. # # # Copyright (C) 1992-1996, 1998-2012 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 # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # 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 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+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} 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 test -x / || 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 test \$(( 1 + 1 )) = 2 || 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 : export CONFIG_SHELL # 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 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+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 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_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_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; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # 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 -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' 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 as_test_x='test -x' as_executable_p=as_fn_executable_p # 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='uget' PACKAGE_TARNAME='uget' PACKAGE_VERSION='2.2.0' PACKAGE_STRING='uget 2.2.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS WITH_LIBPWMD_FALSE WITH_LIBPWMD_TRUE LIBPWMD_LIBS LIBPWMD_CFLAGS GSTREAMER_LIBS GSTREAMER_CFLAGS APP_INDICATOR_LIBS APP_INDICATOR_CFLAGS LIBNOTIFY_LIBS LIBNOTIFY_CFLAGS LIBCRYPTO_LIBS LIBCRYPTO_CFLAGS LIBGCRYPT_LIBS LIBGCRYPT_CFLAGS LIBGCRYPT_CONFIG CURL_LIBS CURL_CFLAGS CURL_CONFIG LFS_LDFLAGS LFS_CFLAGS GETCONF PTHREAD_LIBS PTHREAD_CFLAGS GLIB_LIBS GLIB_CFLAGS GTK_LIBS GTK_CFLAGS PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG MKINSTALLDIRS POSUB POFILES PO_IN_DATADIR_FALSE PO_IN_DATADIR_TRUE INTLLIBS INSTOBJEXT GMOFILES DATADIRNAME CATOBJEXT CATALOGS MSGFMT_OPTS INTL_MACOSX_LIBS EGREP GREP CPP GETTEXT_PACKAGE ALL_LINGUAS INTLTOOL_PERL GMSGFMT MSGFMT MSGMERGE XGETTEXT INTLTOOL_POLICY_RULE INTLTOOL_SERVICE_RULE INTLTOOL_THEME_RULE INTLTOOL_SCHEMAS_RULE INTLTOOL_CAVES_RULE INTLTOOL_XML_NOMERGE_RULE INTLTOOL_XML_RULE INTLTOOL_KBD_RULE INTLTOOL_XAM_RULE INTLTOOL_UI_RULE INTLTOOL_SOUNDLIST_RULE INTLTOOL_SHEET_RULE INTLTOOL_SERVER_RULE INTLTOOL_PONG_RULE INTLTOOL_OAF_RULE INTLTOOL_PROP_RULE INTLTOOL_KEYS_RULE INTLTOOL_DIRECTORY_RULE INTLTOOL_DESKTOP_RULE intltool__v_merge_options_0 intltool__v_merge_options_ INTLTOOL_V_MERGE_OPTIONS INTLTOOL__v_MERGE_0 INTLTOOL__v_MERGE_ INTLTOOL_V_MERGE INTLTOOL_EXTRACT INTLTOOL_MERGE INTLTOOL_UPDATE USE_NLS RANLIB ac_ct_AR AR am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V 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_silent_rules enable_dependency_tracking enable_nls with_gnutls with_openssl enable_notify enable_appindicator enable_gstreamer enable_pwmd enable_rss_notify enable_unix_socket ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR GTK_CFLAGS GTK_LIBS GLIB_CFLAGS GLIB_LIBS LIBCRYPTO_CFLAGS LIBCRYPTO_LIBS LIBNOTIFY_CFLAGS LIBNOTIFY_LIBS APP_INDICATOR_CFLAGS APP_INDICATOR_LIBS GSTREAMER_CFLAGS GSTREAMER_LIBS LIBPWMD_CFLAGS LIBPWMD_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 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 uget 2.2.0 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/uget] --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 uget 2.2.0:";; 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-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --disable-nls do not use Native Language Support --disable-notify Disable libnotify support. --enable-appindicator=[no/auto/yes] Build support for application indicators. --disable-gstreamer Disable GStreamer audio support. --enable-pwmd Enable pwmd support. --disable-rss-notify Disable RSS Notify. --enable-unix-socket Enable UNIX Domain Socket. Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-gnutls=[no/auto/yes] Enable GnuTLS support. (default is auto) --with-openssl=[no/yes] Enable OpenSSL support. Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor 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_CFLAGS C compiler flags for GTK, overriding pkg-config GTK_LIBS linker flags for GTK, overriding pkg-config GLIB_CFLAGS C compiler flags for GLIB, overriding pkg-config GLIB_LIBS linker flags for GLIB, overriding pkg-config LIBCRYPTO_CFLAGS C compiler flags for LIBCRYPTO, overriding pkg-config LIBCRYPTO_LIBS linker flags for LIBCRYPTO, overriding pkg-config LIBNOTIFY_CFLAGS C compiler flags for LIBNOTIFY, overriding pkg-config LIBNOTIFY_LIBS linker flags for LIBNOTIFY, overriding pkg-config APP_INDICATOR_CFLAGS C compiler flags for APP_INDICATOR, overriding pkg-config APP_INDICATOR_LIBS linker flags for APP_INDICATOR, overriding pkg-config GSTREAMER_CFLAGS C compiler flags for GSTREAMER, overriding pkg-config GSTREAMER_LIBS linker flags for GSTREAMER, overriding pkg-config LIBPWMD_CFLAGS C compiler flags for LIBPWMD, overriding pkg-config LIBPWMD_LIBS linker flags for LIBPWMD, 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 uget configure 2.2.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 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. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile 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 uget $as_me 2.2.0, which was generated by GNU Autoconf 2.69. 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 ## Use automake (add automake to autogen.sh) am__api_version='1.15' 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 as_fn_executable_p "$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; } # 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 ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file 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 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 if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done 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; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file 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 --is-lightweight"; then am_missing_run="$MISSING " 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+set}" != 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 as_fn_executable_p "$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 as_fn_executable_p "$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 as_fn_executable_p "$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; } 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 as_fn_executable_p "$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 # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' 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='uget' VERSION='2.2.0' 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"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). 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}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi ## --- Use config.h (autogen.sh add autoheader) ac_config_headers="$ac_config_headers config.h" ## --- Determine a C compiler to use. 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 if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; 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_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $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 CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; 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_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $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_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" 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 CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; 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_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $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 CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; 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_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $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 if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$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_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$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 CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe 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_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$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 ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" 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 CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi 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 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi 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 DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ## --- Check C compiler -c -o options. ## --- Determine a C++ compiler to use. # AC_PROG_CXX ## --- Check for the ar command to use if test -n "$ac_tool_prefix"; then for ac_prog in ar lib "link -lib" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$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_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$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 AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar lib "link -lib" 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_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$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 ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" 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 AR=$ac_ct_AR fi fi : ${AR=ar} { $as_echo "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface" >&5 $as_echo_n "checking the archiver ($AR) interface... " >&6; } if ${am_cv_ar_interface+:} false; then : $as_echo_n "(cached) " >&6 else 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_cv_ar_interface=ar cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int some_variable = 0; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 (eval $am_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then am_cv_ar_interface=ar else am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 (eval $am_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then am_cv_ar_interface=lib else am_cv_ar_interface=unknown fi fi rm -f conftest.lib libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5 $as_echo "$am_cv_ar_interface" >&6; } case $am_cv_ar_interface in ar) ;; lib) # Microsoft lib, so override with the ar-lib wrapper script. # FIXME: It is wrong to rewrite AR. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__AR in this case, # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something # similar. AR="$am_aux_dir/ar-lib $AR" ;; unknown) as_fn_error $? "could not determine $AR interface" "$LINENO" 5 ;; esac ## Use library (static library) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; 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_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $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 RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; 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_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $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_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" 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 RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi ## --- Check function posix_fallocate() for ac_func in posix_fallocate do : ac_fn_c_check_func "$LINENO" "posix_fallocate" "ac_cv_func_posix_fallocate" if test "x$ac_cv_func_posix_fallocate" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_POSIX_FALLOCATE 1 _ACEOF fi done ## --- Check function ftruncate() for ac_func in ftruncate do : ac_fn_c_check_func "$LINENO" "ftruncate" "ac_cv_func_ftruncate" if test "x$ac_cv_func_ftruncate" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_FTRUNCATE 1 _ACEOF fi done ## ---------------------------------------------- ## L10N (add intltoolize to autogen.sh) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5 $as_echo_n "checking whether NLS is requested... " >&6; } # Check whether --enable-nls was given. if test "${enable_nls+set}" = set; then : enableval=$enable_nls; USE_NLS=$enableval else USE_NLS=yes fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 $as_echo "$USE_NLS" >&6; } case "$am__api_version" in 1.01234) as_fn_error $? "Automake 1.5 or newer is required to use intltool" "$LINENO" 5 ;; *) ;; esac INTLTOOL_REQUIRED_VERSION_AS_INT=`echo | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'` INTLTOOL_APPLIED_VERSION=`intltool-update --version | head -1 | cut -d" " -f3` INTLTOOL_APPLIED_VERSION_AS_INT=`echo $INTLTOOL_APPLIED_VERSION | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'` if test -n ""; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for intltool >= " >&5 $as_echo_n "checking for intltool >= ... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_APPLIED_VERSION found" >&5 $as_echo "$INTLTOOL_APPLIED_VERSION found" >&6; } test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" || as_fn_error $? "Your intltool is too old. You need intltool or later." "$LINENO" 5 fi # Extract the first word of "intltool-update", so it can be a program name with args. set dummy intltool-update; 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_INTLTOOL_UPDATE+:} false; then : $as_echo_n "(cached) " >&6 else case $INTLTOOL_UPDATE in [\\/]* | ?:[\\/]*) ac_cv_path_INTLTOOL_UPDATE="$INTLTOOL_UPDATE" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_INTLTOOL_UPDATE="$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 INTLTOOL_UPDATE=$ac_cv_path_INTLTOOL_UPDATE if test -n "$INTLTOOL_UPDATE"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_UPDATE" >&5 $as_echo "$INTLTOOL_UPDATE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "intltool-merge", so it can be a program name with args. set dummy intltool-merge; 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_INTLTOOL_MERGE+:} false; then : $as_echo_n "(cached) " >&6 else case $INTLTOOL_MERGE in [\\/]* | ?:[\\/]*) ac_cv_path_INTLTOOL_MERGE="$INTLTOOL_MERGE" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_INTLTOOL_MERGE="$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 INTLTOOL_MERGE=$ac_cv_path_INTLTOOL_MERGE if test -n "$INTLTOOL_MERGE"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_MERGE" >&5 $as_echo "$INTLTOOL_MERGE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "intltool-extract", so it can be a program name with args. set dummy intltool-extract; 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_INTLTOOL_EXTRACT+:} false; then : $as_echo_n "(cached) " >&6 else case $INTLTOOL_EXTRACT in [\\/]* | ?:[\\/]*) ac_cv_path_INTLTOOL_EXTRACT="$INTLTOOL_EXTRACT" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_INTLTOOL_EXTRACT="$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 INTLTOOL_EXTRACT=$ac_cv_path_INTLTOOL_EXTRACT if test -n "$INTLTOOL_EXTRACT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_EXTRACT" >&5 $as_echo "$INTLTOOL_EXTRACT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$INTLTOOL_UPDATE" -o -z "$INTLTOOL_MERGE" -o -z "$INTLTOOL_EXTRACT"; then as_fn_error $? "The intltool scripts were not found. Please install intltool." "$LINENO" 5 fi if test -z "$AM_DEFAULT_VERBOSITY"; then AM_DEFAULT_VERBOSITY=1 fi INTLTOOL_V_MERGE='$(INTLTOOL__v_MERGE_$(V))' INTLTOOL__v_MERGE_='$(INTLTOOL__v_MERGE_$(AM_DEFAULT_VERBOSITY))' INTLTOOL__v_MERGE_0='@echo " ITMRG " $@;' INTLTOOL_V_MERGE_OPTIONS='$(intltool__v_merge_options_$(V))' intltool__v_merge_options_='$(intltool__v_merge_options_$(AM_DEFAULT_VERBOSITY))' intltool__v_merge_options_0='-q' INTLTOOL_DESKTOP_RULE='%.desktop: %.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_DIRECTORY_RULE='%.directory: %.directory.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_KEYS_RULE='%.keys: %.keys.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -k -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_PROP_RULE='%.prop: %.prop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_OAF_RULE='%.oaf: %.oaf.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -o -p $(top_srcdir)/po $< $@' INTLTOOL_PONG_RULE='%.pong: %.pong.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_SERVER_RULE='%.server: %.server.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -o -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_SHEET_RULE='%.sheet: %.sheet.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_SOUNDLIST_RULE='%.soundlist: %.soundlist.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_UI_RULE='%.ui: %.ui.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_XML_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' if test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge 5000; then INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u --no-translations $< $@' else INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; $(INTLTOOL_V_MERGE)_it_tmp_dir=tmp.intltool.$$RANDOM && mkdir $$_it_tmp_dir && LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u $$_it_tmp_dir $< $@ && rmdir $$_it_tmp_dir' fi INTLTOOL_XAM_RULE='%.xam: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_KBD_RULE='%.kbd: %.kbd.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -m -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_CAVES_RULE='%.caves: %.caves.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_SCHEMAS_RULE='%.schemas: %.schemas.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -s -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_THEME_RULE='%.theme: %.theme.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_SERVICE_RULE='%.service: %.service.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_POLICY_RULE='%.policy: %.policy.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' # Check the gettext tools to make sure they are GNU # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; 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_XGETTEXT+:} false; then : $as_echo_n "(cached) " >&6 else case $XGETTEXT in [\\/]* | ?:[\\/]*) ac_cv_path_XGETTEXT="$XGETTEXT" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_XGETTEXT="$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 XGETTEXT=$ac_cv_path_XGETTEXT if test -n "$XGETTEXT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5 $as_echo "$XGETTEXT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "msgmerge", so it can be a program name with args. set dummy msgmerge; 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_MSGMERGE+:} false; then : $as_echo_n "(cached) " >&6 else case $MSGMERGE in [\\/]* | ?:[\\/]*) ac_cv_path_MSGMERGE="$MSGMERGE" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_MSGMERGE="$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 MSGMERGE=$ac_cv_path_MSGMERGE if test -n "$MSGMERGE"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5 $as_echo "$MSGMERGE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; 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_MSGFMT+:} false; then : $as_echo_n "(cached) " >&6 else case $MSGFMT in [\\/]* | ?:[\\/]*) ac_cv_path_MSGFMT="$MSGFMT" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_MSGFMT="$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 MSGFMT=$ac_cv_path_MSGFMT if test -n "$MSGFMT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 $as_echo "$MSGFMT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; 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_GMSGFMT+:} false; then : $as_echo_n "(cached) " >&6 else case $GMSGFMT in [\\/]* | ?:[\\/]*) ac_cv_path_GMSGFMT="$GMSGFMT" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GMSGFMT="$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_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" ;; esac fi GMSGFMT=$ac_cv_path_GMSGFMT if test -n "$GMSGFMT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5 $as_echo "$GMSGFMT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$XGETTEXT" -o -z "$MSGMERGE" -o -z "$MSGFMT"; then as_fn_error $? "GNU gettext tools not found; required for intltool" "$LINENO" 5 fi xgversion="`$XGETTEXT --version|grep '(GNU ' 2> /dev/null`" mmversion="`$MSGMERGE --version|grep '(GNU ' 2> /dev/null`" mfversion="`$MSGFMT --version|grep '(GNU ' 2> /dev/null`" if test -z "$xgversion" -o -z "$mmversion" -o -z "$mfversion"; then as_fn_error $? "GNU gettext tools not found; required for intltool" "$LINENO" 5 fi # Extract the first word of "perl", so it can be a program name with args. set dummy perl; 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_INTLTOOL_PERL+:} false; then : $as_echo_n "(cached) " >&6 else case $INTLTOOL_PERL in [\\/]* | ?:[\\/]*) ac_cv_path_INTLTOOL_PERL="$INTLTOOL_PERL" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_INTLTOOL_PERL="$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 INTLTOOL_PERL=$ac_cv_path_INTLTOOL_PERL if test -n "$INTLTOOL_PERL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_PERL" >&5 $as_echo "$INTLTOOL_PERL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$INTLTOOL_PERL"; then as_fn_error $? "perl not found" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl >= 5.8.1" >&5 $as_echo_n "checking for perl >= 5.8.1... " >&6; } $INTLTOOL_PERL -e "use 5.8.1;" > /dev/null 2>&1 if test $? -ne 0; then as_fn_error $? "perl 5.8.1 is required for intltool" "$LINENO" 5 else IT_PERL_VERSION=`$INTLTOOL_PERL -e "printf '%vd', $^V"` { $as_echo "$as_me:${as_lineno-$LINENO}: result: $IT_PERL_VERSION" >&5 $as_echo "$IT_PERL_VERSION" >&6; } fi if test "x" != "xno-xml"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XML::Parser" >&5 $as_echo_n "checking for XML::Parser... " >&6; } if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } else as_fn_error $? "XML::Parser perl module is required for intltool" "$LINENO" 5 fi fi # Substitute ALL_LINGUAS so we can use it in po/Makefile ## replace ALL_LINGUAS with po/LINGUAS # ALL_LINGUAS="" GETTEXT_PACKAGE="$PACKAGE" 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in locale.h do : ac_fn_c_check_header_mongrel "$LINENO" "locale.h" "ac_cv_header_locale_h" "$ac_includes_default" if test "x$ac_cv_header_locale_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LOCALE_H 1 _ACEOF fi done if test $ac_cv_header_locale_h = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LC_MESSAGES" >&5 $as_echo_n "checking for LC_MESSAGES... " >&6; } if ${am_cv_val_LC_MESSAGES+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { return LC_MESSAGES ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : am_cv_val_LC_MESSAGES=yes else am_cv_val_LC_MESSAGES=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_val_LC_MESSAGES" >&5 $as_echo "$am_cv_val_LC_MESSAGES" >&6; } if test $am_cv_val_LC_MESSAGES = yes; then $as_echo "#define HAVE_LC_MESSAGES 1" >>confdefs.h fi fi USE_NLS=yes gt_cv_have_gettext=no CATOBJEXT=NONE XGETTEXT=: INTLLIBS= { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFPreferencesCopyAppValue" >&5 $as_echo_n "checking for CFPreferencesCopyAppValue... " >&6; } if ${gt_cv_func_CFPreferencesCopyAppValue+:} false; then : $as_echo_n "(cached) " >&6 else gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { CFPreferencesCopyAppValue(NULL, NULL) ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : gt_cv_func_CFPreferencesCopyAppValue=yes else gt_cv_func_CFPreferencesCopyAppValue=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$gt_save_LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5 $as_echo "$gt_cv_func_CFPreferencesCopyAppValue" >&6; } if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then $as_echo "#define HAVE_CFPREFERENCESCOPYAPPVALUE 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFLocaleCopyCurrent" >&5 $as_echo_n "checking for CFLocaleCopyCurrent... " >&6; } if ${gt_cv_func_CFLocaleCopyCurrent+:} false; then : $as_echo_n "(cached) " >&6 else gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { CFLocaleCopyCurrent(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : gt_cv_func_CFLocaleCopyCurrent=yes else gt_cv_func_CFLocaleCopyCurrent=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$gt_save_LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFLocaleCopyCurrent" >&5 $as_echo "$gt_cv_func_CFLocaleCopyCurrent" >&6; } if test $gt_cv_func_CFLocaleCopyCurrent = yes; then $as_echo "#define HAVE_CFLOCALECOPYCURRENT 1" >>confdefs.h fi INTL_MACOSX_LIBS= if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" fi ac_fn_c_check_header_mongrel "$LINENO" "libintl.h" "ac_cv_header_libintl_h" "$ac_includes_default" if test "x$ac_cv_header_libintl_h" = xyes; then : gt_cv_func_dgettext_libintl="no" libintl_extra_libs="" # # First check in libc # { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ngettext in libc" >&5 $as_echo_n "checking for ngettext in libc... " >&6; } if ${gt_cv_func_ngettext_libc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { return !ngettext ("","", 1) ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : gt_cv_func_ngettext_libc=yes else gt_cv_func_ngettext_libc=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_ngettext_libc" >&5 $as_echo "$gt_cv_func_ngettext_libc" >&6; } if test "$gt_cv_func_ngettext_libc" = "yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dgettext in libc" >&5 $as_echo_n "checking for dgettext in libc... " >&6; } if ${gt_cv_func_dgettext_libc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { return !dgettext ("","") ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : gt_cv_func_dgettext_libc=yes else gt_cv_func_dgettext_libc=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_dgettext_libc" >&5 $as_echo "$gt_cv_func_dgettext_libc" >&6; } fi if test "$gt_cv_func_ngettext_libc" = "yes" ; then for ac_func in bind_textdomain_codeset do : ac_fn_c_check_func "$LINENO" "bind_textdomain_codeset" "ac_cv_func_bind_textdomain_codeset" if test "x$ac_cv_func_bind_textdomain_codeset" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_BIND_TEXTDOMAIN_CODESET 1 _ACEOF fi done fi # # If we don't have everything we want, check in libintl # if test "$gt_cv_func_dgettext_libc" != "yes" \ || test "$gt_cv_func_ngettext_libc" != "yes" \ || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bindtextdomain in -lintl" >&5 $as_echo_n "checking for bindtextdomain in -lintl... " >&6; } if ${ac_cv_lib_intl_bindtextdomain+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char bindtextdomain (); int main () { return bindtextdomain (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_intl_bindtextdomain=yes else ac_cv_lib_intl_bindtextdomain=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_bindtextdomain" >&5 $as_echo "$ac_cv_lib_intl_bindtextdomain" >&6; } if test "x$ac_cv_lib_intl_bindtextdomain" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ngettext in -lintl" >&5 $as_echo_n "checking for ngettext in -lintl... " >&6; } if ${ac_cv_lib_intl_ngettext+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char ngettext (); int main () { return ngettext (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_intl_ngettext=yes else ac_cv_lib_intl_ngettext=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_ngettext" >&5 $as_echo "$ac_cv_lib_intl_ngettext" >&6; } if test "x$ac_cv_lib_intl_ngettext" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dgettext in -lintl" >&5 $as_echo_n "checking for dgettext in -lintl... " >&6; } if ${ac_cv_lib_intl_dgettext+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dgettext (); int main () { return dgettext (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_intl_dgettext=yes else ac_cv_lib_intl_dgettext=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_dgettext" >&5 $as_echo "$ac_cv_lib_intl_dgettext" >&6; } if test "x$ac_cv_lib_intl_dgettext" = xyes; then : gt_cv_func_dgettext_libintl=yes fi fi fi if test "$gt_cv_func_dgettext_libintl" != "yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if -liconv is needed to use gettext" >&5 $as_echo_n "checking if -liconv is needed to use gettext... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 $as_echo "" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ngettext in -lintl" >&5 $as_echo_n "checking for ngettext in -lintl... " >&6; } if ${ac_cv_lib_intl_ngettext+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl -liconv $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char ngettext (); int main () { return ngettext (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_intl_ngettext=yes else ac_cv_lib_intl_ngettext=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_ngettext" >&5 $as_echo "$ac_cv_lib_intl_ngettext" >&6; } if test "x$ac_cv_lib_intl_ngettext" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dcgettext in -lintl" >&5 $as_echo_n "checking for dcgettext in -lintl... " >&6; } if ${ac_cv_lib_intl_dcgettext+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl -liconv $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dcgettext (); int main () { return dcgettext (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_intl_dcgettext=yes else ac_cv_lib_intl_dcgettext=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_dcgettext" >&5 $as_echo "$ac_cv_lib_intl_dcgettext" >&6; } if test "x$ac_cv_lib_intl_dcgettext" = xyes; then : gt_cv_func_dgettext_libintl=yes libintl_extra_libs=-liconv else : fi else : fi fi # # If we found libintl, then check in it for bind_textdomain_codeset(); # we'll prefer libc if neither have bind_textdomain_codeset(), # and both have dgettext and ngettext # if test "$gt_cv_func_dgettext_libintl" = "yes" ; then glib_save_LIBS="$LIBS" LIBS="$LIBS -lintl $libintl_extra_libs" unset ac_cv_func_bind_textdomain_codeset for ac_func in bind_textdomain_codeset do : ac_fn_c_check_func "$LINENO" "bind_textdomain_codeset" "ac_cv_func_bind_textdomain_codeset" if test "x$ac_cv_func_bind_textdomain_codeset" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_BIND_TEXTDOMAIN_CODESET 1 _ACEOF fi done LIBS="$glib_save_LIBS" if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then gt_cv_func_dgettext_libc=no else if test "$gt_cv_func_dgettext_libc" = "yes" \ && test "$gt_cv_func_ngettext_libc" = "yes"; then gt_cv_func_dgettext_libintl=no fi fi fi fi if test "$gt_cv_func_dgettext_libc" = "yes" \ || test "$gt_cv_func_dgettext_libintl" = "yes"; then gt_cv_have_gettext=yes fi if test "$gt_cv_func_dgettext_libintl" = "yes"; then INTLLIBS="-lintl $libintl_extra_libs $INTL_MACOSX_LIBS" fi if test "$gt_cv_have_gettext" = "yes"; then $as_echo "#define HAVE_GETTEXT 1" >>confdefs.h # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; 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_MSGFMT+:} false; then : $as_echo_n "(cached) " >&6 else case "$MSGFMT" in /*) ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then ac_cv_path_MSGFMT="$ac_dir/$ac_word" break fi fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="no" ;; esac fi MSGFMT="$ac_cv_path_MSGFMT" if test "$MSGFMT" != "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 $as_echo "$MSGFMT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$MSGFMT" != "no"; then glib_save_LIBS="$LIBS" LIBS="$LIBS $INTLLIBS" for ac_func in dcgettext do : ac_fn_c_check_func "$LINENO" "dcgettext" "ac_cv_func_dcgettext" if test "x$ac_cv_func_dcgettext" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DCGETTEXT 1 _ACEOF fi done MSGFMT_OPTS= { $as_echo "$as_me:${as_lineno-$LINENO}: checking if msgfmt accepts -c" >&5 $as_echo_n "checking if msgfmt accepts -c... " >&6; } cat >conftest.foo <<_ACEOF msgid "" msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Project-Id-Version: test 1.0\n" "PO-Revision-Date: 2007-02-15 12:01+0100\n" "Last-Translator: test \n" "Language-Team: C \n" "MIME-Version: 1.0\n" "Content-Transfer-Encoding: 8bit\n" _ACEOF if { { $as_echo "$as_me:${as_lineno-$LINENO}: \$MSGFMT -c -o /dev/null conftest.foo"; } >&5 ($MSGFMT -c -o /dev/null conftest.foo) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then MSGFMT_OPTS=-c; { $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; } echo "$as_me: failed input was:" >&5 sed 's/^/| /' conftest.foo >&5 fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; 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_GMSGFMT+:} false; then : $as_echo_n "(cached) " >&6 else case $GMSGFMT in [\\/]* | ?:[\\/]*) ac_cv_path_GMSGFMT="$GMSGFMT" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GMSGFMT="$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_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" ;; esac fi GMSGFMT=$ac_cv_path_GMSGFMT if test -n "$GMSGFMT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5 $as_echo "$GMSGFMT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; 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_XGETTEXT+:} false; then : $as_echo_n "(cached) " >&6 else case "$XGETTEXT" in /*) ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then ac_cv_path_XGETTEXT="$ac_dir/$ac_word" break fi fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" ;; esac fi XGETTEXT="$ac_cv_path_XGETTEXT" if test "$XGETTEXT" != ":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5 $as_echo "$XGETTEXT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { extern int _nl_msg_cat_cntr; return _nl_msg_cat_cntr ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : CATOBJEXT=.gmo DATADIRNAME=share else case $host in *-*-solaris*) ac_fn_c_check_func "$LINENO" "bind_textdomain_codeset" "ac_cv_func_bind_textdomain_codeset" if test "x$ac_cv_func_bind_textdomain_codeset" = xyes; then : CATOBJEXT=.gmo DATADIRNAME=share else CATOBJEXT=.mo DATADIRNAME=lib fi ;; *-*-openbsd*) CATOBJEXT=.mo DATADIRNAME=share ;; *) CATOBJEXT=.mo DATADIRNAME=lib ;; esac fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$glib_save_LIBS" INSTOBJEXT=.mo else gt_cv_have_gettext=no fi fi fi if test "$gt_cv_have_gettext" = "yes" ; then $as_echo "#define ENABLE_NLS 1" >>confdefs.h fi if test "$XGETTEXT" != ":"; then if $XGETTEXT --omit-header /dev/null 2> /dev/null; then : ; else { $as_echo "$as_me:${as_lineno-$LINENO}: result: found xgettext program is not GNU xgettext; ignore it" >&5 $as_echo "found xgettext program is not GNU xgettext; ignore it" >&6; } XGETTEXT=":" fi fi # We need to process the po/ directory. POSUB=po ac_config_commands="$ac_config_commands default-1" for lang in $ALL_LINGUAS; do GMOFILES="$GMOFILES $lang.gmo" POFILES="$POFILES $lang.po" done if test "$gt_cv_have_gettext" = "yes"; then if test "x$ALL_LINGUAS" = "x"; then LINGUAS= else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for catalogs to be installed" >&5 $as_echo_n "checking for catalogs to be installed... " >&6; } NEW_LINGUAS= for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then NEW_LINGUAS="$NEW_LINGUAS $presentlang" fi done LINGUAS=$NEW_LINGUAS { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LINGUAS" >&5 $as_echo "$LINGUAS" >&6; } fi if test -n "$LINGUAS"; then for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done fi fi MKINSTALLDIRS= if test -n "$ac_aux_dir"; then MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" fi if test -z "$MKINSTALLDIRS"; then MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" fi test -d po || mkdir po if test "x$srcdir" != "x."; then if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then posrcprefix="$srcdir/" else posrcprefix="../$srcdir/" fi else posrcprefix="../" fi rm -f po/POTFILES sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ < $srcdir/po/POTFILES.in > po/POTFILES glib_save_prefix="$prefix" glib_save_exec_prefix="$exec_prefix" glib_save_datarootdir="$datarootdir" test "x$prefix" = xNONE && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix=$prefix datarootdir=`eval echo "${datarootdir}"` if test "x$CATOBJEXT" = "x.mo" ; then localedir=`eval echo "${libdir}/locale"` else localedir=`eval echo "${datadir}/locale"` fi prefix="$glib_save_prefix" exec_prefix="$glib_save_exec_prefix" datarootdir="$glib_save_datarootdir" cat >>confdefs.h <<_ACEOF #define LOCALEDIR "$localedir" _ACEOF ## Use AM_GLIB_DEFINE_LOCALEDIR with AC_CONFIG_HEADERS ## ---------------------------------------------- ## GTK+ 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 as_fn_executable_p "$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 as_fn_executable_p "$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" >&5 $as_echo_n "checking for GTK... " >&6; } if test -n "$GTK_CFLAGS"; then pkg_cv_GTK_CFLAGS="$GTK_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+-3.0 >= 3.4\""; } >&5 ($PKG_CONFIG --exists --print-errors "gtk+-3.0 >= 3.4") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GTK_CFLAGS=`$PKG_CONFIG --cflags "gtk+-3.0 >= 3.4" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GTK_LIBS"; then pkg_cv_GTK_LIBS="$GTK_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+-3.0 >= 3.4\""; } >&5 ($PKG_CONFIG --exists --print-errors "gtk+-3.0 >= 3.4") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GTK_LIBS=`$PKG_CONFIG --libs "gtk+-3.0 >= 3.4" 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_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gtk+-3.0 >= 3.4" 2>&1` else GTK_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gtk+-3.0 >= 3.4" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GTK_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (gtk+-3.0 >= 3.4) were not met: $GTK_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_CFLAGS and GTK_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_CFLAGS and GTK_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_CFLAGS=$pkg_cv_GTK_CFLAGS GTK_LIBS=$pkg_cv_GTK_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi ## ---------------- ## glib (add HAVE_GLIB definition to config.h) if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-2.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then have_glib="yes" else have_glib="no" fi if test x$have_glib = xyes ; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLIB" >&5 $as_echo_n "checking for GLIB... " >&6; } if test -n "$GLIB_CFLAGS"; then pkg_cv_GLIB_CFLAGS="$GLIB_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-2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-2.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GLIB_CFLAGS=`$PKG_CONFIG --cflags "glib-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_LIBS"; then pkg_cv_GLIB_LIBS="$GLIB_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-2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-2.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GLIB_LIBS=`$PKG_CONFIG --libs "glib-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_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glib-2.0" 2>&1` else GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glib-2.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GLIB_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (glib-2.0) were not met: $GLIB_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_CFLAGS and GLIB_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_CFLAGS and GLIB_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_CFLAGS=$pkg_cv_GLIB_CFLAGS GLIB_LIBS=$pkg_cv_GLIB_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi $as_echo "#define HAVE_GLIB 1" >>confdefs.h fi ## ---------------- ## pthread { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 $as_echo_n "checking for pthread_create in -lpthread... " >&6; } if ${ac_cv_lib_pthread_pthread_create+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_create (); int main () { return pthread_create (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pthread_pthread_create=yes else ac_cv_lib_pthread_pthread_create=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5 $as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } if test "x$ac_cv_lib_pthread_pthread_create" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBPTHREAD 1 _ACEOF LIBS="-lpthread $LIBS" else as_fn_error $? "required library pthread missing" "$LINENO" 5 fi PTHREAD_CFLAGS="-pthread" PTHREAD_LIBS="-pthread" ## ---------------- ## LFS # Extract the first word of "getconf", so it can be a program name with args. set dummy getconf; 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_GETCONF+:} false; then : $as_echo_n "(cached) " >&6 else case $GETCONF in [\\/]* | ?:[\\/]*) ac_cv_path_GETCONF="$GETCONF" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GETCONF="$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 GETCONF=$ac_cv_path_GETCONF if test -n "$GETCONF"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GETCONF" >&5 $as_echo "$GETCONF" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$GETCONF" != "x" ; then LFS_CFLAGS=`$GETCONF LFS_CFLAGS` LFS_LDFLAGS=`$GETCONF LFS_LDFLAGS` fi ## ---------------- ## cURL # Extract the first word of "curl-config", so it can be a program name with args. set dummy curl-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_CURL_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $CURL_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_CURL_CONFIG="$CURL_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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_CURL_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 CURL_CONFIG=$ac_cv_path_CURL_CONFIG if test -n "$CURL_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CURL_CONFIG" >&5 $as_echo "$CURL_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$CURL_CONFIG" = "x" ; then as_fn_error please install libcurl "Unable to find curl-config" "$LINENO" 5 fi CURL_CFLAGS=`$CURL_CONFIG --cflags` CURL_LIBS=`$CURL_CONFIG --libs` let CURL_VERNUM=0x0`$CURL_CONFIG --vernum` let CURL_VERMIN=0x071301 # 7.19.1 if test $CURL_VERNUM -lt $CURL_VERMIN; then as_fn_error $? "Requires libcurl version >= 7.19.1" "$LINENO" 5 fi ## ---------------- ## GnuTLS # Check whether --with-gnutls was given. if test "${with_gnutls+set}" = set; then : withval=$with_gnutls; with_gnutls="$withval" else with_gnutls="no" fi if test "x$with_gnutls" != "xno"; then # AC_CHECK_HEADER(gcrypt.h, [USE_GNUTLS_GCRYPT=1], [USE_GNUTLS_GCRYPT=0]) # if test "$USE_GNUTLS_GCRYPT" = "1"; then # LIBGCRYPT_CFLAGS="" # AC_SUBST(LIBGCRYPT_CFLAGS) # fi # AC_CHECK_HEADER(gcrypt/gcrypt.h, [USE_GNUTLS_GCRYPT=1], [USE_GNUTLS_GCRYPT=0]) # if test "$USE_GNUTLS_GCRYPT" = "1"; then # LIBGCRYPT_CFLAGS="" # AC_SUBST(LIBGCRYPT_CFLAGS, [""]) # fi # AC_CHECK_LIB(gcrypt, gcry_control, [USE_GNUTLS_GCRYPT=1], [USE_GNUTLS_GCRYPT=0]) # if test "$USE_GNUTLS_GCRYPT" = "1"; then # LIBGCRYPT_LIBS="-lgcrypt" # AC_SUBST(LIBGCRYPT_LIBS, ["-lgcrypt"]) # fi # Extract the first word of "libgcrypt-config", so it can be a program name with args. set dummy libgcrypt-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_LIBGCRYPT_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $LIBGCRYPT_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_LIBGCRYPT_CONFIG="$LIBGCRYPT_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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_LIBGCRYPT_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 LIBGCRYPT_CONFIG=$ac_cv_path_LIBGCRYPT_CONFIG if test -n "$LIBGCRYPT_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBGCRYPT_CONFIG" >&5 $as_echo "$LIBGCRYPT_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$LIBGCRYPT_CONFIG" = "x" ; then if test "x$with_gnutls" = "xyes"; then as_fn_error please install libgcrypt "Unable to find libgcrypt-config" "$LINENO" 5 fi else LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG --cflags` LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG --libs` $as_echo "#define USE_GNUTLS 1" >>confdefs.h fi fi ## ---------------- ## OpenSSL # Check whether --with-openssl was given. if test "${with_openssl+set}" = set; then : withval=$with_openssl; with_openssl="$withval" else with_openssl="yes" fi if test "x$LIBGCRYPT_CONFIG" = "x" ; then if test "x$with_openssl" = "xyes"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBCRYPTO" >&5 $as_echo_n "checking for LIBCRYPTO... " >&6; } if test -n "$LIBCRYPTO_CFLAGS"; then pkg_cv_LIBCRYPTO_CFLAGS="$LIBCRYPTO_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcrypto\""; } >&5 ($PKG_CONFIG --exists --print-errors "libcrypto") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBCRYPTO_CFLAGS=`$PKG_CONFIG --cflags "libcrypto" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LIBCRYPTO_LIBS"; then pkg_cv_LIBCRYPTO_LIBS="$LIBCRYPTO_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcrypto\""; } >&5 ($PKG_CONFIG --exists --print-errors "libcrypto") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBCRYPTO_LIBS=`$PKG_CONFIG --libs "libcrypto" 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 LIBCRYPTO_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libcrypto" 2>&1` else LIBCRYPTO_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libcrypto" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LIBCRYPTO_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (libcrypto) were not met: $LIBCRYPTO_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 LIBCRYPTO_CFLAGS and LIBCRYPTO_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 LIBCRYPTO_CFLAGS and LIBCRYPTO_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 LIBCRYPTO_CFLAGS=$pkg_cv_LIBCRYPTO_CFLAGS LIBCRYPTO_LIBS=$pkg_cv_LIBCRYPTO_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi $as_echo "#define USE_OPENSSL 1" >>confdefs.h fi fi ## ---------------- ## libnotify # Check whether --enable-notify was given. if test "${enable_notify+set}" = set; then : enableval=$enable_notify; enable_notify="$enableval" else enable_notify="yes" fi if test "x$enable_notify" = "xyes"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBNOTIFY" >&5 $as_echo_n "checking for LIBNOTIFY... " >&6; } if test -n "$LIBNOTIFY_CFLAGS"; then pkg_cv_LIBNOTIFY_CFLAGS="$LIBNOTIFY_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libnotify\""; } >&5 ($PKG_CONFIG --exists --print-errors "libnotify") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBNOTIFY_CFLAGS=`$PKG_CONFIG --cflags "libnotify" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LIBNOTIFY_LIBS"; then pkg_cv_LIBNOTIFY_LIBS="$LIBNOTIFY_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libnotify\""; } >&5 ($PKG_CONFIG --exists --print-errors "libnotify") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBNOTIFY_LIBS=`$PKG_CONFIG --libs "libnotify" 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 LIBNOTIFY_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libnotify" 2>&1` else LIBNOTIFY_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libnotify" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LIBNOTIFY_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (libnotify) were not met: $LIBNOTIFY_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 LIBNOTIFY_CFLAGS and LIBNOTIFY_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 LIBNOTIFY_CFLAGS and LIBNOTIFY_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 LIBNOTIFY_CFLAGS=$pkg_cv_LIBNOTIFY_CFLAGS LIBNOTIFY_LIBS=$pkg_cv_LIBNOTIFY_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi $as_echo "#define HAVE_LIBNOTIFY 1" >>confdefs.h # for ArchLinux fi ## ---------------- ## appindicator # Check whether --enable-appindicator was given. if test "${enable_appindicator+set}" = set; then : enableval=$enable_appindicator; enable_appindicator=$enableval else enable_appindicator="auto" fi if test x$enable_appindicator = xauto ; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"appindicator3-0.1\""; } >&5 ($PKG_CONFIG --exists --print-errors "appindicator3-0.1") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then enable_appindicator="yes" else enable_appindicator="no" fi fi if test x$enable_appindicator = xyes ; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for APP_INDICATOR" >&5 $as_echo_n "checking for APP_INDICATOR... " >&6; } if test -n "$APP_INDICATOR_CFLAGS"; then pkg_cv_APP_INDICATOR_CFLAGS="$APP_INDICATOR_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"appindicator3-0.1\""; } >&5 ($PKG_CONFIG --exists --print-errors "appindicator3-0.1") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_APP_INDICATOR_CFLAGS=`$PKG_CONFIG --cflags "appindicator3-0.1" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$APP_INDICATOR_LIBS"; then pkg_cv_APP_INDICATOR_LIBS="$APP_INDICATOR_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"appindicator3-0.1\""; } >&5 ($PKG_CONFIG --exists --print-errors "appindicator3-0.1") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_APP_INDICATOR_LIBS=`$PKG_CONFIG --libs "appindicator3-0.1" 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 APP_INDICATOR_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "appindicator3-0.1" 2>&1` else APP_INDICATOR_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "appindicator3-0.1" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$APP_INDICATOR_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (appindicator3-0.1) were not met: $APP_INDICATOR_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 APP_INDICATOR_CFLAGS and APP_INDICATOR_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 APP_INDICATOR_CFLAGS and APP_INDICATOR_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 APP_INDICATOR_CFLAGS=$pkg_cv_APP_INDICATOR_CFLAGS APP_INDICATOR_LIBS=$pkg_cv_APP_INDICATOR_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi $as_echo "#define HAVE_APP_INDICATOR 1" >>confdefs.h fi ## ---------------- ## gstreamer # Check whether --enable-gstreamer was given. if test "${enable_gstreamer+set}" = set; then : enableval=$enable_gstreamer; enable_gstreamer="$enableval" else enable_gstreamer="yes" fi if test "x$enable_gstreamer" = "xyes"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gstreamer-1.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "gstreamer-1.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then enable_gstreamer1="yes" else enable_gstreamer1="no" fi fi if test "x$enable_gstreamer1" = "xyes"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GSTREAMER" >&5 $as_echo_n "checking for GSTREAMER... " >&6; } if test -n "$GSTREAMER_CFLAGS"; then pkg_cv_GSTREAMER_CFLAGS="$GSTREAMER_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gstreamer-1.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "gstreamer-1.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GSTREAMER_CFLAGS=`$PKG_CONFIG --cflags "gstreamer-1.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GSTREAMER_LIBS"; then pkg_cv_GSTREAMER_LIBS="$GSTREAMER_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gstreamer-1.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "gstreamer-1.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GSTREAMER_LIBS=`$PKG_CONFIG --libs "gstreamer-1.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 GSTREAMER_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gstreamer-1.0" 2>&1` else GSTREAMER_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gstreamer-1.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GSTREAMER_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (gstreamer-1.0) were not met: $GSTREAMER_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 GSTREAMER_CFLAGS and GSTREAMER_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 GSTREAMER_CFLAGS and GSTREAMER_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 GSTREAMER_CFLAGS=$pkg_cv_GSTREAMER_CFLAGS GSTREAMER_LIBS=$pkg_cv_GSTREAMER_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi $as_echo "#define HAVE_GSTREAMER 1" >>confdefs.h # for ArchLinux elif test "x$enable_gstreamer" = "xyes"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GSTREAMER" >&5 $as_echo_n "checking for GSTREAMER... " >&6; } if test -n "$GSTREAMER_CFLAGS"; then pkg_cv_GSTREAMER_CFLAGS="$GSTREAMER_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gstreamer-0.10\""; } >&5 ($PKG_CONFIG --exists --print-errors "gstreamer-0.10") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GSTREAMER_CFLAGS=`$PKG_CONFIG --cflags "gstreamer-0.10" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GSTREAMER_LIBS"; then pkg_cv_GSTREAMER_LIBS="$GSTREAMER_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gstreamer-0.10\""; } >&5 ($PKG_CONFIG --exists --print-errors "gstreamer-0.10") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GSTREAMER_LIBS=`$PKG_CONFIG --libs "gstreamer-0.10" 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 GSTREAMER_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gstreamer-0.10" 2>&1` else GSTREAMER_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gstreamer-0.10" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GSTREAMER_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (gstreamer-0.10) were not met: $GSTREAMER_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 GSTREAMER_CFLAGS and GSTREAMER_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 GSTREAMER_CFLAGS and GSTREAMER_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 GSTREAMER_CFLAGS=$pkg_cv_GSTREAMER_CFLAGS GSTREAMER_LIBS=$pkg_cv_GSTREAMER_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi $as_echo "#define HAVE_GSTREAMER 1" >>confdefs.h # for ArchLinux fi ## ----------------- ## libpwmd # Check whether --enable-pwmd was given. if test "${enable_pwmd+set}" = set; then : enableval=$enable_pwmd; enable_pwmd="$enableval" else enable_pwmd="no" fi if test "x$enable_pwmd" = "xyes"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBPWMD" >&5 $as_echo_n "checking for LIBPWMD... " >&6; } if test -n "$LIBPWMD_CFLAGS"; then pkg_cv_LIBPWMD_CFLAGS="$LIBPWMD_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpwmd-8.0 >= 8.0.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "libpwmd-8.0 >= 8.0.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBPWMD_CFLAGS=`$PKG_CONFIG --cflags "libpwmd-8.0 >= 8.0.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LIBPWMD_LIBS"; then pkg_cv_LIBPWMD_LIBS="$LIBPWMD_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpwmd-8.0 >= 8.0.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "libpwmd-8.0 >= 8.0.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBPWMD_LIBS=`$PKG_CONFIG --libs "libpwmd-8.0 >= 8.0.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 LIBPWMD_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libpwmd-8.0 >= 8.0.0" 2>&1` else LIBPWMD_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libpwmd-8.0 >= 8.0.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LIBPWMD_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (libpwmd-8.0 >= 8.0.0) were not met: $LIBPWMD_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 LIBPWMD_CFLAGS and LIBPWMD_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 LIBPWMD_CFLAGS and LIBPWMD_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 LIBPWMD_CFLAGS=$pkg_cv_LIBPWMD_CFLAGS LIBPWMD_LIBS=$pkg_cv_LIBPWMD_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi $as_echo "#define HAVE_LIBPWMD 1" >>confdefs.h fi if test "x$enable_pwmd" = "xyes"; then WITH_LIBPWMD_TRUE= WITH_LIBPWMD_FALSE='#' else WITH_LIBPWMD_TRUE='#' WITH_LIBPWMD_FALSE= fi ## ----------------- ## RSS Notify # Check whether --enable-rss-notify was given. if test "${enable_rss_notify+set}" = set; then : enableval=$enable_rss_notify; enable_rss_notify="$enableval" else enable_rss_notify="yes" fi if test "x$enable_rss_notify" = "xyes"; then $as_echo "#define HAVE_RSS_NOTIFY 1" >>confdefs.h fi ## ----------------- ## UNIX Domain Socket # Check whether --enable-unix-socket was given. if test "${enable_unix_socket+set}" = set; then : enableval=$enable_unix_socket; enable_unix_socket="$enableval" else enable_unix_socket="no" fi if test "x$enable_unix_socket" = "xyes"; then $as_echo "#define USE_UNIX_DOMAIN_SOCKET 1" >>confdefs.h fi ## ---------------------------------------------- ## output ac_config_files="$ac_config_files Makefile doc/Makefile tests/Makefile uget/Makefile uglib/Makefile ui-gtk/Makefile ui-gtk-1to2/Makefile pixmaps/Makefile sounds/Makefile po/Makefile.in Windows/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}' DEFS=-DHAVE_CONFIG_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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi ac_config_commands="$ac_config_commands po/stamp-it" if test -z "${WITH_LIBPWMD_TRUE}" && test -z "${WITH_LIBPWMD_FALSE}"; then as_fn_error $? "conditional \"WITH_LIBPWMD\" 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 -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' 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 # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # 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 uget $as_me 2.2.0, which was generated by GNU Autoconf 2.69. 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 case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _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 --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands 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="\\ uget config.status 2.2.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 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;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --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 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _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 "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; "uget/Makefile") CONFIG_FILES="$CONFIG_FILES uget/Makefile" ;; "uglib/Makefile") CONFIG_FILES="$CONFIG_FILES uglib/Makefile" ;; "ui-gtk/Makefile") CONFIG_FILES="$CONFIG_FILES ui-gtk/Makefile" ;; "ui-gtk-1to2/Makefile") CONFIG_FILES="$CONFIG_FILES ui-gtk-1to2/Makefile" ;; "pixmaps/Makefile") CONFIG_FILES="$CONFIG_FILES pixmaps/Makefile" ;; "sounds/Makefile") CONFIG_FILES="$CONFIG_FILES sounds/Makefile" ;; "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; "Windows/Makefile") CONFIG_FILES="$CONFIG_FILES Windows/Makefile" ;; "po/stamp-it") CONFIG_COMMANDS="$CONFIG_COMMANDS po/stamp-it" ;; *) 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 test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands 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" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" 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 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _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" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "default-1":C) case "$CONFIG_FILES" in *po/Makefile.in*) sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile esac ;; "po/stamp-it":C) if ! grep "^# INTLTOOL_MAKEFILE$" "po/Makefile.in" > /dev/null ; then as_fn_error $? "po/Makefile.in.in was not created by intltoolize." "$LINENO" 5 fi rm -f "po/stamp-it" "po/stamp-it.tmp" "po/POTFILES" "po/Makefile.tmp" >"po/stamp-it.tmp" sed '/^#/d s/^[[].*] *// /^[ ]*$/d '"s|^| $ac_top_srcdir/|" \ "$srcdir/po/POTFILES.in" | sed '$!s/$/ \\/' >"po/POTFILES" sed '/^POTFILES =/,/[^\\]$/ { /^POTFILES =/!d r po/POTFILES } ' "po/Makefile.in" >"po/Makefile" rm -f "po/Makefile.tmp" mv "po/stamp-it.tmp" "po/stamp-it" ;; 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 uget-2.2.0/sounds/0000755000175000000120000000000013224533052010760 500000000000000uget-2.2.0/sounds/Makefile.am0000644000175000000120000000014113203310773012730 00000000000000soundsdir = $(datadir)/sounds/uget sounds_DATA = notification.wav EXTRA_DIST = $(sounds_DATA) uget-2.2.0/sounds/notification.wav0000644000175000000120000002540013203310772014105 00000000000000RIFF*WAVEfmt DXdata*EQJKF&0^$rA=W*{ u(0;7Vl=aZ>j|%@g!wou:_G.i;STe=_9J@358. 'cS?#u4DUK/I?u&Auv&3Yq@5tK>+02r2{/s*h9 ^2wZY)*^.GCWP3]b_`P]Q2yend8,)O?7+k(o<0dNX`Gy<;8F*KLT;(Dx(Z]~XW]*k}HfjI 107dqQOZ<ZB>p|fXGt2;L+p7yb.N|[!F uKh3 T dM>Uux_& H zyO?#jZS& .@hLK8n\jBG5 V1XF 3xb(Z|6%S6$[sr%Q]+ ` y[eN-W2v/L &?VHELL\0%qz\^ ,9)|$nSXC4ko !J"4E.kCF5UxUdpI B "Q( ] e@ +V9<2q}b@{ 7uEgI{ +Xp&x 0&aZ 2=[#N 9N\mi K,/a'Y z/dV/)oz5-#h+:) j Ob>eq[I} _ zY 2 qG8` J? 7gJ . zo  d Yr'uY -Zk h\  +iKYo7OEI# 'e9 EV{ +.n$ϓ> [S *WMYX^ C9.k B$|oLKۅ*6ZF [ !bVٹu_Iݵ ,F˔) ' Iĉ3/` ' d-9+2X_?VRZxd3C#8 ')l%K/&3?>'-#Ԥah2M'4AC=_#AAG])"w1<<=B_ mlKqۯD78q{B2/S0GC'`ߒ&M$8oY@V$a>Ph-ݳ$43:*c4! 6֜>!L7$K!$&.?PO@S@,-( : Yfb. K<4۷8P(7 ?B_(t5\) !>A?WK QUlI5փ(6<ZYϧ,☦o 2`*Җ76 C x!cy7ϝ+)`$ _ ;.t}h Ԍ[ɨ xHMI3!cܶFŝ P L5B#>/:!V*6 [/Y&޽q )i[<`ߊ gJIGO.%c,%_2!UD#4)c"8% Ej}\Jd+X9%J $s'! TY E )H) NԼ G #iPߠҙ*/3RŗCU HT?< EJ* 0aJT,Hӛ΄4h9jz[8hԴ޶naA07= On0GBG70&)&\=INE8:ImD04>:X ~[[ ;"lӥZ8+ȼōʸ /$3Gp#P#GἹdI| 0 = -%~X),) oYħx%*Е ܍ާǼ PB=? ':q= D- $=)4>599(/"CfF ',37Kl5!!&7XEB:P38b:&"?a ?EԼ?,U$@8  * Lh&*R*g?>DNOLK!TO=;#BXPA=9?;gAMjPKGB;];J5!U3Z.6 , v t:hK*zj,-z 2,& ~/QCH9L6,B::t..7|OYGG?PFKQU?\-87?#7s D'-6+ j&  Xί%`wp-7s0< * 6b)hn-2%Vl(UU|-y+kBH7# 184! Pg!  Te.p ۍe7 (Ґ`QfXv mj<O  _ m 1d+0J-\$#)r(QPQ+* +  nkwj#:ӱL%FNt&pk\* M "HK O|U pq2\iߕQݷ*ކ=ǚEΓէqvnҰߑ*AaUg$7\ }  7LL 4 ]o rF-mפO݀pطU)԰ '}!X1  \S z 9 ; b  {f{`E{g(8gٚB֣oޣݐOո)?OY?@ n p _##!0W1]ffS+7'UgD>XY tir 'Fbd_$!!!L M D @nz+/' 'ON/fߑ |.R.1 " 5 O a#!!%"s5; ' 9  "4=3c-y.vC[=T] 9KcyI'?e ='0  /H 4@\qib = 2 { `)7?axd, = 7kG m HW+  " h]H1eB]G@ L | 8z4tLpE#9OARSi^ & B $8(1 r|Du d[Jp_OQ~d$V[ ~r="zD N s qJQ>$4k|S6vE"p"6 r c "j \ |6sMj j]c^I1{L5O}k?YjnT ouf  i - W<;n`Zpd _D@W{IxeUoG2  5 b S j5o x C j !Ac\';Qa {C 6g y- S +V *  4  : _ , y&9/[W8X:*mUD/ )1< v Y m+],dQ Q_C!n=> (Jr$3UkrZ)  " 5v_zi4/i[vIE (iI\ sd 7   S 2 Q Co'LGD)@|$G+p)@\V0M-^5(-+:>+Z`|SY8bi{G+'UN<>G"M6-pmV d>!vQf; "Lh';.-Dbj~zB#z`$c Q  W/q' B84A#jofP=+R0 ?:<[ jWb3eK6.9PkD7u ^r\{5]4It'k*3%gt^P4hhb= >W~5B>g :d 8 ~\/PV(ZB2bSseK F]j}piXIc ] xUu}8}NOw% .'hKjmd]4`'D,b3;iFJ(o$=c8ZYL|W ;:0o;U`Le.iDB<V2Dk5 z3kV:JEj`A(-k5O  |7O#"X-L>xw9C .Ot5Zjro#tK@Jm@?]BKQMXC#5^nYM9Y,7mo8-rIs,~j@bZ2}6 { KUDqIiE\dLry.R&N&S78(}w <~B$'PFo)E}Bcpvqw| 9saX|>8h\w( X2Nie@.4R>]Ffhc[qs;  J-6$ 0yIVyub>JMSe"(Qz 9;Oxx,B2ec:3pE^}$eq I(21Gp\nZ[P6T[JA6!@1NcF[yunk=36%O9 7} hT ,`ksy<%?mb@ZR\>npS\fsw`C8 YW}@u}yuI@2rjb| 6+*PsH,#(<O-A^!yw`@MjE8SjU=k 0aRz#"'f[I63mF#D3+:Um;rsFbkk%8&Jzg3WYTs[rDAmXO-+D0Gvss`fZF4g~5-:/T && m[YZzv?6Ze^z|` ,;C{bBcocn:]eM% =jqkz.5 Sub^g%6Oa:=31iB) 2Rsh]c 8 8RQg{rnzx\QfhrH18%|'7r 4;JuywqX=M>-E^O*vuSJM:&Lq!#,?Obv{YVSN( xwqvrhnt\KIYPRhsaSg3b}s\|\cdsjR5=8"  oZ`]T}"1_#0~7 kP_vwgVVfiPQq|qmgz<fj~uget-2.2.0/sounds/Makefile.in0000644000175000000120000003552213224532746012765 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 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@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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 = sounds ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac 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)$(soundsdir)" DATA = $(sounds_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ APP_INDICATOR_CFLAGS = @APP_INDICATOR_CFLAGS@ APP_INDICATOR_LIBS = @APP_INDICATOR_LIBS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_CONFIG = @CURL_CONFIG@ CURL_LIBS = @CURL_LIBS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GETCONF = @GETCONF@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GSTREAMER_CFLAGS = @GSTREAMER_CFLAGS@ GSTREAMER_LIBS = @GSTREAMER_LIBS@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LDFLAGS = @LDFLAGS@ LFS_CFLAGS = @LFS_CFLAGS@ LFS_LDFLAGS = @LFS_LDFLAGS@ LIBCRYPTO_CFLAGS = @LIBCRYPTO_CFLAGS@ LIBCRYPTO_LIBS = @LIBCRYPTO_LIBS@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBNOTIFY_CFLAGS = @LIBNOTIFY_CFLAGS@ LIBNOTIFY_LIBS = @LIBNOTIFY_LIBS@ LIBOBJS = @LIBOBJS@ LIBPWMD_CFLAGS = @LIBPWMD_CFLAGS@ LIBPWMD_LIBS = @LIBPWMD_LIBS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ OBJEXT = @OBJEXT@ 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@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ 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@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ 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@ soundsdir = $(datadir)/sounds/uget sounds_DATA = notification.wav EXTRA_DIST = $(sounds_DATA) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(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) --gnu sounds/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu sounds/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-soundsDATA: $(sounds_DATA) @$(NORMAL_INSTALL) @list='$(sounds_DATA)'; test -n "$(soundsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(soundsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(soundsdir)" || exit 1; \ fi; \ 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)$(soundsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(soundsdir)" || exit $$?; \ done uninstall-soundsDATA: @$(NORMAL_UNINSTALL) @list='$(sounds_DATA)'; test -n "$(soundsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(soundsdir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: 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 $(DATA) installdirs: for dir in "$(DESTDIR)$(soundsdir)"; 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: 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-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-soundsDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: 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-soundsDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic cscopelist-am \ ctags-am distclean distclean-generic 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-soundsDATA install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am tags-am uninstall uninstall-am \ uninstall-soundsDATA .PRECIOUS: 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: uget-2.2.0/uglib/0000755000175000000120000000000013224533051010546 500000000000000uget-2.2.0/uglib/CMakeLists.txt0000644000175000000120000000163613224532565013245 00000000000000cmake_minimum_required(VERSION 3.4.1) project(uglib) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNDEBUG") include_directories( ${CURL_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ) add_library( uglib STATIC UgStdio.c UgString.c UgThread.c UgSocket.c UgUtil.c UgFileUtil.c UgArray.c UgList.c UgSLink.c UgOption.c UgUri.c UgNode.c UgData.c UgInfo.c UgRegistry.c UgValue.c UgEntry.c UgBuffer.c UgJson.c UgJson-custom.c UgJsonFile.c UgJsonrpc.c UgJsonrpcSocket.c UgJsonrpcCurl.c UgHtml.c UgHtmlEntry.c UgHtmlFilter.c ) uget-2.2.0/uglib/UgList.c0000644000175000000120000001720213224532612012045 00000000000000/* * * Copyright (C) 2012-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #ifdef HAVE_CONFIG_H #include #endif #ifdef HAVE_GLIB #include // g_slice_xxx #endif // HAVE_GLIB #include #include #include #include #include // ---------------------------------------------------------------------------- // UgLink UgLink* ug_link_new (void) { #ifdef HAVE_GLIB return g_slice_alloc0 (sizeof (UgLink)); #else return ug_malloc0 (sizeof (UgLink)); #endif } void ug_link_free (UgLink* link) { #ifdef HAVE_GLIB g_slice_free1 (sizeof (UgLink), link); #else ug_free (link); #endif } // ---------------------------------------------------------------------------- // UgList: for UG_ENTRY_LIST void ug_list_init (UgList* list) { list->head = NULL; list->tail = NULL; list->size = 0; } void ug_list_clear (UgList* list, int free_links) { UgLink* link; UgLink* next; if (free_links) { for (link = list->head; link; link = next) { next = link->next; // ug_link_free (link); #ifdef HAVE_GLIB g_slice_free1 (sizeof (UgLink), link); #else ug_free (link); #endif // HAVE_GLIB } } list->size = 0; list->head = NULL; list->tail = NULL; } void ug_list_foreach (UgList* list, UgForeachFunc func, void* data) { UgLink* link; UgLink* next; for (link = list->head; link; link = next) { next = link->next; func (link->data, data); } } void ug_list_foreach_link (UgList* list, UgForeachFunc func, void* data) { UgLink* link; UgLink* next; for (link = list->head; link; link = next) { next = link->next; func (link, data); } } void ug_list_prepend (UgList* list, UgLink* link) { link->prev = NULL; link->next = list->head; if (list->head) list->head->prev = link; else // if (list->tail == NULL) list->tail = link; list->head = link; list->size++; } void ug_list_append (UgList* list, UgLink* link) { if (list->tail) list->tail->next = link; else // if (list->head == NULL) list->head = link; link->next = NULL; link->prev = list->tail; list->tail = link; list->size++; } void ug_list_insert (UgList* list, UgLink* sibling, UgLink* link) { if (sibling == NULL) { ug_list_append (list, link); return; } if (sibling == list->head) { ug_list_prepend (list, link); return; } sibling->prev->next = link; link->next = sibling; link->prev = sibling->prev; sibling->prev = link; list->size++; } void ug_list_remove (UgList* list, UgLink* link) { if (list->tail == link) list->tail = link->prev; if (list->head == link) list->head = link->next; if (link->prev) link->prev->next = link->next; if (link->next) link->next->prev = link->prev; link->next = NULL; link->prev = NULL; list->size--; } int ug_list_position (UgList* list, UgLink* link) { UgLink* temp; int pos; for (pos = 0, temp = list->head; temp; temp = temp->next, pos++) { if (temp == link) return pos; } return -1; } // ---------------------------------------------------------------------------- // UgJsonParseFunc for JSON array elements UgJsonError ug_json_parse_list_bool (UgJson* json, const char* name, const char* value, void* list, void* none) { UgLink* link; if (json->type != UG_JSON_TRUE && json->type != UG_JSON_FALSE) { // if (json->type >= UG_JSON_OBJECT) // ug_json_push (json, ug_json_parse_unknown, NULL, NULL); return UG_JSON_ERROR_TYPE_NOT_MATCH; } link = ug_link_new (); if (json->type == UG_JSON_TRUE) link->data = (void*)(intptr_t)1; else link->data = (void*)(intptr_t)0; ug_list_append (list, link); return UG_JSON_ERROR_NONE; } UgJsonError ug_json_parse_list_int (UgJson* json, const char* name, const char* value, void* list, void* none) { UgLink* link; if (json->type != UG_JSON_NUMBER) { // if (json->type >= UG_JSON_OBJECT) // ug_json_push (json, ug_json_parse_unknown, NULL, NULL); return UG_JSON_ERROR_TYPE_NOT_MATCH; } link = ug_link_new (); link->data = (void*)(intptr_t) strtol (value, NULL, 10); ug_list_append (list, link); return UG_JSON_ERROR_NONE; } UgJsonError ug_json_parse_list_uint (UgJson* json, const char* name, const char* value, void* list, void* none) { UgLink* link; if (json->type != UG_JSON_NUMBER) { // if (json->type >= UG_JSON_OBJECT) // ug_json_push (json, ug_json_parse_unknown, NULL, NULL); return UG_JSON_ERROR_TYPE_NOT_MATCH; } link = ug_link_new (); link->data = (void*)(uintptr_t) strtoul (value, NULL, 10); ug_list_append (list, link); return UG_JSON_ERROR_NONE; } UgJsonError ug_json_parse_list_string (UgJson* json, const char* name, const char* value, void* list, void* none) { UgLink* link; char* string; if (json->type == UG_JSON_STRING) string = ug_strdup (value); else if (json->type == UG_JSON_NULL) string = NULL; else { // if (json->type >= UG_JSON_OBJECT) // ug_json_push (json, ug_json_parse_unknown, NULL, NULL); return UG_JSON_ERROR_TYPE_NOT_MATCH; } link = ug_link_new (); link->data = string; ug_list_append (list, link); return UG_JSON_ERROR_NONE; } // ---------------------------------------------------------------------------- // write JSON array elements void ug_json_write_list_bool (UgJson* json, UgList* list) { UgLink* link; for (link = list->head; link; link = link->next) ug_json_write_bool (json, (intptr_t)link->data); } void ug_json_write_list_int (UgJson* json, UgList* list) { UgLink* link; for (link = list->head; link; link = link->next) ug_json_write_int (json, (intptr_t)link->data); } void ug_json_write_list_uint (UgJson* json, UgList* list) { UgLink* link; for (link = list->head; link; link = link->next) ug_json_write_uint (json, (uintptr_t)link->data); } void ug_json_write_list_string (UgJson* json, UgList* list) { UgLink* link; for (link = list->head; link; link = link->next) { if (link->data == NULL) ug_json_write_null (json); else ug_json_write_string (json, link->data); } } uget-2.2.0/uglib/UgSLink.c0000644000175000000120000000702013224532612012147 00000000000000/* * * Copyright (C) 2012-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #include void ug_slinks_init (UgSLinks* slinks, int allocated_len) { ug_array_init (slinks, sizeof (UgSLink), allocated_len); slinks->n_links = 0; slinks->used = NULL; slinks->freed = NULL; } void ug_slinks_final (UgSLinks* slinks) { ug_array_clear (slinks); } void ug_slinks_add (UgSLinks* slinks, void* data) { UgSLink* link; UgSLink* old_used; UgSLink* old_at; UgSLink* current; old_used = slinks->used; if (slinks->freed != NULL) { link = slinks->freed; slinks->freed = link->next; // move link from freed list to used list. link->next = old_used; } else { old_at = slinks->at; link = (UgSLink*) ug_array_alloc (slinks, 1); if (old_at != slinks->at && old_used) { slinks->used = slinks->at + (old_used - old_at); for (current = slinks->used; ; current = current->next) { if (current->next == NULL) break; current->next = slinks->at + (current->next - old_at); } } // move link to used list. link->next = slinks->used; } link->data = data; slinks->used = link; slinks->n_links++; } UgSLink* ug_slinks_find (UgSLinks* slinks, void* data, UgSLink** prev_result) { UgSLink* prev; UgSLink* link; for (prev = NULL, link = slinks->used; link; link = link->next) { if (link->data == data) { if (prev_result) prev_result[0] = prev; return link; } prev = link; } return NULL; } void ug_slinks_remove (UgSLinks* slinks, void* data, UgSLink* prev) { UgSLink* link; if (prev == NULL) link = ug_slinks_find (slinks, data, &prev); else link = prev->next; if (link) { // remove link from used links if (prev) prev->next = link->next; else slinks->used = link->next; // add link to freed links link->next = slinks->freed; slinks->freed = link; } slinks->n_links--; } void ug_slinks_foreach (UgSLinks* slinks, UgForeachFunc func, void* user_data) { UgSLink* link; for (link = slinks->used; link; link = link->next) func (link->data, user_data); } uget-2.2.0/uglib/UgUtil.h0000644000175000000120000000705713224532612012063 00000000000000/* * * Copyright (C) 2012-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #ifndef UG_UTIL_H #define UG_UTIL_H #include #include #include #ifdef __cplusplus extern "C" { #endif // ---------------------------------------------------------------------------- // Time uint64_t ug_get_time_count (void); // ---------------------------------------------------------------------------- // Unicode int ug_utf8_get_invalid (const char* input, char* ch); uint16_t* ug_utf8_to_utf16 (const char* string, int stringLength, int* utf16len); char* ug_utf16_to_utf8 (const uint16_t* string, int stringLength, int* utf8len); uint32_t* ug_utf8_to_ucs4 (const char* string, int stringLength, int* ucs4len); char* ug_ucs4_to_utf8 (const uint32_t* string, int stringLength, int* utf8len); // ---------------------------------------------------------------------------- // Base64 char* ug_base64_encode (const unsigned char* data, int input_length, int* output_length); unsigned char* ug_base64_decode (const char* data, int input_length, int* output_length); // ---------------------------------------------------------------------------- // filename & path functions char* ug_build_filename (const char* first_element, ...); // ---------------------------------------------------------------------------- // Power Management // Suspend does not turn off your computer. It puts the computer and all peripherals on a low power consumption mode. // Hibernate saves the state of your computer to the hard disk and completely powers off. void ug_reboot (void); void ug_shutdown (void); void ug_suspend (void); void ug_hibernate (void); // ---------------------------------------------------------------------------- // Others char* ug_sys_release (void); #ifdef __cplusplus } #endif #endif // End of UG_UTIL_H uget-2.2.0/uglib/UgArray.h0000644000175000000120000001454313224532612012222 00000000000000/* * * Copyright (C) 2012-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #ifndef UG_ARRAY_H #define UG_ARRAY_H // uintptr_t is an unsigned int that is guaranteed to be the same size as a pointer. #include // uintptr_t, int64_t #include // qsort(), malloc(), free() #include #include #ifdef __cplusplus extern "C" { #endif // ---------------------------------------------------------------------------- // UgArray is a template C array. It used by UgEntry with UG_ENTRY_ARRAY. #define UG_ARRAY_MEMBERS(Type) \ Type* at; \ int length; \ int allocated; \ int element_size // implement C++ template by C macro #define UG_ARRAY(Type) struct { UG_ARRAY_MEMBERS (Type); } typedef UG_ARRAY(char) UgArrayChar; typedef UG_ARRAY(char*) UgArrayStr; typedef UG_ARRAY(void*) UgArrayPtr; typedef UG_ARRAY(int) UgArrayInt; typedef UG_ARRAY(unsigned int) UgArrayUint; typedef UG_ARRAY(int64_t) UgArrayInt64; typedef UG_ARRAY(double) UgArrayDouble; void ug_array_init (void* array, int element_size, int allocated_len); void ug_array_clear (void* array); void* ug_array_alloc (void* array, int nElements); void ug_array_foreach (void* array, UgForeachFunc func, void* data); void ug_array_foreach_ptr (void* array, UgForeachFunc func, void* data); #define ug_array_foreach_str ug_array_foreach_ptr #define ug_array_append(array, values, len) \ memcpy (ug_array_alloc ((array), len), values, ((UgArrayChar*)(array))->element_size * len) #define ug_array_terminate0(array) \ memset (ug_array_alloc ((array), 1), 0, ((UgArrayChar*)(array))->element_size) #define ug_array_end0(array) \ *((char*) ug_array_alloc ((array), 1)) = 0 // Quick sort and Binary search: // int compareFunc(const void *s1, const void *s2); #define ug_array_sort(array, compareFunc) \ qsort ((array)->at, (array)->length, (array)->element_size, compareFunc) #define ug_array_bsearch(array, key, compareFunc) \ bsearch(key, (array)->at, (array)->length, (array)->element_size, compareFunc) // ---------------------------------------------------------------------------- // UgJsonParseFunc for JSON array elements UgJsonError ug_json_parse_array_bool (UgJson* json, const char* name, const char* value, void* array, void* none); UgJsonError ug_json_parse_array_int (UgJson* json, const char* name, const char* value, void* array, void* none); UgJsonError ug_json_parse_array_uint (UgJson* json, const char* name, const char* value, void* array, void* none); UgJsonError ug_json_parse_array_int64 (UgJson* json, const char* name, const char* value, void* array, void* none); UgJsonError ug_json_parse_array_double (UgJson* json, const char* name, const char* value, void* array, void* none); UgJsonError ug_json_parse_array_string (UgJson* json, const char* name, const char* value, void* array, void* none); // ---------------------------------------------------------------------------- // write JSON array elements void ug_json_write_array_bool (UgJson* json, UgArrayInt* array); void ug_json_write_array_int (UgJson* json, UgArrayInt* array); void ug_json_write_array_uint (UgJson* json, UgArrayUint* array); void ug_json_write_array_int64 (UgJson* json, UgArrayInt64* array); void ug_json_write_array_double (UgJson* json, UgArrayDouble* array); void ug_json_write_array_string (UgJson* json, UgArrayStr* array); #ifdef __cplusplus } #endif // ---------------------------------------------------------------------------- // C++11 standard-layout #ifdef __cplusplus namespace Ug { // This one is for derived use only. No data members here. // Your derived struct/class must be C++11 standard-layout template struct ArrayMethod { inline void init (int allocated_len) { ug_array_init (this, sizeof (Type), allocated_len); } inline void final (void) { ug_array_clear (this); } inline Type* alloc (int nElements) { return (Type*) ug_array_alloc (this, nElements); } }; // This one is for directly use only. You can NOT derived it. template struct Array : ArrayMethod { UG_ARRAY_MEMBERS (Type); // Type* at; // int length; // int allocated; // int element_size; inline Array (int allocated_len = 0) { ug_array_init (this, sizeof (Type), allocated_len); } inline ~Array (void) { ug_array_clear (this); } }; }; // namespace Ug #endif // __cplusplus #endif // UG_ARRAY_H uget-2.2.0/uglib/UgList.h0000644000175000000120000001412513224532612012053 00000000000000/* * * Copyright (C) 2012-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #ifndef UG_LIST_H #define UG_LIST_H // uintptr_t is an unsigned int that is guaranteed to be the same size as a pointer. #include // uintptr_t, intptr_t #include #include #include #ifdef __cplusplus extern "C" { #endif typedef struct UgLink UgLink; typedef struct UgList UgList; // ---------------------------------------------------------------------------- // UgLink #define UG_LINK_MEMBERS(LinkType, DataType, DataName) \ DataType* DataName; \ LinkType* next; \ LinkType* prev #define UG_LINK_INT_MEMBERS(LinkType, DataName) \ intptr_t DataName; \ LinkType* next; \ LinkType* prev #define UG_LINK_UINT_MEMBERS(LinkType, DataName) \ uintptr_t DataName; \ LinkType* next; \ LinkType* prev struct UgLink { UG_LINK_MEMBERS (UgLink, void, data); // void* data; // uintptr_t size // UgLink* next; // head // UgLink* prev; // tail }; UgLink* ug_link_new (void); void ug_link_free (UgLink* link); // ---------------------------------------------------------------------------- // UgList is used by UgEntry with UG_ENTRY_LIST. // UgList doesn't support UG_ENTRY_INT64, UG_ENTRY_DOUBLE, and UG_ENTRY_OBJECT #define UG_LIST_MEMBERS(LinkType) \ uintptr_t size; \ LinkType* head; \ LinkType* tail struct UgList { UG_LIST_MEMBERS (UgLink); // uintptr_t size; // UgLink* head; // UgLink* tail; }; // if all links in list were created by ug_link_new(), // ug_list_clear (list, TRUE) can free them. void ug_list_init (UgList* list); void ug_list_clear (UgList* list, int free_links); void ug_list_foreach (UgList* list, UgForeachFunc func, void* data); void ug_list_foreach_link (UgList* list, UgForeachFunc func, void* data); void ug_list_prepend (UgList* list, UgLink* link); void ug_list_append (UgList* list, UgLink* link); void ug_list_insert (UgList* list, UgLink* sibling, UgLink* link); void ug_list_remove (UgList* list, UgLink* link); int ug_list_position(UgList* list, UgLink* link); // ---------------------------------------------------------------------------- // UgJsonParseFunc for JSON array elements UgJsonError ug_json_parse_list_bool (UgJson* json, const char* name, const char* value, void* list, void* none); UgJsonError ug_json_parse_list_int (UgJson* json, const char* name, const char* value, void* list, void* none); UgJsonError ug_json_parse_list_uint (UgJson* json, const char* name, const char* value, void* list, void* none); UgJsonError ug_json_parse_list_string (UgJson* json, const char* name, const char* value, void* list, void* none); // ---------------------------------------------------------------------------- // write JSON array elements // If you use these functions in UgEntry, UgEntry.type must be UG_ENTRY_ARRAY void ug_json_write_list_bool (UgJson* json, UgList* list); void ug_json_write_list_int (UgJson* json, UgList* list); void ug_json_write_list_uint (UgJson* json, UgList* list); void ug_json_write_list_string (UgJson* json, UgList* list); #ifdef __cplusplus } #endif // ---------------------------------------------------------------------------- // C++11 standard-layout #ifdef __cplusplus namespace Ug { // This one is for directly use only. You can NOT derived it. typedef struct UgLink Link; // This one is for derived use only. No data members here. // Your derived struct/class must be C++11 standard-layout struct ListMethod { inline void init (void) { ug_list_init ((UgList*) this); } inline void clear (bool freeLinks = false) { ug_list_clear ((UgList*) this, (int)freeLinks); } inline void foreach (UgForeachFunc func, void* data) { ug_list_foreach ((UgList*) this, func, data); } inline void prepend (UgLink* link) { ug_list_prepend ((UgList*) this, link); } inline void append (UgLink* link) { ug_list_append ((UgList*) this, link); } inline void insert (UgLink* sibling, UgLink* link) { ug_list_insert ((UgList*) this, sibling, link); } inline void remove (UgLink* link) { ug_list_remove ((UgList*) this, link); } }; // This one is for directly use only. You can NOT derived it. struct List : ListMethod, UgList { inline List (void) { ug_list_init (this); } }; }; // namespace Ug #endif // __cplusplus #endif // UG_LIST_H uget-2.2.0/uglib/UgData.h0000644000175000000120000001035413224532612012011 00000000000000/* * * Copyright (C) 2005-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #ifndef UG_DATA_H #define UG_DATA_H #include // uintptr_t #include #ifdef __cplusplus extern "C" { #endif typedef struct UgData UgData; typedef struct UgDataInfo UgDataInfo; typedef int (*UgAssignFunc) (void* instance, void* src); // ---------------------------------------------------------------------------- // UgDataInfo #define UG_DATA_INFO_MEMBERS \ const char* name; \ uintptr_t size; \ const UgEntry* entry; \ UgInitFunc init; \ UgFinalFunc final; \ UgAssignFunc assign struct UgDataInfo { UG_DATA_INFO_MEMBERS; // const char* name; // uintptr_t size; // const UgEntry* entry; // UgInitFunc init; // UgFinalFunc final; // UgAssignFunc assign; }; // ---------------------------------------------------------------------------- // UgData #define UG_DATA_MEMBERS \ const UgDataInfo* info struct UgData { UG_DATA_MEMBERS; // const UgDataInfo* info; }; // UgData* ug_data_new (const UgDataInfo* dinfo); // void ug_data_free (UgData* data); void* ug_data_new (const UgDataInfo* dinfo); void ug_data_free (void* data); void ug_data_init (void* data); void ug_data_final (void* data); // UgData* ug_data_copy (UgData* data); //void ug_data_assign (UgData* data, UgData* src); void* ug_data_copy (void* data); int ug_data_assign (void* data, void* src); // UgJsonParseFunc for UgData, used by UgEntry with UG_ENTRY_CUSTOM UgJsonError ug_json_parse_data (UgJson* json, const char* name, const char* value, void* data, void* none); // write UgData, used by UgEntry with UG_ENTRY_CUSTOM void ug_json_write_data (UgJson* json, const UgData* data); #ifdef __cplusplus } #endif // ---------------------------------------------------------------------------- // C++11 standard-layout #ifdef __cplusplus namespace Ug { typedef struct UgDataInfo DataInfo; // This one is for derived use only. No data members here. // Your derived struct/class must be C++11 standard-layout struct DataMethod { inline void init (const UgDataInfo* info) { *(UgDataInfo**)this = (UgDataInfo*)info; ug_data_init ((void*)this); } inline void init () { ug_data_init ((void*)this); } inline void final (void) { ug_data_final ((void*)this); } inline int assign (DataMethod* src) { return ug_data_assign ((void*)this, (void*)src); } inline DataMethod* copy (void) { return (DataMethod*) ug_data_copy ((void*)this); } }; // This one is for directly use only. You can NOT derived it. struct Data : DataMethod, UgData {}; }; // namespace Ug #endif // __cplusplus #endif // UG_DATA_H uget-2.2.0/uglib/Makefile.am0000644000175000000120000000240013224532565012527 00000000000000## To enable LFS (Large File Support) in 32bit platform ## add `getconf LFS_CFLAGS` to CFLAGS ## add `getconf LFS_LDFLAGS` to LDFLAGS ## static library --- # lib_LIBRARIES = libuglib.a noinst_LIBRARIES = libuglib.a libuglib_a_CPPFLAGS = -I$(top_srcdir)/uglib libuglib_a_CFLAGS = @PTHREAD_CFLAGS@ @LFS_CFLAGS@ @CURL_CFLAGS@ @GLIB_CFLAGS@ libuglib_a_SOURCES = \ UgStdio.c \ UgString.c \ UgThread.c \ UgSocket.c \ UgUtil.c \ UgFileUtil.c \ UgArray.c \ UgList.c \ UgSLink.c \ UgOption.c \ UgUri.c \ UgNode.c \ UgData.c \ UgInfo.c \ UgRegistry.c \ UgValue.c \ UgEntry.c \ UgBuffer.c \ UgJson.c \ UgJson-custom.c \ UgJsonFile.c \ UgJsonrpc.c \ UgJsonrpcSocket.c \ UgJsonrpcCurl.c \ UgHtml.c \ UgHtmlEntry.c \ UgHtmlFilter.c noinst_HEADERS = \ UgDefine.h \ UgStdio.h \ UgString.h \ UgThread.h \ UgSocket.h \ UgUtil.h \ UgFileUtil.h \ UgArray.h \ UgList.h \ UgSLink.h \ UgOption.h \ UgUri.h \ UgNode.h \ UgData.h \ UgInfo.h \ UgRegistry.h \ UgValue.h \ UgEntry.h \ UgBuffer.h \ UgJson.h \ UgJson-custom.h \ UgJsonFile.h \ UgJsonrpc.h \ UgJsonrpcSocket.h \ UgJsonrpcCurl.h \ UgHtml.h \ UgHtmlEntry.h \ UgHtmlFilter.h EXTRA_DIST = \ Android.mk \ CMakeLists.txt uget-2.2.0/uglib/UgJsonrpcSocket.h0000644000175000000120000000747313224532612013737 00000000000000/* * * Copyright (C) 2012-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #ifndef UG_JSONRPC_SOCKET_H #define UG_JSONRPC_SOCKET_H #include #ifdef __cplusplus extern "C" { #endif typedef struct UgJsonrpcSocket UgJsonrpcSocket; typedef struct UgSocketServer UgSocketServer; // ---------------------------------------------------------------------------- // UgJsonrpcSocket: JSON-RPC over Socket // +-----------------------------+ // | UgJsonrpcSocket | UgJsonrpcArray // buffer <--+--> UgJson <--> UgJsonrpc <--+--> or // | | UgJsonrpcObject // +-----------------------------+ #define UG_JSONRPC_SOCKET_MEMBERS \ UgJson json; \ UgJsonrpc rpc; \ UgBuffer buffer; \ int socket struct UgJsonrpcSocket { UG_JSONRPC_SOCKET_MEMBERS; // UgJson json; // UgJsonrpc rpc; // UgBuffer buffer; // int socket; }; void ug_jsonrpc_socket_init (UgJsonrpcSocket* jrsock); void ug_jsonrpc_socket_final (UgJsonrpcSocket* jrsock); // ------------------------------------ // Client API void ug_jsonrpc_socket_close (UgJsonrpcSocket* jrsock); int ug_jsonrpc_socket_connect (UgJsonrpcSocket* jrsock, const char* addr, const char* port_or_serv); #if !(defined _WIN32 || defined _WIN64) int ug_jsonrpc_socket_connect_unix (UgJsonrpcSocket* jrsock, const char* path, int path_len); #endif // ! (_WIN32 || _WIN64) int ug_jsonrpc_socket_send (UgJsonrpcSocket* jrsock); int ug_jsonrpc_socket_receive (UgJsonrpcSocket* jrsock); // ------------------------------------ // Server API // one thread handle all connection void ug_jsonrpc_socket_use_server (UgJsonrpcSocket* jrsock, UgSocketServer* server, UgJsonrpcServerFunc callback, void* data, void* data2); // one thread handle one connection void ug_socket_server_run_jsonrpc (UgSocketServer* server, UgJsonrpcServerFunc callback, void* data, void* data2); #ifdef __cplusplus } #endif #endif // UG_JSONRPC_SOCKET_H uget-2.2.0/uglib/UgSLink.h0000644000175000000120000000565113224532612012164 00000000000000/* * * Copyright (C) 2012-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #ifndef UG_SLINK_H #define UG_SLINK_H #include #include #ifdef __cplusplus extern "C" { #endif typedef struct UgSLink UgSLink; typedef struct UgSLinks UgSLinks; // ---------------------------------------------------------------------------- // UgSLink : for Singly-Linked List struct UgSLink { void* data; UgSLink* next; }; // ---------------------------------------------------------------------------- // UgSLinks : array of UgSLink #define UG_SLINKS_MEMBERS \ UG_ARRAY_MEMBERS (UgSLink); \ int n_links; \ UgSLink* used; \ UgSLink* freed \ struct UgSLinks { UG_SLINKS_MEMBERS; // UgSLink* at; // int length; // int allocated; // int element_size // int n_links; // UgSLink* used; // UgSLink* freed; }; void ug_slinks_init (UgSLinks* slinks, int allocated_len); void ug_slinks_final (UgSLinks* slinks); void ug_slinks_add (UgSLinks* slinks, void* data); void ug_slinks_remove (UgSLinks* slinks, void* data, UgSLink* prev); void ug_slinks_foreach (UgSLinks* ilinks, UgForeachFunc func, void* user_data); // return NULL if not found. UgSLink* ug_slinks_find (UgSLinks* slinks, void* data, UgSLink** prev); #define ug_slinks_index(slinks, link) ((link) - (slinks)->at) #ifdef __cplusplus } #endif #endif // End of UG_SLINK_H uget-2.2.0/uglib/UgHtmlEntry.h0000644000175000000120000001140513224532612013064 00000000000000/* * * Copyright (C) 2012-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #ifndef UG_HTML_ENTRY_H #define UG_HTML_ENTRY_H #include #ifdef __cplusplus extern "C" { #endif // ---------------------------------------------------------------------------- typedef struct UgHtmlEntry UgHtmlEntry; struct UgHtmlEntry { char* name; int offset; const UgHtmlParser* parser; void* param1; void* param2; }; // parser for UgHtmlEntry extern const UgHtmlParser ug_html_parser_entry; void ug_html_start_element_entry (UgHtml* uhtml, const char* element_name, const char** attribute_names, const char** attribute_values, void* dest, void* entry); // UgHtmlEntry.name = element_name // UgHtmlEntry.offset = offset of structure // if UgHtmlEntry.parser == NULL, this entry is null-terminated. // if UgHtmlEntry.name == NULL, it can match any name. // it usually uses at first or last entry. // if UgHtmlEntry.parser == ug_html_parser_custom // UgEntry.param1 = start element function (UgHtmlParserStartElementFunc) // UgEntry.param2 = custom writer function // UgHtmlEntry.parser == ug_html_parser_int, ug_html_parser_string...etc // UgHtmlEntry.param2 = UgHtmlEntry for attribute // UgHtmlEntry.parser == ug_html_parser_string // If you don't want to output anything when string value is NULL, // set UgHtmlEntry.param1 != NULL. // UgHtmlEntry.param2 = UgHtmlEntry for attribute // UgHtmlEntry.parser == ug_html_parser_entry // UgHtmlEntry.param1 = UgHtmlEntry // UgHtmlEntry.param2 = UgHtmlEntry for attribute // ------------------------------------ // parser for unknown element extern const UgHtmlParser ug_html_parser_unknown; void ug_html_start_element_unknown (UgHtml* uhtml, const char* element_name, const char** attribute_names, const char** attribute_values, void* dest, void* data); void ug_html_end_element_unknown (UgHtml* uhtml, const char* element_name, void* dest, void* data); // ------------------------------------ // parser for C type extern const UgHtmlParser ug_html_parser_bool; extern const UgHtmlParser ug_html_parser_int; extern const UgHtmlParser ug_html_parser_uint; extern const UgHtmlParser ug_html_parser_int64; extern const UgHtmlParser ug_html_parser_uint64; extern const UgHtmlParser ug_html_parser_double; extern const UgHtmlParser ug_html_parser_string; extern const UgHtmlParser ug_html_parser_custom; // ------------------------------------ // parser for time_t. // RFC3339: 2012-05-23T18:30:00.000-05:00 // 2013-09-12T22:50:20+08:00 // RFC822: Sat, 07 Sep 2002 00:00:01 GMT extern const UgHtmlParser ug_html_parser_time_rfc822; extern const UgHtmlParser ug_html_parser_time_rfc3339; #ifdef __cplusplus } #endif #endif // UG_HTML_ENTRY_H uget-2.2.0/uglib/UgJsonrpcSocket.c0000644000175000000120000001600113224532612013715 00000000000000/* * * Copyright (C) 2012-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #include #include #include #include #include #include #if defined _WIN32 || defined _WIN64 static int global_ref_count = 0; #endif void ug_jsonrpc_socket_init (UgJsonrpcSocket* jrsock) { #if defined _WIN32 || defined _WIN64 WSADATA WSAData; if (global_ref_count == 0) WSAStartup (MAKEWORD (2, 2), &WSAData); global_ref_count++; #endif // _WIN32 || _WIN64 ug_buffer_init (&jrsock->buffer, 4096); ug_json_init (&jrsock->json); ug_jsonrpc_init (&jrsock->rpc, &jrsock->json, &jrsock->buffer); jrsock->socket = INVALID_SOCKET; jrsock->rpc.send.func = (UgJsonrpcFunc) ug_jsonrpc_socket_send; jrsock->rpc.send.data = jrsock; jrsock->rpc.receive.func = (UgJsonrpcFunc) ug_jsonrpc_socket_receive; jrsock->rpc.receive.data = jrsock; } void ug_jsonrpc_socket_final (UgJsonrpcSocket* jrsock) { closesocket (jrsock->socket); jrsock->socket = INVALID_SOCKET; ug_json_final (&jrsock->json); ug_jsonrpc_clear (&jrsock->rpc); ug_buffer_clear (&jrsock->buffer, TRUE); #if defined _WIN32 || defined _WIN64 global_ref_count--; if (global_ref_count == 0) WSACleanup (); #endif } void ug_jsonrpc_socket_close (UgJsonrpcSocket* jrsock) { closesocket (jrsock->socket); jrsock->socket = INVALID_SOCKET; } int ug_jsonrpc_socket_connect (UgJsonrpcSocket* jrsock, const char* addr, const char* port_or_serv) { SOCKET fd; if (jrsock->socket != INVALID_SOCKET) return FALSE; fd = socket (AF_INET, SOCK_STREAM, 0); if (fd == INVALID_SOCKET) return FALSE; if (ug_socket_connect (fd, addr, port_or_serv) == SOCKET_ERROR) { closesocket (fd); return FALSE; } jrsock->socket = fd; return TRUE; } #if !(defined _WIN32 || defined _WIN64) int ug_jsonrpc_socket_connect_unix (UgJsonrpcSocket* jrsock, const char* path, int path_len) { int fd; if (jrsock->socket != INVALID_SOCKET) return FALSE; fd = socket (AF_UNIX, SOCK_STREAM, 0); if (fd == -1) return FALSE; if (ug_socket_connect_unix (fd, path, path_len) < 0) { close (fd); return FALSE; } jrsock->socket = fd; return TRUE; } #endif // ! (_WIN32 || _WIN64) int ug_jsonrpc_socket_send (UgJsonrpcSocket* jrsock) { int n; n = send (jrsock->socket, jrsock->buffer.beg, jrsock->buffer.cur - jrsock->buffer.beg, 0); jrsock->buffer.cur = jrsock->buffer.beg; if (n == -1) return -1; return n; } int ug_jsonrpc_socket_receive (UgJsonrpcSocket* jrsock) { int length; int buffer_size; int error; int receive_size = 0; buffer_size = jrsock->buffer.end - jrsock->buffer.beg; do { // if connection was closed, read()/recv()/recvXXX() will return zero. length = recv (jrsock->socket, jrsock->buffer.beg, buffer_size, 0); if (length == -1) return -1; error = ug_json_parse (&jrsock->json, jrsock->buffer.beg, length); if (error < 0 || jrsock->rpc.error == 0) jrsock->rpc.error = error; receive_size += length; } while (length == buffer_size); return receive_size; } // ---------------------------------------------------------------------------- // Server API // ------------------------------------ // one thread handle all connection static void on_receiving_all (UgSocketServer* server, SOCKET client_fd, void* data) { UgJsonrpcSocket* jrsock; UgJsonrpcServerFunc callback; jrsock = data; jrsock->socket = client_fd; callback = server->user.data3; callback (&jrsock->rpc, server->user.data, server->user.data2); } void ug_jsonrpc_socket_use_server (UgJsonrpcSocket* jrsock, UgSocketServer* server, UgJsonrpcServerFunc callback, void* data, void* data2) { server->user.data = data; server->user.data2 = data2; server->user.data3 = callback; ug_socket_server_set_receiver (server, on_receiving_all, jrsock); } // ------------------------------------ // one thread handle one connection struct UgJsonrpcSocketThread { UG_JSONRPC_SOCKET_MEMBERS; // UgJson json; // UgJsonrpc rpc; // UgBuffer buffer; // int socket; UgSocketServer* server; UgThread thread; }; static UG_THREAD_RETURN_TYPE jrpc_thread (struct UgJsonrpcSocketThread* jrst) { UgSocketServer* server; UgJsonrpcServerFunc callback; server = jrst->server; callback = server->user.data3; callback (&jrst->rpc, server->user.data, server->user.data2); ug_jsonrpc_socket_final ((UgJsonrpcSocket*) jrst); ug_free (jrst); ug_socket_server_unref (server); // ref() on on_accepted() return UG_THREAD_RETURN_VALUE; } static void on_receiving (UgSocketServer* server, SOCKET client_fd, void* data) { struct UgJsonrpcSocketThread* jrst; ug_socket_server_ref (server); // unref() on service_thread() // create UgJsonrpcSocket to accept JSON-RPC request jrst = ug_malloc (sizeof (struct UgJsonrpcSocketThread)); ug_jsonrpc_socket_init ((UgJsonrpcSocket*) jrst); jrst->socket = client_fd; jrst->server = server; ug_thread_create (&jrst->thread, (UgThreadFunc) jrpc_thread, jrst); ug_thread_unjoin (&jrst->thread); } void ug_socket_server_run_jsonrpc (UgSocketServer* server, UgJsonrpcServerFunc callback, void* data, void* data2) { server->user.data = data; server->user.data2 = data2; server->user.data3 = callback; ug_socket_server_set_receiver (server, on_receiving, NULL); ug_socket_server_start (server); } uget-2.2.0/uglib/UgHtmlFilter.h0000644000175000000120000000620313224532612013210 00000000000000/* * * Copyright (C) 2012-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #ifndef UG_HTML_FILTER_H #define UG_HTML_FILTER_H #include #include #ifdef __cplusplus extern "C" { #endif typedef struct UgHtmlFilter UgHtmlFilter; typedef struct UgHtmlFilterTag UgHtmlFilterTag; typedef void (*UgHtmlFilterTagFunc) (UgHtmlFilterTag* tag, const char* value, void* user_data); // ---------------------------------------------------------------------------- // UgHtmlFilter struct UgHtmlFilter { UgHtml html; char* base_href; char* charset; const char* element_name; UgList tags; }; UgHtmlFilter* ug_html_filter_new (void); void ug_html_filter_free (UgHtmlFilter* filter); void ug_html_filter_add_tag (UgHtmlFilter* filter, UgHtmlFilterTag* tag); int ug_html_filter_parse_file (UgHtmlFilter* filter, const char* file_utf8); // ---------------------------------------------------------------------------- // UgHtmlFilterTag struct UgHtmlFilterTag { UG_LINK_MEMBERS (UgHtmlFilterTag, UgHtmlFilterTag, self); // UgHtmlFilterTag* self; // UgHtmlFilterTag* next; // UgHtmlFilterTag* prev; int ref_count; char* tag_name; // element name char* attr_name; // attribute name UgList attr_values; // attribute values, string list UgHtmlFilter* filter; // callback UgHtmlFilterTagFunc callback; void* callback_data; }; UgHtmlFilterTag* ug_html_filter_tag_new (char* element_name, char* attr_name); void ug_html_filter_tag_ref (UgHtmlFilterTag* tag); void ug_html_filter_tag_unref (UgHtmlFilterTag* tag); #ifdef __cplusplus } #endif #endif // UG_HTML_FILTER_H uget-2.2.0/uglib/UgJsonrpc.h0000644000175000000120000001752313224532612012563 00000000000000/* * * Copyright (C) 2012-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #ifndef UG_JSONRPC_H #define UG_JSONRPC_H #include #include #include #include #ifdef __cplusplus extern "C" { #endif typedef struct UgJsonrpc UgJsonrpc; typedef struct UgJsonrpcError UgJsonrpcError; typedef struct UgJsonrpcObject UgJsonrpcObject; typedef UG_ARRAY(UgJsonrpcObject*) UgJsonrpcArray; typedef void (*UgJsonrpcServerFunc) (UgJsonrpc* jrpc, void* data, void* data2); // UgEntry for JSON parser and writer extern const UgEntry UgJsonrpcErrorEntry[]; extern const UgEntry UgJsonrpcObjectEntry[]; // ---------------------------------------------------------------------------- // UgJsonrpcError: JSON-RPC error object struct UgJsonrpcError { // JSON-RPC error code: // -32700 Parse error. Invalid JSON was received by the server. // An error occurred on the server while parsing the JSON text. // -32600 Invalid Request The JSON sent is not a valid Request object. // -32601 Method not found The method does not exist / is not available. // -32602 Invalid params Invalid method parameter(s). // -32603 Internal error Internal JSON-RPC error. int code; char* message; // This may be omitted. // A Primitive or Structured value that contains additional information about the error. // The value of this member is defined by the Server // (e.g. detailed error information, nested errors etc.). UgValue data; }; // ---------------------------------------------------------------------------- // UgJsonrpcObject struct UgJsonrpcObject { // char* jsonrpc; // version string // A Notification is a Request object without an "id" member. UgValue id; // request char* method; const char* method_static; // This member MAY be omitted. UgValue params; // response // This member MUST NOT exist if there was an error. UgValue result; // This member MUST NOT exist if there was no error. UgJsonrpcError error; }; UgJsonrpcObject* ug_jsonrpc_object_new (void); void ug_jsonrpc_object_free (UgJsonrpcObject* jrobj); void ug_jsonrpc_object_init (UgJsonrpcObject* jrobj); void ug_jsonrpc_object_clear (UgJsonrpcObject* jrobj); void ug_jsonrpc_object_clear_request (UgJsonrpcObject* jrobj); void ug_jsonrpc_object_clear_response (UgJsonrpcObject* jrobj); // check request, and return error code. //int ug_jsonrpc_object_check (UgJsonrpcObject* jrobj); // parser: ug_json_parse_entry // writer: ug_json_write_entry will output all value in UgJsonrpcObject. // use below function to output JSON-RPC request and response object void ug_json_write_rpc_object (UgJson* json, UgJsonrpcObject* jrobj); // ---------------------------------------------------------------------------- // UgJsonrpcArray: a UgJsonrpcObject array for batch //void ug_jsonrpc_array_init (UgJsonrpcArray* joarray, int allocated_len); #define ug_jsonrpc_array_init(array, allocated_len) \ ug_array_init (array, sizeof (UgJsonrpcObject*), allocated_len) // param free_objects: TRUE or FALSE void ug_jsonrpc_array_clear (UgJsonrpcArray* joarray, int free_objects); UgJsonrpcObject* ug_jsonrpc_array_find (UgJsonrpcArray* joarray, UgValue* id, int* index); UgJsonrpcObject* ug_jsonrpc_array_alloc (UgJsonrpcArray* joarray); // ------------------------------------ UgJsonError ug_json_parse_rpc_array (UgJson* json, const char* name, const char* value, void* jrarray, void* none); // param noArrayIfPossible: TRUE or FALSE void ug_json_write_rpc_array (UgJson* json, UgJsonrpcArray* objects, int noArrayIfPossible); // If program doesn't known incoming data type, // this function can parse UgJsonrpcArray or UgJsonrpcObject. // This function used by server. UgJsonError ug_json_parse_rpc_unknown (UgJson* json, const char* name, const char* value, void* jrarray, void* jrobject); // ---------------------------------------------------------------------------- // UgJsonrpc: JSON-RPC Client & Server // +-----------------------------+ // | UgJsonrpcXXXX | UgJsonrpcArray // buffer <--+--> UgJson <--> UgJsonrpc <--+--> or // | | UgJsonrpcObject // +-----------------------------+ // send/receive return input or output size // send/receive return -1 = error // receive return 0 if connection close typedef int (*UgJsonrpcFunc) (void* target); struct UgJsonrpc { UgJson* json; UgBuffer* buffer; UgJsonError error; // input/output function struct { UgJsonrpcFunc func; void* data; } send, receive; union { // client struct { intptr_t current; intptr_t previous; } id; // server struct { UgJsonrpcObject* object; UgJsonrpcArray* array; } request; } data; }; void ug_jsonrpc_init (UgJsonrpc* jrpc, UgJson* json, UgBuffer* buffer); void ug_jsonrpc_clear (UgJsonrpc* jrpc); // ------------------------------------ // client API : set response == NULL if this is notify request // if error occurred, return -1 int ug_jsonrpc_call (UgJsonrpc* jrpc, UgJsonrpcObject* request, UgJsonrpcObject* response); int ug_jsonrpc_call_batch (UgJsonrpc* jrpc, UgJsonrpcArray* request, UgJsonrpcArray* response); // ------------------------------------ // server API // return 0 if remote disconnected. // return -1 if error occurred. // if ok, return UG_JSON_ARRAY or UG_JSON_OBJECT and set jr_array or jr_object. int ug_jsonrpc_receive (UgJsonrpc* jrpc, UgJsonrpcObject* jr_object, UgJsonrpcArray* jr_array); int ug_jsonrpc_response (UgJsonrpc* jrpc, UgJsonrpcObject* jr_object); int ug_jsonrpc_response_batch (UgJsonrpc* jrpc, UgJsonrpcArray* jr_array); // This function used by UgJsonrpc server mode. UgJsonError ug_json_parse_rpc_request (UgJson* json, const char* name, const char* value, void* jsonrpc, void* type); #ifdef __cplusplus } #endif #endif // UG_JSONRPC_H uget-2.2.0/uglib/UgHtmlFilter.c0000644000175000000120000001667513224532612013221 00000000000000/* * * Copyright (C) 2012-2018 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #include #include #include static UgHtmlParser default_parser; static UgHtmlParser script_parser; static UgHtmlParser head_parser; UgHtmlFilter* ug_html_filter_new (void) { UgHtmlFilter* filter; filter = ug_malloc (sizeof (UgHtmlFilter)); ug_html_init ((UgHtml*) filter); filter->base_href = NULL; filter->charset = NULL; ug_list_init (&filter->tags); ug_html_push ((UgHtml*)filter, &default_parser, NULL, NULL); return (UgHtmlFilter*) filter; } void ug_html_filter_free (UgHtmlFilter* filter) { ug_free (filter->base_href); ug_free (filter->charset); ug_list_foreach (&filter->tags, (UgForeachFunc) ug_html_filter_tag_unref, NULL); ug_list_clear (&filter->tags, FALSE); ug_free (filter); } void ug_html_filter_add_tag (UgHtmlFilter* filter, UgHtmlFilterTag* tag) { ug_list_prepend (&filter->tags, (UgLink*) tag); ug_html_filter_tag_ref (tag); tag->filter = filter; } int ug_html_filter_parse_file (UgHtmlFilter* filter, const char* file_utf8) { UgHtml* uhtml; uhtml = (UgHtml*) filter; ug_html_push (uhtml, &default_parser, NULL, NULL); return ug_html_parse_file (uhtml, file_utf8); } // ---------------------------------------------------------------------------- // UgHtmlFilterTag UgHtmlFilterTag* ug_html_filter_tag_new (char* element_name, char* attr_name) { UgHtmlFilterTag* tag; tag = ug_malloc0 (sizeof (UgHtmlFilterTag)); tag->self = tag; tag->tag_name = ug_strdup (element_name); tag->attr_name = ug_strdup (attr_name); ug_list_init (&tag->attr_values); tag->ref_count = 1; return tag; } void ug_html_filter_tag_ref (UgHtmlFilterTag* tag) { tag->ref_count++; } void ug_html_filter_tag_unref (UgHtmlFilterTag* tag) { tag->ref_count--; if (tag->ref_count == 0) { ug_free (tag->tag_name); ug_free (tag->attr_name); ug_list_foreach (&tag->attr_values, (UgForeachFunc) ug_free, NULL); ug_list_clear (&tag->attr_values, TRUE); ug_free (tag); } } // ---------------------------------------------------------------------------- // default parser static void cb_start_element (UgHtml* uhtml, const char* element_name, const char** attribute_names, const char** attribute_values, void* dest) { UgHtmlFilter* filter = (UgHtmlFilter*) uhtml; UgHtmlFilterTag* tag; UgLink* link; UgLink* strlink; if (strcasecmp (element_name, "script") == 0) { ug_html_push (uhtml, &script_parser, NULL, NULL); return; } if (strcasecmp (element_name, "head") == 0) { ug_html_push (uhtml, &head_parser, NULL, NULL); return; } // filter tag for (link = filter->tags.head; link; link = link->next) { tag = link->data; if (strcasecmp (element_name, tag->tag_name) != 0) continue; for (; *attribute_names; attribute_names++, attribute_values++) { if (strcasecmp (*attribute_names, tag->attr_name) != 0) continue; if (tag->callback) tag->callback (tag, *attribute_values, tag->callback_data); else { strlink = ug_link_new (); strlink->data = ug_strdup (*attribute_values); ug_list_prepend (&tag->attr_values, strlink); } } } } static UgHtmlParser default_parser = { (void*) cb_start_element, (void*) NULL, (void*) NULL, }; // ---------------------------------------------------------------------------- // parser -